From dbea6cee68fdbe438031ee5ebf0992e64fc0ace6 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Sun, 4 Oct 2020 15:02:34 +0200 Subject: [PATCH] Follow-up : tag enable when create doc --- include/action.common.inc.php | 6 ++-- include/action.inc.php | 2 +- include/class/follow_up.class.php | 7 +++-- include/template/action_button.php | 30 +++++++++++++++---- include/template/follow_up_detail_display.php | 5 ++-- 5 files changed, 36 insertions(+), 14 deletions(-) diff --git a/include/action.common.inc.php b/include/action.common.inc.php index 976fcbef3..33904ec76 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -284,12 +284,13 @@ if ($sub_action == "save_action_st2") $act->fromArray($_POST); try { $act->d_id = 0; + $act->ag_id=$http->request("ag_id","number"); $act->md_id = (isset($_POST['gen_doc'])) ? $_POST['gen_doc'] : 0; $act->verify(); // insert into action_gestion - echo $act->save(); + echo $act->update(); $url = "?$base&sa=detail&ag_id=" . $act->ag_id . '&' . dossier::get(); echo '

' . hb(_('Evènement Sauvée').' : ' . $act->ag_ref) . '

'; @@ -312,8 +313,9 @@ if ($sub_action == "add_action") { $act = new Follow_Up($cn); $act->fromArray($_POST); - $act->ag_id = 0; + $act->dt_id = $http->request("action_type","number"); $act->d_id = 0; + $act->save(); echo '
'; // Add hidden tag echo '
'; diff --git a/include/action.inc.php b/include/action.inc.php index 9f61297b2..70406bb75 100644 --- a/include/action.inc.php +++ b/include/action.inc.php @@ -57,7 +57,7 @@ $ag_id=$http->request("ag_id","string","0"); $ac=$http->request("ac"); $base=HtmlInput::request_to_string(array('ac','gDossier'),""); - +echo '
'; require_once NOALYSS_INCLUDE.'/action.common.inc.php'; echo "
"; diff --git a/include/class/follow_up.class.php b/include/class/follow_up.class.php index 3aa0b6dde..e38f4a74e 100644 --- a/include/class/follow_up.class.php +++ b/include/class/follow_up.class.php @@ -165,7 +165,6 @@ class Follow_Up { $upd=false; $readonly=false; - $this->ag_ref=_("Nouveau"); } elseif ($p_view=='READ') { @@ -390,7 +389,7 @@ class Follow_Up $h_agrefid=new IHidden(); $iag_ref=new IText("ag_ref"); $iag_ref->value=$this->ag_ref; - $iag_ref->readOnly=($p_view=="NEW"||$p_view=='READ')?true:false; + $iag_ref->readOnly=false; $str_ag_ref=$iag_ref->input(); // Preparing the return string $r=""; @@ -871,7 +870,9 @@ class Follow_Up $doc->Upload($this->ag_id); /* save action details */ - for ($i=0; $i<$_POST['nb_item']; $i++) + $http=new HttpInput(); + $nb_item=$http->post("nb_item","number",0); + for ($i=0; $i< $nb_item ; $i++) { $act=new Follow_Up_Detail($this->db); $act->from_array($_POST, $i); diff --git a/include/template/action_button.php b/include/template/action_button.php index 0d7287910..04a621d3c 100644 --- a/include/template/action_button.php +++ b/include/template/action_button.php @@ -26,19 +26,39 @@ * @brief show button in the list of actions * */ +$http=new HttpInput(); ?>
+ + + \ No newline at end of file +
+
+
\ No newline at end of file diff --git a/include/template/follow_up_detail_display.php b/include/template/follow_up_detail_display.php index 27322909f..0ce27e905 100644 --- a/include/template/follow_up_detail_display.php +++ b/include/template/follow_up_detail_display.php @@ -31,8 +31,7 @@ $tot_vat=0; $text=new IText(); $num=new INum(); $itva=new ITva_Popup(); -$readonly=$p_view; - +$readonly=($p_view == "READ")?true:false; // default menu for invoice $menu=new Default_Menu(); ?> @@ -59,7 +58,7 @@ $menu=new Default_Menu(); $icard->noadd="no"; $icard->extra='all'; $icard->name="e_march".$i; - $tmp_ad=(isset($p_follow_up->aAction_detail[$i]))?$p_follow_up->aAction_detail[$i]:$readonly; + $tmp_ad=(isset($p_follow_up->aAction_detail[$i]))?$p_follow_up->aAction_detail[$i]:false; $icard->readOnly=$readonly; $icard->value=''; $aCard[$i]=0;