phpcompta-dev
[Top][All Lists]
Advanced

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

[Phpcompta-dev] r4653 - in phpcompta/trunk: doc include include/template


From: phpcompta-dev
Subject: [Phpcompta-dev] r4653 - in phpcompta/trunk: doc include include/template
Date: Sat, 24 Dec 2011 03:35:19 +0100 (CET)

Author: danydb
Date: 2011-12-24 03:35:18 +0100 (Sat, 24 Dec 2011)
New Revision: 4653

Added:
   phpcompta/trunk/include/template/action-reference.php
Modified:
   phpcompta/trunk/doc/manuel-fr.odt
   phpcompta/trunk/include/action.common.inc.php
   phpcompta/trunk/include/action.inc.php
   phpcompta/trunk/include/class_follow_up.php
Log:

documentation
Add #495 possibilit?\195?\169 d'ajouter et enlever des actions 
d?\195?\169pendantes


Modified: phpcompta/trunk/doc/manuel-fr.odt
===================================================================
(Binary files differ)

Modified: phpcompta/trunk/include/action.common.inc.php
===================================================================
--- phpcompta/trunk/include/action.common.inc.php       2011-12-22 09:59:28 UTC 
(rev 4652)
+++ phpcompta/trunk/include/action.common.inc.php       2011-12-24 02:35:18 UTC 
(rev 4653)
@@ -38,6 +38,7 @@
   $supl_hidden.=HtmlInput::hidden('sb',$_REQUEST['sb']);
   $supl_hidden.=HtmlInput::hidden('ac',$_REQUEST['ac']);
 
