phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r5188 - in phpcompta/tags/rel650: include include/templa


From: phpcompta-dev
Subject: [Phpcompta-dev] r5188 - in phpcompta/tags/rel650: include include/template sql
Date: Sun, 17 Mar 2013 01:24:06 +0100 (CET)

Author: danydb
Date: 2013-03-17 01:24:05 +0100 (Sun, 17 Mar 2013)
New Revision: 5188

Modified:
   phpcompta/tags/rel650/include/action.common.inc.php
   phpcompta/tags/rel650/include/action.inc.php
   phpcompta/tags/rel650/include/category_followup.inc.php
   phpcompta/tags/rel650/include/class_follow_up.php
   phpcompta/tags/rel650/include/doc_state.inc.php
   phpcompta/tags/rel650/include/template/action_search.php
   phpcompta/tags/rel650/include/template/history_top.php
   phpcompta/tags/rel650/include/template/ledger_detail_top.php
   phpcompta/tags/rel650/sql/upgrade.sql
Log:
0000797: Am?\195?\169lioration du workflow : statut des documents / actions



Modified: phpcompta/tags/rel650/include/action.common.inc.php
===================================================================
--- phpcompta/tags/rel650/include/action.common.inc.php 2013-03-13 23:04:53 UTC 
(rev 5187)
+++ phpcompta/tags/rel650/include/action.common.inc.php 2013-03-17 00:24:05 UTC 
(rev 5188)
@@ -191,7 +191,7 @@
        Follow_Up::show_action_list($cn, $base);
        // Add a button to export to Csv
        echo '<form method="GET" ACTION="export.php">';
-       echo 
HtmlInput::request_to_hidden(array("remind_date_end","remind_date","sag_ref", 
"remind_date","only_internal", "state", "gDossier", "qcode", "start_date", 
"end_date", "ag_id", "ag_dest_query",
+       echo 
HtmlInput::request_to_hidden(array("closed_action","remind_date_end","remind_date","sag_ref",
 "remind_date","only_internal", "state", "gDossier", "qcode", "start_date", 
"end_date", "ag_id", "ag_dest_query",
                "tdoc",   "query"));
        echo HtmlInput::hidden("act", "CSV:ActionGestion");
        echo HtmlInput::submit("follow_up_csv", "Export CSV");

Modified: phpcompta/tags/rel650/include/action.inc.php
===================================================================
--- phpcompta/tags/rel650/include/action.inc.php        2013-03-13 23:04:53 UTC 
(rev 5187)
+++ phpcompta/tags/rel650/include/action.inc.php        2013-03-17 00:24:05 UTC 
(rev 5188)
@@ -24,7 +24,7 @@
 require_once('class_ipopup.php');
 global $g_user;
 $retour=HtmlInput::button_anchor(_('Retour liste'),
-               
HtmlInput::request_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","hsstate")));
+               
HtmlInput::request_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","ac","gDossier","qcode","ag_dest_query","query","tdoc","date_start","date_end","hsstate")));
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/tags/rel650/include/category_followup.inc.php
===================================================================
--- phpcompta/tags/rel650/include/category_followup.inc.php     2013-03-13 
23:04:53 UTC (rev 5187)
+++ phpcompta/tags/rel650/include/category_followup.inc.php     2013-03-17 
00:24:05 UTC (rev 5188)
@@ -36,8 +36,10 @@
  */
 $sub_action=(isset($_REQUEST['sa']))?$_REQUEST['sa']:"list";
 $ag_id=(isset($_REQUEST['ag_id']))?$_REQUEST['ag_id']:0;
+if (! isset($_GET['submit_query'])) 
{$_REQUEST['closed_action']=1;$_GET['closed_action']=1;}
+
 $p_action=$_REQUEST['ac'];
-$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id']."&".HtmlInput::request_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","hsstate","sb","sc"),"");
+$base="ac=$p_action&sc=sv&sb=detail&f_id=".$_REQUEST['f_id']."&".HtmlInput::request_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","gDossier","qcode","ag_dest","query","tdoc","date_start","date_end","hsstate","sb","sc"),"");
 $retour=HtmlInput::button_anchor('Retour','?'.dossier::get().'&'.$base);
 $fiche=new Fiche($cn,$_REQUEST['f_id']);
 

Modified: phpcompta/tags/rel650/include/class_follow_up.php
===================================================================
--- phpcompta/tags/rel650/include/class_follow_up.php   2013-03-13 23:04:53 UTC 
(rev 5187)
+++ phpcompta/tags/rel650/include/class_follow_up.php   2013-03-17 00:24:05 UTC 
(rev 5188)
@@ -504,7 +504,7 @@
                /* add the number of item */
                $Hid = new IHidden();
                $r.=$Hid->input("nb_item", MAX_ARTICLE);
-               
$r.=HtmlInput::request_to_hidden(array("remind_date_end","remind_date","sag_ref","only_internal","state","qcode",
 "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate"));
+               
$r.=HtmlInput::request_to_hidden(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","qcode",
 "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate"));
                /* get template */
                ob_start();
                require_once 'template/detail-action.php';
@@ -673,7 +673,7 @@
        function myList($p_base, $p_filter = "", $p_search = "")
        {
                // for the sort
-               $url = 
HtmlInput::get_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","qcode",
 "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate")) . '&' 
. $p_base;
+               $url = 
HtmlInput::get_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","qcode",
 "ag_dest_query", "query", "tdoc", "date_start", "date_end", "hsstate")) . '&' 
