From 05fa397138c9083ffde0281b9b7af91a86778768 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Wed, 12 Aug 2015 23:28:01 +0200 Subject: [PATCH] =?UTF-8?q?Task=20#1149=20-=20Tableau=20de=20bord=20:=20aj?= =?UTF-8?q?out=20des=2010=20derniers=20=C3=A9v=C3=A9nement=20Show=20the=20?= =?UTF-8?q?last=20actions=20on=20the=20dashboard?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/class_follow_up.php | 15 ++++++++--- include/constant.php | 1 + include/template/dashboard.php | 49 +++++++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 13 deletions(-) diff --git a/include/class_follow_up.php b/include/class_follow_up.php index 4601de64a..005e6e2de 100644 --- a/include/class_follow_up.php +++ b/include/class_follow_up.php @@ -120,10 +120,12 @@ class Follow_Up if ($p_mode=='R') { $sql=" (ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile ) ) "; - } - if ($p_mode=='W') + } else if ($p_mode=='W') { $sql=" ( ag_dest in (select p_granted from user_sec_action_profile where p_id=$profile and ua_right='W' ) )"; + } else { + error_log(_('Securité')); + throw new Exception(_('Securité')); } return $sql; } @@ -1073,16 +1075,21 @@ class Follow_Up } /** - * \brief return the last p_limit operation into an array, there is no security + * \brief return the last p_limit operation into an array, there is a security * on user * \param $p_limit is the max of operation to return * \return $p_array of Follow_Up object */ function get_last($p_limit) { + $sql="select coalesce(vw_name,'Interne') as vw_name,ag_id,ag_title,ag_ref, dt_value,to_char(ag_timestamp,'DD.MM.YYYY') as ag_timestamp_fmt,ag_timestamp ". " from action_gestion join document_type ". - " on (ag_type=dt_id) left join vw_fiche_attr on (f_id=f_id_dest) where ag_state in (2,3) order by ag_timestamp desc limit $p_limit"; + " on (ag_type=dt_id) " + . "left join vw_fiche_attr on (f_id=f_id_dest) " + . "where ag_state in (2,3) " + . "and ".self::sql_security_filter($this->db,'R'). + "order by ag_timestamp desc limit $p_limit"; $array=$this->db->get_array($sql); return $array; } diff --git a/include/constant.php b/include/constant.php index 250b5cdca..75b6e7de4 100644 --- a/include/constant.php +++ b/include/constant.php @@ -113,6 +113,7 @@ define ('MAX_RECONCILE',25); define ('MAX_QCODE',4); define ('MAX_SEARCH_CARD',20); define ('MAX_FOLDER_TO_SHOW',20); +define ('MAX_ACTION_SHOW',20); if ( DEBUG ) { error_reporting(2147483647); diff --git a/include/template/dashboard.php b/include/template/dashboard.php index 73c11d2d0..a4e422188 100644 --- a/include/template/dashboard.php +++ b/include/template/dashboard.php @@ -261,22 +261,20 @@ for($i=0;$i > - + + - - - - + - + - + - + @@ -285,7 +283,40 @@ for($i=0;$i - +
+ + get_last(MAX_ACTION_SHOW); + $len_array=count($array); + ?> + + + + + + + + + +
+ + + + + + + +
+