+
 /*--------------------------------------------------------------------------- 
*/
 /* We ask to generate the document */
 /*--------------------------------------------------------------------------- 
*/
@@ -49,6 +50,7 @@
       {
         $act->save();
         $ag_id=$act->ag_id;
+
       }
     else
       {
@@ -82,19 +84,16 @@
       {
         $act2=new Follow_Up($cn);
         $act2->fromArray($_POST );
-
-        if ( $act2->Update() == false )
-         {
-            $sub_action="detail";
-         }
-        else
-         {
-            $url="?$base&sa=detail&ag_id=".$act2->ag_id.'&'.dossier::get();
-            echo '<p><a class="mtitle" href="'.$url.'">'.hb(_('Action 
sauvée').'  : '.$act2->ag_ref).'</a></p>';
-
-            ShowActionList($cn,$base);
-            echo '<p><a class="mtitle" href="'.$url.'">'.hb(_('Action 
sauvée').'  : '.$act2->ag_ref).'</a></p>';
-         }
+                $sub_action="detail";
+               if ( $_POST["new_ref"] != "0")
+               {
+                       $act2->add_depend($_POST['new_ref']);
+               }
+               if ( isset ($_POST['sup_dep']))
+               {
+                       $act2->suppress_depend($_POST['sup_dep']);
+               }
+         $act2->Update();
       }
     //----------------------------------------------------------------------
     // Add a related action
@@ -141,6 +140,7 @@
     echo '<div class="content">';
     $act=new Follow_Up($cn);
     $act->ag_id=$ag_id;
+       $act->suppress=1;
     echo $act->get();
     $act->ag_comment=Decode($act->ag_comment);
     echo '<form  enctype="multipart/form-data"  class="print" action="do.php"  
method="post"   >';
@@ -152,6 +152,7 @@
     echo HtmlInput::submit("save","Sauve");
     echo HtmlInput::submit("add_action_here",_("Ajoute une action à 
celle-ci"));
     echo HtmlInput::submit("delete",_("Efface cette action"),' onclick="return 
confirm(\''._("Vous confirmez l\'effacement").'\')" ');
+       echo $retour;
     echo '</form>';
     echo '</div>';
 

Modified: phpcompta/trunk/include/action.inc.php
===================================================================
--- phpcompta/trunk/include/action.inc.php      2011-12-22 09:59:28 UTC (rev 
4652)
+++ phpcompta/trunk/include/action.inc.php      2011-12-24 02:35:18 UTC (rev 
4653)
@@ -23,8 +23,7 @@
  */
 require_once('class_ipopup.php');
 global $g_user;
-
-$retour=HtmlInput::button_anchor(_('Retour'),'?ac='.$_REQUEST['ac'].'&my_action&'.dossier::get());
+$retour=HtmlInput::button_anchor(_('Retour 
liste'),'?ac='.$_REQUEST['ac'].'&my_action&'.dossier::get());
 //-----------------------------------------------------
 // Follow_Up
 //-----------------------------------------------------

Modified: phpcompta/trunk/include/class_follow_up.php
===================================================================
--- phpcompta/trunk/include/class_follow_up.php 2011-12-22 09:59:28 UTC (rev 
4652)
+++ phpcompta/trunk/include/class_follow_up.php 2011-12-24 02:35:18 UTC (rev 
4653)
@@ -303,7 +303,7 @@
             if( isset($_REQUEST['sb']))
                 $supl_hidden.='&sb='.$_REQUEST['sb'];
 
-            $lag_ref_ag_id='<a class="mtitle" 
href="?ac='.$_REQUEST['ac'].$supl_hidden.'&sa=detail&ag_id='.
+            $lag_ref_ag_id='<a class="line" 
href="?ac='.$_REQUEST['ac'].$supl_hidden.'&sa=detail&ag_id='.
                            $this->ag_ref_ag_id.'&'.dossier::get().'">'.
                                $this->db->get_value("select ag_ref from 
action_gestion where ag_id=$1",array($this->ag_ref_ag_id)).
                                "</A>";
@@ -523,6 +523,13 @@
             $sql=sprintf(" and ag_id in (select action_get_tree from 
comptaproc.action_get_tree(%s)) ",$this->ag_id);
             $r.=$this->myList($p_base,"",$sql);
         }
+               // New referecne
+               ob_start();
+        require_once ('template/action-reference.php');
+        $content=ob_get_contents();
+        ob_end_clean();
+
+               $r.=$content;
         return $r;
 
     }
@@ -664,10 +671,10 @@
 
                $table=new Sort_Table();
                $table->add('Date',$url,'order by ag_timestamp asc','order by 
ag_timestamp desc','da','dd');
+               $table->add('Réf.',$url,'order by ag_ref asc','order by ag_ref 
desc','ra','rd');
                $table->add('Expéditeur',$url,'order by name asc','order by 
name desc','ea','ed');
                $table->add('Titre',$url,'order by ag_title asc','order by 
ag_title desc','ta','td');
                $table->add('Concerne',$url,'order by ag_ref_ag_id asc','order 
by ag_ref_ag_id desc','ca','cd');
-               $table->add('Réf.',$url,'order by ag_ref asc','order by ag_ref 
desc','ra','rd');
 
                $ord=(! isset($_GET['ord']))?"dd":$_GET['ord'];
                $sort=$table->get_sql_order($ord);
@@ -702,11 +709,14 @@
         $r.='<th>'.$table->get_header(0).'</th>';
         $r.='<th>'.$table->get_header(1).'</th>';
         $r.='<th>'.$table->get_header(2).'</th>';
+        $r.='<th>'.$table->get_header(3).'</th>';
         $r.='<th>type</th>';
                $r.=th('Etat');
                $r.=th('Priorité');
         $r.='<th>'.$table->get_header(4).'</th>';
-        $r.='<th>'.$table->get_header(3).'</th>';
+               if (isset($this->suppress)) {
+                       $r.="<th> Suppr. dépendance</th>";
+               }
         $r.="</tr>";
 
 
@@ -732,6 +742,7 @@
             if ($row['my_date']==$today) $st=' style="font-family:bold; 
border:2px solid orange;"';
             $r.="<tr class=\"$tr\" $st>";
             $r.="<td>".$href.$row['my_date'].'</a>'."</td>";
+                       $r.="<td>".$href.$row['ag_ref'].'</a>'."</td>";
 
             // Expediteur
             $fexp=new Fiche($this->db);
@@ -805,11 +816,17 @@
              }
            $r.=td($priority);
 
-            $r.="<td>".$row['ag_ref']."</td>";
-            $r.="<td>".$ref."</td>";
+            $r.="<td>" . $ref . "</td>";
+                       if (isset($this->suppress))
+                       {
+                               $ck = new ICheckBox('sup_dep[]');
+                               $ck->value = $row['ag_id'];
+                               $r.="<td>" . $ck->input() . "</td>";
+                       }
             $r.="</tr>";
 
         }
+
         $r.="</table>";
 
         $r.=$bar;
@@ -971,4 +988,26 @@
         $array=$this->db->get_array($sql);
         return $array;
     }
+       /**
+        address@hidden add an related action to the  current one
+        */
+       function add_depend($p_ref)
+       {
+               if ($p_ref == 0 || $p_ref==$this->ag_id) return;
+               // check if action exist and is not already related to the 
current action
+               $exist=$this->db->get_value("select count(*) from 
action_gestion where ag_id=$1",array($p_ref));
+               if ( $exist == 0) return;
+
+               $this->db->exec_sql("update action_gestion set ag_ref_ag_id=$1 
where ag_id=$2",
+                               array($this->ag_id,$p_ref));
+
+       }
+       function suppress_depend($p_array)
+       {
+               for ($i=0;$i<count($p_array);$i++)
+               {
+                       $this->db->exec_sql("update action_gestion set 
ag_ref_ag_id=0 where ag_id=$1",
+                               array($p_array[$i]));
+               }
+       }
 }

Added: phpcompta/trunk/include/template/action-reference.php
===================================================================
--- phpcompta/trunk/include/template/action-reference.php                       
        (rev 0)
+++ phpcompta/trunk/include/template/action-reference.php       2011-12-24 
02:35:18 UTC (rev 4653)
@@ -0,0 +1,35 @@
+<?php
+
+/*
+ *   This file is part of PhpCompta.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+/* $Revision$ */
+
+// Copyright Author Dany De Bontridder address@hidden
+
+/**
+ * @file
+ * @brief add a follow up
+ *
+ */
+$new_action=new INum('new_ref',0);
+?>
+<p>
+       Ajout d'une action qui dépend de l'action actuelle : 
<?=$new_action->input()?>
+       <span class="notice"> Ne donner que le numéro de document
+       </span>
+</p>
\ No newline at end of file




reply via email to

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