noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 09/13: Calendar : highlight late action


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 09/13: Calendar : highlight late action
Date: Sun, 07 Jun 2015 17:57:28 +0000

sparkyx pushed a commit to branch master
in repository noalyss.

commit b2c50ebde6e14de3c4fd9faa0abe531123e9186b
Author: Dany De Bontridder <address@hidden>
Date:   Fri Jun 5 22:00:33 2015 +0200

    Calendar : highlight late action
---
 include/class_calendar.php         |    9 ++++++---
 include/template/calendar-list.php |    9 +++++++++
 2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/include/class_calendar.php b/include/class_calendar.php
index 8519d34..e2c43bb 100644
--- a/include/class_calendar.php
+++ b/include/class_calendar.php
@@ -299,12 +299,15 @@ class Calendar
         // union the TODO list
         $sql = "
           select ag_id,ag_remind_date,to_char(ag_remind_date,'DD.MM.YY') as 
str_date,ag_title,ag_hour,
-             coalesce(name,'interne') as str_name
+             coalesce(name,'interne') as str_name,
+             case when ag_remind_date < now() then 'R' 
+                when ag_remind_date = now() then 'N' 
+                else 'F'
+              end as status
               from action_gestion 
                left join vw_fiche_name  on (f_id=f_id_dest)
               where 
-              ag_remind_date >= now() 
-              and ag_dest in (select p_granted from user_sec_action_profile 
where p_id =$1)
+               ag_dest in (select p_granted from user_sec_action_profile where 
p_id =$1)
               and ag_state IN (2, 3)
               order by ag_remind_date,ag_hour
         ";
diff --git a/include/template/calendar-list.php 
b/include/template/calendar-list.php
index ca9af88..e700f0c 100644
--- a/include/template/calendar-list.php
+++ b/include/template/calendar-list.php
@@ -35,11 +35,20 @@
     <table class="result">
 <?php
     $nb_event=count($a_event);
+    $a_status=array('R'=>_('Retard'),'N'=>'Auj.','F'=>'');
     for ($i=0;$i<$nb_event;$i++):
         $class=($i % 2 == 0 )? 'even':'odd';
+        $idx=$a_event[$i]['status'];
+        $class=($idx=='R')?'notice':$class;
+        
 ?>
         <tr class="<?php echo $class?>">
             <td>
+                <?php
+                echo $a_status[$idx];
+                ?>
+            </td>
+            <td>
                 <?php echo $a_event[$i]['str_date']; ?>
                 &nbsp; 
                 <?php echo $a_event[$i]['ag_hour']; ?>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]