noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 98/119: Follow up add followup action


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 98/119: Follow up add followup action
Date: Mon, 26 Oct 2020 18:27:35 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 37cfa14491e1d2da75d009d9eec00068bf92bed0
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Tue Oct 13 13:14:49 2020 +0200

    Follow up add followup action
---
 include/class/follow_up.class.php  |  8 +++----
 include/template/action_button.php | 47 +++++++++++++++-----------------------
 2 files changed, 22 insertions(+), 33 deletions(-)

diff --git a/include/class/follow_up.class.php 
b/include/class/follow_up.class.php
index 3964b55..c7f9102 100644
--- a/include/class/follow_up.class.php
+++ b/include/class/follow_up.class.php
@@ -517,8 +517,7 @@ class Follow_Up
     function save()
     {
 
-        // Get The sequence id,
-        $seq_name="seq_doc_type_".$this->dt_id;
+       
         $str_file="";
         $add_file='';
 
@@ -538,6 +537,8 @@ class Follow_Up
             $this->ag_title=$doc_mod->dt_value;
         }
         $this->ag_id=$this->db->get_next_seq('action_gestion_ag_id_seq');
+         // Get The sequence id,
+        $seq_name="seq_doc_type_".$this->dt_id;
 
         // Create the reference
         $ag_ref=$this->db->get_value('select dt_prefix from document_type 
where dt_id=$1', array($this->dt_id)).'-'.$this->db->get_next_seq($seq_name);
@@ -564,7 +565,7 @@ class Follow_Up
             $this->dt_id, /* 3 */
             $this->ag_title, /* 4 */
             $exp->id, /* 5 */
-            $ag_ref, /* 6 */
+            $this->ag_ref, /* 6 */
             $this->ag_dest, /* 7 */
             $this->ag_hour, /* 8 */
             $this->ag_priority, /* 9 */
@@ -797,7 +798,6 @@ class Follow_Up
         $old=new Follow_Up($this->db);
         $old->ag_id=$this->ag_id;
         $old->get();
-
         // If ag_ref changed then check if unique
         if ($old->ag_ref!=$this->ag_ref)
         {
diff --git a/include/template/action_button.php 
b/include/template/action_button.php
index 04a621d..1aa348b 100644
--- a/include/template/action_button.php
+++ b/include/template/action_button.php
@@ -26,39 +26,28 @@
  * @brief show button in the list of actions
  *
  */
+require_once NOALYSS_INCLUDE."/lib/select_box.class.php";
 $http=new HttpInput();
+// Create select box for new Action
+$selbox=new Select_Box(uniqid(), _("Ajout action"));
+$selbox->set_position("normal");
+$selbox->set_filter("yes");
+$aDocumentType=$cn->get_array("select dt_id,dt_value from document_type order 
by 2");
+$nbDocumentType=count($aDocumentType);
+$ac=$http->request("ac");
+$dossier_id=Dossier::id();
+$sup_parameter=HtmlInput::array_to_string(["sc","sb","f_id","qcode"], 
$_REQUEST,"&amp;");
+for ($i=0;$i<$nbDocumentType;$i++) {
+    $selbox->add_url($aDocumentType[$i]['dt_value'], 
+            "do.php?".http_build_query([ 
"ac"=>$ac,"gDossier"=>$dossier_id,"sa"=>"add_action"
+                    
,"action_type"=>$aDocumentType[$i]["dt_id"]]).$sup_parameter);
+    
+}
 ?>
 <div class="content" style="display:inline" >
        <div style="display:inline">
             <input id="bt_search" type="button" class="smallbutton" 
onclick="$('search_action').style.display='block'" value="<?php echo 
_('Recherche') ?>">
-            <input id="bt_add" type="button" class="smallbutton" 
onclick="$('b_add_action').style.display='block';document.getElementById('action_type').focus()"
 value="<?php echo _('Ajout') ?>">
-            <div id="b_add_action" style="display:none" class="inner_box">
-                <?php echo HtmlInput::title_box(_("Ajout d'une action"), 
"b_add_action","hide");?>
-               <form  method="get" style="display:inline" action="do.php">
-                       <?php echo dossier::hidden();
-                        $a_typeAction=new ISelect("action_type");
-                        $a_typeAction->rowsize=10;
-                        $a_typeAction->value=$cn->make_array("select 
dt_id,dt_value from document_type order by 2");
-                        echo _("Type action ");
-                        echo $a_typeAction->input();
-                       ?>
-                        
-                       <input type="hidden" name="ac" value="<?php echo  
$http->request('ac')?>">
-                       <input type="hidden" name="sa" value="add_action">
-                       <?php echo  $supl_hidden?>
-                    <ul class="aligned-block">
-                        <li>
-                            
-                       <input type="submit" class="smallbutton" 
name="submit_query" value="<?php echo  _("Ajout Action")?>">
-                        </li>
-                        <li>
-                            <?php echo 
HtmlInput::button_hide("b_add_action");?>
-                        </li>
-                    </ul>
-
-                        
-
-               </form>
-            </div>
+            <?=$selbox->input();?>
+         
        </div>
 </div>    
\ No newline at end of file



reply via email to

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