phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4904 - in phpcompta/trunk/include: . template


From: phpcompta-dev
Subject: [Phpcompta-dev] r4904 - in phpcompta/trunk/include: . template
Date: Fri, 15 Jun 2012 02:51:28 +0200 (CEST)

Author: danydb
Date: 2012-06-15 02:51:26 +0200 (Fri, 15 Jun 2012)
New Revision: 4904

Modified:
   phpcompta/trunk/include/ac_common.php
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/category_followup.inc.php
   phpcompta/trunk/include/class_calendar.php
   phpcompta/trunk/include/class_follow_up.php
   phpcompta/trunk/include/class_icard.php
   phpcompta/trunk/include/template/action_search.php
   phpcompta/trunk/include/template/detail-action.php
Log:
search by remind date 

Modified: phpcompta/trunk/include/ac_common.php
===================================================================
--- phpcompta/trunk/include/ac_common.php       2012-06-14 21:45:35 UTC (rev 
4903)
+++ phpcompta/trunk/include/ac_common.php       2012-06-15 00:51:26 UTC (rev 
4904)
@@ -203,7 +203,7 @@
        return 0;
 }
 
-/* !
+/***
  * \brief Verifie qu'une date est bien formaté
  *           en d.m.y et est valable
  * \param $p_date

Modified: phpcompta/trunk/include/action.common.inc.php
===================================================================
--- phpcompta/trunk/include/action.common.inc.php       2012-06-14 21:45:35 UTC 
(rev 4903)
+++ phpcompta/trunk/include/action.common.inc.php       2012-06-15 00:51:26 UTC 
(rev 4904)
@@ -194,7 +194,7 @@
        Follow_Up::ShowActionList($cn, $base);
        // Add a button to export to Csv
        echo '<form method="GET" ACTION="export.php">';
-       echo HtmlInput::request_to_hidden(array("sag_ref", "only_internal", 
"state", "gDossier", "qcode", "start_date", "end_date", "ag_id", 
"ag_dest_query",
+       echo HtmlInput::request_to_hidden(array("remind_date","sag_ref", 
"remind_date","only_internal", "state", "gDossier", "qcode", "start_date", 
"end_date", "ag_id", "ag_dest_query",
                "tdoc", "see_all", "all_action", "query"));
        echo HtmlInput::hidden("act", "CSV:ActionGestion");
        echo HtmlInput::submit("follow_up_csv", "Export CSV");

Modified: phpcompta/trunk/include/action.inc.php
===================================================================
--- phpcompta/trunk/include/action.inc.php      2012-06-14 21:45:35 UTC (rev 
4903)
+++ phpcompta/trunk/include/action.inc.php      2012-06-15 00:51:26 UTC (rev 
4904)
@@ -23,7 +23,7 @@
  */
 require_once('class_ipopup.php');
 global $g_user;
