noalyss-commit
[Top][All Lists]
Advanced

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

[Noalyss-commit] [noalyss] 58/119: Missing file


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 58/119: Missing file
Date: Mon, 26 Oct 2020 18:27:20 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit 0b5ea0c2cef93b277df421d444b4750fbe1bac42
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Wed Oct 7 11:45:34 2020 +0200

    Missing file
---
 include/ajax/ajax_save_card_option.php | 60 ++++++++++++++++++++++++++++++++++
 1 file changed, 60 insertions(+)

diff --git a/include/ajax/ajax_save_card_option.php 
b/include/ajax/ajax_save_card_option.php
new file mode 100644
index 0000000..6a6b36c
--- /dev/null
+++ b/include/ajax/ajax_save_card_option.php
@@ -0,0 +1,60 @@
+<?php
+
+/*
+ *   This file is part of NOALYSS.
+ *
+ *   PhpCompta is free software; you can redistribute it and/or modify
+ *   it under the terms of the GNU General Public License as published by
+ *   the Free Software Foundation; either version 2 of the License, or
+ *   (at your option) any later version.
+ *
+ *   PhpCompta is distributed in the hope that it will be useful,
+ *   but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *   GNU General Public License for more details.
+ *
+ *   You should have received a copy of the GNU General Public License
+ *   along with PhpCompta; if not, write to the Free Software
+ *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ */
+// Copyright (2002-2020) Author Dany De Bontridder <danydb@noalyss.eu>
+
+if (!defined('ALLOWED'))
+    die('Appel direct ne sont pas permis');
+
+/**
+ * @file
+ * @brief save option of card into action_person_option
+ */
+
+try {
+    $ap_value=$http->post("ap_value","array",[]);
+    $ap_id=$http->post("ap_id","array",[]);
+    $cor_id=$http->post("cor_id","array",[]);
+    $fiche_id=$http->post("f_id");
+    $ag_id=$http->post("ag_id");
+    $action_person_id=$http->post("action_person_id");
+} catch (Exception $ex) {
+     record_log("ASCO01".$ex->getMessage().$ex->getTraceAsString());
+     return;
+}
+
+/// If cannot write we stop it
+if ( ! $g_user->can_write_action($ag_id)) {
+    record_log("ASCO02 Security ");
+}
+
+$nb=count($ap_value);
+// nothing to save
+if ($nb == 0) return;
+
+for ($i=0;$i<$nb; $i++) {
+    if ( $ap_id[$i] == -1 ) {
+        $cn->exec_sql("INSERT INTO public.action_person_option (ap_value, 
contact_option_ref_id, action_person_id) 
+                        VALUES($1, $2, $3) ",
+                  [$ap_value[$i],$cor_id[$i],$action_person_id]);
+    } else {
+        $cn->exec_sql("UPDATE public.action_person_option SET ap_value=$1 
WHERE ap_id=$2)",
+                [$ap_value[$i],$action_person_id]);
+    }
+}
\ No newline at end of file



reply via email to

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