noalyss Version-9
ajax_save_card_option.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * PhpCompta is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * PhpCompta is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
21
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
24/**
25 * @file
26 * @brief save option of card into action_person_option
27 */
28
29try {
30 $ap_value=$http->post("ap_value","array",[]);
31 $ap_id=$http->post("ap_id","array",[]);
32 $cor_id=$http->post("cor_id","array",[]);
33 $fiche_id=$http->post("f_id");
34 $ag_id=$http->post("ag_id");
35 $action_person_id=$http->post("action_person_id");
36} catch (Exception $ex) {
37 record_log("ASCO01".$ex->getMessage().$ex->getTraceAsString());
38 return;
39}
40
41/// If cannot write we stop it
42if ( ! $g_user->can_write_action($ag_id)) {
43 record_log("ASCO02 Security ");
44}
45
46$nb=count($ap_value);
47// nothing to save
48if ($nb == 0) return;
49
50for ($i=0;$i<$nb; $i++) {
51
52 $cn->exec_sql("UPDATE public.action_person_option SET ap_value=$1 WHERE ap_id=$2",
53 [$ap_value[$i],$ap_id[$i]]);
54}
56$aColumn = $follow->get_option();
57echo $follow->display_row($fiche_id, 0, $aColumn);
record_log($p_message)
Record an error message into the log file of the server.
Definition: ac_common.php:1342
global $g_user
if no group available , then stop
catch(Exception $ex) if(! $g_user->can_write_action($ag_id)) $nb
If cannot write we stop it.
for($i=0;$i< $nb; $i++) $follow
$ex
Definition: balance.inc.php:45
Others concerned card in an action.