. $p_base;
 
                $table = new Sort_Table();
                $table->add('Date', $url, 'order by ag_timestamp asc', 'order 
by ag_timestamp desc', 'da', 'dd');
@@ -747,7 +747,7 @@
                //show the sub_action
                foreach ($a_row as $row)
                {
-                       $href = '<A class="document" HREF="do.php?'  . $p_base 
.HtmlInput::get_to_string(array("remind_date_end","remind_date","sag_ref","only_internal","state","gDossier",
 "qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", 
"hsstate", "ac"),"&") . '&sa=detail&ag_id=' . $row['ag_id'] . '">';
+                       $href = '<A class="document" HREF="do.php?'  . $p_base 
.HtmlInput::get_to_string(array("closed_action","remind_date_end","remind_date","sag_ref","only_internal","state","gDossier",
 "qcode", "ag_dest_query", "query", "tdoc", "date_start", "date_end", 
"hsstate", "ac"),"&") . '&sa=detail&ag_id=' . $row['ag_id'] . '">';
                        $i++;
                        $tr = ($i % 2 == 0) ? 'even' : 'odd';
                        if ($row['ag_priority'] < 2)
@@ -1163,6 +1163,11 @@
                $end = new IDate('date_end');
                $end->value = (isset($_GET['date_end'])) ? $_GET['date_end'] : 
"";
 
+               // Closed action
+               $closed_action=new ICheckBox('closed_action');
+               
$closed_action->selected=(isset($_GET['closed_action']))?true:false;
+
+               // Internal
                $only_internal= new ICheckBox('only_internal');
                $only_internal->selected = (isset($_GET['only_internal'])) ? 
true : false;
                // select profile
@@ -1221,7 +1226,7 @@
                $query = "";
 
 
-                if (isset($_REQUEST['query']))
+        if (isset($_REQUEST['query']))
                {
                        // if a query is request build the sql stmt
                        $query = "and (ag_title ~* '" . 
sql_string($_REQUEST['query']) . "' " .
@@ -1296,6 +1301,9 @@
                {
                        $query .= " and 
to_date('".sql_string($remind_date_end)."','DD.MM.YYYY')>= ag_remind_date";
                }
+               if ( ! isset ($closed_action)) {
+                       $query.=" and s_status is null ";
+               }
                return $query . $str;
        }
 
@@ -1364,6 +1372,7 @@
                        coalesce((select p_name from profile where 
p_id=ag_dest),'Aucun groupe') as dest
              from action_gestion
              join document_type on (ag_type=dt_id)
+                        join document_state on(ag_state=s_id)
              where  true  $p_search order by ag_timestamp,ag_id";
                $ret=$this->db->exec_sql($sql);
 

Modified: phpcompta/tags/rel650/include/doc_state.inc.php
===================================================================
--- phpcompta/tags/rel650/include/doc_state.inc.php     2013-03-13 23:04:53 UTC 
(rev 5187)
+++ phpcompta/tags/rel650/include/doc_state.inc.php     2013-03-17 00:24:05 UTC 
(rev 5188)
@@ -32,10 +32,17 @@
 {
        if (trim ($_POST['s_value'])!="")
        {
-               $cn->exec_sql('insert into document_state(s_value) values 
($1)',array($_POST['s_value']));
+               if ( isset($_POST['s_state']))
+               {
+                       $cn->exec_sql('insert into 
document_state(s_value,s_status) values ($1,$2)',array($_POST['s_value'],'C'));
+               }
+               else
+               {
+                       $cn->exec_sql('insert into document_state(s_value) 
values ($1)',array($_POST['s_value']));
+               }
        }
 }
-$a_stat=$cn->get_array("select s_value   from document_state order by 1");
+$a_stat=$cn->get_array("select s_value,s_status from document_state order by 
1");
 ?>
 
 <table>
@@ -45,10 +52,20 @@
                <td>
                        <?=h($a_stat[$i]['s_value'])?>
                </td>
+
+               <td>
+                       <? if ($a_stat[$i]['s_status']=='C') { echo _("Ferme 
l'action"); } ?>
+               </td>
        </tr>
        <?      endfor;?>
 </table>
+<h2>Ajout d'un état</h2>
 <form method="post" onsubmit="return confirm ('Vous confirmez ?'); ">
-       <? $value=new IText("s_value",""); echo $value->input()?>
-       <?=HtmlInput::submit("add", "Ajouter")?>
+       <p>
+               Nom de l'état <? $value=new IText("s_value",""); echo 
$value->input()?>
+       </p>
+       <p>
+               Cochez la case si cet état ferme une action <? $state=new 
ICheckBox("s_state",""); echo $state->input()?>
+               <?=HtmlInput::submit("add", "Ajouter")?>
+       </p>
 </form>
\ No newline at end of file

Modified: phpcompta/tags/rel650/include/template/action_search.php
===================================================================
--- phpcompta/tags/rel650/include/template/action_search.php    2013-03-13 
23:04:53 UTC (rev 5187)
+++ phpcompta/tags/rel650/include/template/action_search.php    2013-03-17 
00:24:05 UTC (rev 5188)
@@ -59,6 +59,10 @@
                                        <?=$remind_date_end->input();?>
                                </td>
                        <tr>
+                       <tr>
+                               <td style="width:180px;text-align:right"> 
Affiche aussi les actions fermées</td>
+                               <td><?=$closed_action->input();?></td>
+                       </tr>
                        <td style="width:180px;text-align:right"> Référence</td>
                                <td>
                                        <?=$osag_ref->input();?>

Modified: phpcompta/tags/rel650/include/template/history_top.php
===================================================================
--- phpcompta/tags/rel650/include/template/history_top.php      2013-03-13 
23:04:53 UTC (rev 5187)
+++ phpcompta/tags/rel650/include/template/history_top.php      2013-03-17 
00:24:05 UTC (rev 5188)
@@ -4,7 +4,7 @@
    {
      $callback=$_SERVER['PHP_SELF'];
      $str=$_SERVER['QUERY_STRING']."&act=de&ajax=$callback";
-     echo '<A id="close_div" HREF="javascript:void(0)" onclick="var 
a=window.open(\'popup.php?'.$str.'\',\'\',\'fullscreen=yes,location=no,toolbar=no,scrollbars=auto,resizable=yes,status=no,location=no\');
 a.focus();removeDiv(\''.$div.'\')">
+     echo '<A id="close_div" HREF="javascript:void(0)" onclick="var 
a=window.open(\'popup.php?'.$str.'\',\'\',\'fullscreen=yes,location=no,toolbar=no,scrollbars=yes,resizable=yes,status=no,location=no\');
 a.focus();removeDiv(\''.$div.'\')">
 !pop me out ! </A>';
 echo '<A id="close_div" HREF="javascript:void(0)" 
onclick="removeDiv(\''.$div.'\');">Fermer</A>';
 }

Modified: phpcompta/tags/rel650/include/template/ledger_detail_top.php
===================================================================
--- phpcompta/tags/rel650/include/template/ledger_detail_top.php        
2013-03-13 23:04:53 UTC (rev 5187)
+++ phpcompta/tags/rel650/include/template/ledger_detail_top.php        
2013-03-17 00:24:05 UTC (rev 5188)
@@ -3,7 +3,7 @@
    if ($div != "popup") {
      $callback=$_SERVER['PHP_SELF'];
      $str=$_SERVER['QUERY_STRING']."&act=$action&ajax=$callback";
-     echo '<A id="close_div" HREF="javascript:void(0)" onclick="var 
a=window.open(\'popup.php?'.$str.'\',\'\',\'location=no,toolbar=no,fullscreen=yes,scrollbars=auto,resizable=yes,status=no\');
 a.focus();removeDiv(\''.$div.'\')">
+     echo '<A id="close_div" HREF="javascript:void(0)" onclick="var 
a=window.open(\'popup.php?'.$str.'\',\'\',\'location=no,toolbar=no,fullscreen=yes,scrollbars=yes,resizable=yes,status=no\');
 a.focus();removeDiv(\''.$div.'\')">
 !pop me out ! </A>';
      echo '<A id="close_div" HREF="javascript:void(0)" 
onclick="removeDiv(\''.$div.'\');">Fermer</A>';
    }

Modified: phpcompta/tags/rel650/sql/upgrade.sql
===================================================================
--- phpcompta/tags/rel650/sql/upgrade.sql       2013-03-13 23:04:53 UTC (rev 
5187)
+++ phpcompta/tags/rel650/sql/upgrade.sql       2013-03-17 00:24:05 UTC (rev 
5188)
@@ -97,3 +97,8 @@
        end;
 $BODY$
   LANGUAGE plpgsql;
+
+
+alter table document_state add s_status char(1);
+
+update document_state set s_status='C' where s_id in (1,4)
\ No newline at end of file



---
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]