diff --git a/html/js/scripts.js b/html/js/scripts.js index 929cb4a7b..a83dfd5ee 100644 --- a/html/js/scripts.js +++ b/html/js/scripts.js @@ -2053,6 +2053,7 @@ function view_action(ag_id, dossier, modify) }); $(id).innerHTML = code_html; if ( ctl_txt == 'ok') { compute_all_ledger();} + code_html.evalScripts(); } catch (e) { alert_box('view_action' + e.message); } diff --git a/html/style-classic.css b/html/style-classic.css index 6485c72d9..f972e21e7 100644 --- a/html/style-classic.css +++ b/html/style-classic.css @@ -1846,7 +1846,7 @@ hr { /****************************************************************************** * Hightlight row in a table ******************************************************************************/ -tr.highlight{ +li.highlight,tr.highlight{ font-weight: bolder; font-size:14px; background-color: navy; @@ -1855,7 +1855,7 @@ tr.highlight{ border-style: solid; border-color: blue; } -tr.highlight a{ +li.highlight a,tr.highlight a{ color:white !important; } diff --git a/html/style-light.css b/html/style-light.css index 0d4bd4fc6..4bb67b13f 100644 --- a/html/style-light.css +++ b/html/style-light.css @@ -1803,7 +1803,7 @@ hr { /****************************************************************************** * Hightlight row in a table ******************************************************************************/ -tr.highlight{ +li.highlight , tr.highlight{ font-weight: bolder; font-size:14px; background-color: #334975 !important; @@ -1812,7 +1812,7 @@ tr.highlight{ border-style: solid; border-color: blue; } -tr.highlight a{ +li.highlight a, tr.highlight a{ color:white !important; } diff --git a/html/style-mandarine.css b/html/style-mandarine.css index 1b66ab3d7..0099a821f 100644 --- a/html/style-mandarine.css +++ b/html/style-mandarine.css @@ -1831,7 +1831,7 @@ filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#feccb1', end /****************************************************************************** * Hightlight row in a table ******************************************************************************/ -tr.highlight{ +li.highlight a,tr.highlight{ font-weight: bolder; font-size:14px; background-color: lightgrey ! important; @@ -1841,12 +1841,12 @@ tr.highlight{ border-color: inherit; } -tr.highlight a{ +li.highlight a,tr.highlight a{ color:white !important; background-color:grey !important; } -//--- Top menu and menu2 +/*--- Top menu and menu2-*/ div.topmenu a.mtitle , div.menu2 a.mtitle{ font-size:13.6px; font-size:0.85rem; diff --git a/include/class/class_follow_up.php b/include/class/class_follow_up.php index 8dc084cdc..13323bd29 100644 --- a/include/class/class_follow_up.php +++ b/include/class/class_follow_up.php @@ -210,16 +210,6 @@ class Follow_Up $iconcerned=new IConcerned('operation'); // List related action - $action=$this->db->get_array(" - select ag_id,ag_ref,substr(ag_title,1,40) as sub_title,to_char(ag_timestamp,'DD.MM.YY') as str_date , - ag_timestamp,dt_value - from action_gestion - join document_type on (ag_type=dt_id) - where - ag_id in (select aga_greatest from action_gestion_related where aga_least =$1) - or - ag_id in (select aga_least from action_gestion_related where aga_greatest =$1) - order by ag_timestamp", array($this->ag_id)); $iaction=new IRelated_Action('action'); $iaction->value=(isset($this->action))?$this->action:""; @@ -1842,4 +1832,153 @@ class Follow_Up , array($this->ag_id, $_SESSION['g_user'], $this->ag_comment)); } } + /** + * Return the first parent of the event tree, or -1 if not found + * @return integer (ag_id) + */ + function get_parent() { + $value=$this->db->get_array(' + with recursive t (aga_least,aga_greatest,depth) as ( + select aga_least,aga_greatest , 1 + from + action_gestion_related + where aga_greatest=$1 + union all + select p2.aga_least,p2.aga_greatest,depth + 1 + from + t as p1, action_gestion_related as p2 + where + p2.aga_greatest is not null and + p2.aga_greatest = p1.aga_least + ) select * from t order by depth desc limit 1 + ' , array($this->ag_id) + ); + if ( ! empty($value ) ) + return $value[0]['aga_least']; + else + return -1; + } + /** + * Compute an array of the complete tree depending of $p_id + * @param $p_id ag_id + * @return array + * key index : + * - uniq value , path + * - aga_least + * - aga_greatest + * - depth + */ + function get_children($p_id) { + // retrieve parent + // Get information + $sql = "with recursive t (key_path, aga_least,aga_greatest,depth) as ( + select + aga_least::text||'-'||aga_greatest::text as key_path , + aga_least,aga_greatest , 1 + from + action_gestion_related + where aga_least=$1 + union all + select key_path||'-'||p2.aga_greatest::text, + p2.aga_least,p2.aga_greatest,depth + 1 + from + t as p1, action_gestion_related as p2 + where + p1.aga_greatest is not null and + p1.aga_greatest = p2.aga_least + ) + select key_path,aga_greatest,ag_title as title,depth ,to_char(ag_timestamp,'DD/MM/YY') as str_date,dt_value as action_ref + from + action_gestion join t on (ag_id=aga_greatest) + join document_type on (ag_type=dt_id) + order by key_path + +"; + $ret_array=$this->db->get_array($sql,array($p_id)); + // Empty returns + if ( empty($ret_array)) return array(); + + + return $ret_array; + } + + /** + * Display the tree of childrens of the current Action + related parents + * @return return the tree of children in a unordered list , HTML string + */ + function display_children($p_view, $p_base) + { + /** + * First we retrieve the parent + */ + $parent=$this->get_parent(); + + $base=HtmlInput::request_to_string(array("gDossier", "ac", "sa", "sb", "sc", + "f_id")); + $parent=$this->get_parent(); + if ($parent==-1) + { + echo _('Principal'); + $parent = $this->ag_id; + } + else + { + $fu_parent=new Follow_Up($this->db, $parent); + $fu_parent->get(); + echo''; + $xaction=sprintf('view_action(%d,%d,%d)', $fu_parent->ag_id, + Dossier::id(), 1); + $showAction=''; + echo $showAction. + $fu_parent->ag_timestamp," ", + h($fu_parent->ag_title), + '('.h($fu_parent->ag_ref).')', + ''; + + echo ""; + } + echo '
- -Document créé le ag_timestamp ?> par ag_owner?> - -
input();
?>
@@ -267,27 +234,23 @@ Document créé le ag_timestamp ?> par ag_ow
for( $c=0;$c
+ { $m_desc=_('Commentaire');}
- 0)
{
$rmComment=sprintf("return confirm_box(null,'"._('Voulez-vous effacer ce commentaire')." ?',function() {remove_comment('%s','%s');});",
dossier::id(),
$acomment[$c]['agc_id']);
$js= ''.SMALLX.'';
- echo hb('n°'.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".$acomment[$c]['str_agc_date'].')').$js.
- ' '.
+ echo h($m_desc.' '.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".$acomment[$c]['str_agc_date'].')').$js.
+ ' '.
" ".h($acomment[$c]['agc_comment']).'
'
;
}
else
{
- echo hb('n°'.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".$acomment[$c]['str_agc_date'].')').
- ' '.
+ echo h($m_desc.' '.$acomment[$c]['agc_id'].'('.$acomment[$c]['tech_user']." ".$acomment[$c]['str_agc_date'].')').
+ ' '.
" ".h($acomment[$c]['agc_comment']).'
'
;
@@ -509,5 +472,24 @@ catch(exception) { alert('