diff --git a/html/style-classic.css b/html/style-classic.css index e163c16e4..95be1394b 100644 --- a/html/style-classic.css +++ b/html/style-classic.css @@ -2448,3 +2448,7 @@ span.tagcell { color:black; } +#action_add_action2_list { + height:15rem; + overflow: auto; +} \ No newline at end of file diff --git a/html/style-classic7.css b/html/style-classic7.css index abbbcc316..09d256ea9 100644 --- a/html/style-classic7.css +++ b/html/style-classic7.css @@ -2481,4 +2481,9 @@ span.tagcell { border:1px solid darkblue; padding:3px;margin:1px; display: inline-block; -} \ No newline at end of file +} + +#action_add_action2_list { + height:15rem; + overflow: auto; +} \ No newline at end of file diff --git a/html/style-light.css b/html/style-light.css index 8384b90c1..096ffc179 100644 --- a/html/style-light.css +++ b/html/style-light.css @@ -2381,3 +2381,7 @@ span.tagcell { display: inline-block; color:black; } +#action_add_action2_list { + height:15rem; + overflow: auto; +} \ No newline at end of file diff --git a/include/action.common.inc.php b/include/action.common.inc.php index 257915c3e..48b16e7be 100644 --- a/include/action.common.inc.php +++ b/include/action.common.inc.php @@ -30,6 +30,7 @@ * */ if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis'); +require_once NOALYSS_INCLUDE."/lib/select_box.class.php"; $http=new HttpInput(); $supl_hidden = ''; if (isset($_REQUEST['sc'])) @@ -157,9 +158,9 @@ if ($sub_action == "update") //---------------------------------------------------------------------- // Add a related action //---------------------------------------------------------------------- - if (isset($_POST['add_action_here'])) + if (isset($_GET['add_action_here'])) { - $ag_id=$http->post('ag_id',"number"); + $ag_id=$http->get('ag_id',"number"); $act = new Follow_Up($cn,$ag_id); if ($g_user->can_write_action($act->ag_id) == FALSE ) { @@ -168,24 +169,37 @@ if ($sub_action == "update") echo ''; return; } - - //---------------------------------------- + //---------------------------------------- // puis comme ajout normal (copier / coller ) $act->ag_id = 0; $act->d_id = 0; - $act->action = $http->post('ag_id',"number"); + $act->action = $ag_id; $act->ag_timestamp=date('d.m.Y'); + $act->ag_dest=$g_user->get_profile(); $act->ag_hour=""; $act->ag_title=""; $act->ag_remind_date=""; + $act->dt_id = $http->request("action_type","number"); + $act->d_id = 0; + $act->ag_comment = ""; + $act->qcode_dest=""; + if (isset($_REQUEST['qcode'])){ + $act->qcode_dest = $http->request ('qcode'); + } else { + // Retrieve recipient of previous followup-action + $act->qcode_dest=$cn->get_value("select ad_value from action_gestion ag join fiche_detail fd + on (fd.f_id=ag.f_id_dest) where ag_id=$1 and ad_id=$2", + [$ag_id,ATTR_DEF_QUICKCODE ]); + } + $act->f_id_dest=$act->qcode_dest; + $act->save(); echo '
' . hb(_('Evènement Sauvée').' : ' . $act->ag_ref) . '
'; + $act->update(); + + $url = "?sa=detail&ag_id=" . $act->ag_id . '&' . dossier::get()."&ac=".$http->request("ac"). + $sup_parameter; + echo '' . hb(_('Action Sauvée').' : ' . $act->ag_ref) . '
'; Follow_Up::show_action_list($cn,$base); - $url = "?$base&sa=detail&ag_id=" . $act->ag_id . '&' . dossier::get(); - echo '' . hb(_('Evènement Sauvée').' : ' . $act->ag_ref) . '
'; + $url = "?sa=detail&ag_id=" . $act->ag_id . '&' . dossier::get()."&ac=".$http->request("ac"). + $sup_parameter; + echo '' . hb(_('Action Sauvée').' : ' . $act->ag_ref) . '
'; } catch (Exception $e) { echo ''; @@ -318,7 +356,13 @@ if ($sub_action == "add_action") $act->fromArray($_POST); $act->dt_id = $http->request("action_type","number"); $act->d_id = 0; + $f_id_dest=$http->request("f_id","number",null); + if ( $f_id_dest != NULL ) { + $act->qcode_dest=$cn->get_value("select ad_value from fiche_detail where ad_id=$1 and f_id=$2", + [ATTR_DEF_QUICKCODE,$f_id_dest]); + } $act->save(); + echo '