noalyss Version-10
NOALYSS : serveur de comptabilité et ERP (2002)
Loading...
Searching...
No Matches
ajax_anc_plan.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS 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 * NOALYSS 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 NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21// Copyright Author Dany De Bontridder dany@alchimerys.be
22 /**
23 *\file
24 *\brief ajax answer to update or change name or description of an analytic plan
25 */
26if (!defined('ALLOWED'))
27 die('Appel direct ne sont pas permis');
28
29
30
31
32$input = $http->request("input");
33$action = $http->request("ieaction", "string", "display");
34$pa_id=$http->post("id","number");
35
37$answer->add_json_param("gDossier", Dossier::id());
38$answer->set_callback("ajax_misc.php");
39$answer->add_json_param("action","anc_updatedescription");
40$answer->add_json_param("op","anc_updatedescription");
41$answer->add_json_param("id",$pa_id);
42if ( $g_user->check_module("PLANANC") == 0) {
43 record_log("PLANANC security ");
44 return;
45}
46
47$input=$answer->get_input();
48if ($action=="display") {
49 echo $answer->ajax_input() ;
50}
51if ($action=="ok") {
52 $value=$http->post("value");
53 if ( $input->name=="pa_name" && trim($value) == "")
54 {
55 echo _("Le nom ne peut ĂȘtre vide"),$answer->ajax_input();
56 }else {
57 if ($input->name=="pa_name") {
58 $cn->exec_sql(" update plan_analytique set pa_name=$1 where pa_id=$2",array($value,$pa_id));
59 }
60 if ($input->name=="pa_description") {
61 if ( trim($value ) == "" ) $value=NULL;
62 $cn->exec_sql(" update plan_analytique set pa_description=$1 where pa_id=$2",array($value,$pa_id));
63 if ( trim($value ) == NULL ) $value=_("Aucune description");
64 }
65 $answer->set_value($value);
66 echo $answer->value();
67 }
68}
69if ($action=="cancel") {
70 echo $answer->value();
71}
record_log($p_message)
Record an error message into the log file of the server or in the log folder of NOALYSS Record also t...
global $g_user
if no group available , then stop
$answer
_("actif, passif,charge,...")
static build($p_serialize)
build a Inplace_Edit object from a serialized string (ajax json parameter = input)