From 37cfa14491e1d2da75d009d9eec00068bf92bed0 Mon Sep 17 00:00:00 2001 From: sparkyx Date: Tue, 13 Oct 2020 13:14:49 +0200 Subject: [PATCH] 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 3964b556f..c7f91027b 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 04a621d3c..1aa348b3c 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,"&"); +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); + +} ?>
- - + input();?> +
\ No newline at end of file