-$retour=HtmlInput::button_anchor(_('Retour 
liste'),HtmlInput::request_to_string(array("sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","see_all","all_action")).'&my_action');
+$retour=HtmlInput::button_anchor(_('Retour 
liste'),HtmlInput::request_to_string(array("remind_date","sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","see_all","all_action")).'&my_action');
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/category_followup.inc.php
===================================================================
--- phpcompta/trunk/include/category_followup.inc.php   2012-06-14 21:45:35 UTC 
(rev 4903)
+++ phpcompta/trunk/include/category_followup.inc.php   2012-06-15 00:51:26 UTC 
(rev 4904)
@@ -37,7 +37,7 @@
 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
 $p_action=$_REQUEST['ac'];
-$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id']."&".HtmlInput::request_to_string(array("sag_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","see_all","all_action","sb","sc"),"");
+$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id']."&".HtmlInput::request_to_string(array("remind_date","sag_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","see_all","all_action","sb","sc"),"");
 $retour=HtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base);
 $fiche=new Fiche($cn,$_REQUEST['f_id']);
 

Modified: phpcompta/trunk/include/class_calendar.php
===================================================================
--- phpcompta/trunk/include/class_calendar.php  2012-06-14 21:45:35 UTC (rev 
4903)
+++ phpcompta/trunk/include/class_calendar.php  2012-06-15 00:51:26 UTC (rev 
4904)
@@ -54,13 +54,14 @@
              " to_char(ag_remind_date,'MM')::integer=$1 ".
              " and to_char(ag_remind_date,'YYYY')::integer=$2 ".
              "  and ag_dest in (select p_granted from user_sec_action_profile 
where p_id =$3)
+                                and ag_state IN (2, 3)
                                 group by 
to_char(ag_remind_date,'DD')::integer";
 
                
$array=$cn->get_array($sql,array($this->month,$this->year,$profile));
         for ($i=0;$i<count($array);$i++)
         {
             $ind=$array[$i]['ag_timestamp_day'];
-            $p_array[$ind].="<span 
class=\"notice\">".$array[$i]['nb'].'</span>';
+            $p_array[$ind].="<span class=\"notice\">".$array[$i]['nb']." 
"._("Tâches suivis").'</span>';
 
         }
     }
@@ -70,17 +71,17 @@
     function fill_from_todo(&$p_array)
     {
         $cn=new Database(dossier::id());
-        $sql="select tl_id,substr(tl_title,0,20) as 
tl_title_fmt,to_char(tl_date,'DD')::integer as tl_date_day ".
+        $sql="select count(*) as nb,to_char(tl_date,'DD')::integer as 
tl_date_day ".
              " from todo_list ".
              " where ".
              " to_char(tl_date,'MM')::integer=$1 ".
              " and to_char(tl_date,'YYYY')::integer=$2 ".
-             " and use_login=$3";
+             " and use_login=$3 group by to_char(tl_date,'DD')::integer ";
         
$array=$cn->get_array($sql,array($this->month,$this->year,$_SESSION['g_user']));
         for ($i=0;$i<count($array);$i++)
         {
             $ind=$array[$i]['tl_date_day'];
-            $p_array[$ind].="<span 
class=\"todo\">".h($array[$i]['tl_title_fmt']).'</span>';
+            $p_array[$ind].="<span style=\"display:block\" 
class=\"todo\">".h($array[$i]['nb'])." "._('Notes').'</span>';
         }
     }
     /*!\brief display a calendar after a call to Calendar::fill

Modified: phpcompta/trunk/include/class_follow_up.php
===================================================================
--- phpcompta/trunk/include/class_follow_up.php 2012-06-14 21:45:35 UTC (rev 
4903)
+++ phpcompta/trunk/include/class_follow_up.php 2012-06-15 00:51:26 UTC (rev 
4904)
@@ -498,7 +498,7 @@
                /* add the number of item */
                $Hid = new IHidden();
                $r.=$Hid->input("nb_item", MAX_ARTICLE);
-               
$r.=HtmlInput::request_to_hidden(array("sag_ref","only_internal","state","qcode",
 "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", 
"all_action"));
+               
$r.=HtmlInput::request_to_hidden(array("remind_date","sag_ref","only_internal","state","qcode",
 "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", 
"all_action"));
                /* get template */
                ob_start();
                require_once 'template/detail-action.php';
@@ -671,7 +671,7 @@
        function myList($p_base, $p_filter = "", $p_search = "")
        {
                // for the sort
-               $url = 
HtmlInput::get_to_string(array("sag_ref","only_internal","state","qcode", 
"ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", 
"all_action")) . '&' . $p_base;
+               $url = 
HtmlInput::get_to_string(array("remind_date","sag_ref","only_internal","state","qcode",
 "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", 
"all_action")) . '&' . $p_base;
 
                $table = new Sort_Table();
                $table->add('Date', $url, 'order by ag_timestamp asc', 'order 
by ag_timestamp desc', 'da', 'dd');
@@ -743,7 +743,7 @@
                //show the sub_action
                foreach ($a_row as $row)
                {
-                       $href = '<A class="document" HREF="do.php?'  . $p_base 
.HtmlInput::get_to_string(array("sag_ref","only_internal","state","gDossier", 
"qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", "see_all", 
"ac", "all_action"),"") . '&sa=detail&ag_id=' . $row['ag_id'] . '">';
+                       $href = '<A class="document" HREF="do.php?'  . $p_base 
.HtmlInput::get_to_string(array("remind_date","sag_ref","only_internal","state","gDossier",
 "qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", 
"see_all", "ac", "all_action"),"&") . '&sa=detail&ag_id=' . $row['ag_id'] . 
'">';
                        $i++;
                        $tr = ($i % 2 == 0) ? 'even' : 'odd';
                        if ($row['ag_priority'] < 2)
@@ -1154,6 +1154,8 @@
                $str_ag_dest = $ag_dest->input();
                $osag_ref=new IText("sag_ref");
                $osag_ref->value=(isset($_GET['sag_ref']))?$_GET['sag_ref']:"";
+               $remind_date=new IDate('remind_date');
+               
$remind_date->value=(isset($_GET['remind_date']))?$_GET['remind_date']:"";
                // show the  action in
                require_once 'template/action_search.php';
        }
@@ -1251,8 +1253,12 @@
                }
                if (isNumber($ag_id) == 1 && $ag_id != 0)
                {
-                       $query = " and ag_id= " . $ag_id;
+                       $query = " and ag_id= " . sql_string($ag_id);
                }
+               if ( isset($remind_date) && $remind_date != "" && 
isDate($remind_date)==$remind_date)
+               {
+                       $query = " and to_char(ag_remind_date,'DD.MM.YYYY')= 
'".sql_string($remind_date)."'";
+               }
                return $query . $str;
        }
 

Modified: phpcompta/trunk/include/class_icard.php
===================================================================
--- phpcompta/trunk/include/class_icard.php     2012-06-14 21:45:35 UTC (rev 
4903)
+++ phpcompta/trunk/include/class_icard.php     2012-06-15 00:51:26 UTC (rev 
4904)
@@ -239,8 +239,9 @@
     /*!\brief print in html the readonly value of the widget*/
     public function display()
     {
-        $r=sprintf('         <INPUT TYPE="hidden" NAME="%s" VALUE="%s" 
SIZE="8">',
+        $r=sprintf('         <INPUT TYPE="hidden" NAME="%s" id="%s" VALUE="%s" 
SIZE="8">',
                    $this->name,
+                   $this->name,
                    $this->value
                   );
         $r.='<span>'.$this->value.'</span>';

Modified: phpcompta/trunk/include/template/action_search.php
===================================================================
--- phpcompta/trunk/include/template/action_search.php  2012-06-14 21:45:35 UTC 
(rev 4903)
+++ phpcompta/trunk/include/template/action_search.php  2012-06-15 00:51:26 UTC 
(rev 4904)
@@ -46,7 +46,13 @@
                <?=HtmlInput::hidden('ctlc',$_GET['ctlc'])?>
 <? endif; ?>
                <?= dossier::hidden()?>
-               <table style="width:100%"><tr>
+               <table style="width:100%">
+                       <tr>
+                               <td style="width:180px;text-align:right"> Date 
de rappel</td>
+                               <td>
+                                       <?=$remind_date->input();?>
+                               </td>
+                       <tr>
                        <td style="width:180px;text-align:right"> Référence</td>
                                <td>
                                        <?=$osag_ref->input();?>

Modified: phpcompta/trunk/include/template/detail-action.php
===================================================================
--- phpcompta/trunk/include/template/detail-action.php  2012-06-14 21:45:35 UTC 
(rev 4903)
+++ phpcompta/trunk/include/template/detail-action.php  2012-06-15 00:51:26 UTC 
(rev 4904)
@@ -285,7 +285,7 @@
 <?php endfor; ?>
 </table>
 <script language="JavaScript">
-if ( $('e_march0').value =='') { toggleShowDetail();}
+if ( $('e_march0') && $('e_march0').value =='') { toggleShowDetail();}
 function toggleShowDetail() {
        try {var detail=g('fldDetail');
        var but=g('toggleButton');



---
PhpCompta est un logiciel de comptabilité libre en ligne (full web)
Projet opensource http://www.phpcompta.eu



reply via email to

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