noalyss Version-9
ajax_cfgaction.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// check right
26if ($g_user->check_action(PARCATDOC)==0)
27{
28
29 record_log("cfgaction01 security ");
30 return;
31}
32
33
35
36
37/**
38 * @file
39 * @brief call for document_type in follow up
40 */
41try
42{
43 $table=$http->request('table');
44 $ctl_id=$http->request('ctl');
45 $action=$http->request('action');
46 $p_id=$http->request('p_id', "number");
47}
48catch (Exception $ex)
49{
50 echo $e->getMessage();
51 return;
52}
53
56
57$action_document_type->set_callback("ajax_misc.php");
58$action_document_type->add_json_param("op", "cfgaction");
59$action_document_type->set_object_name($ctl_id);
60
61
62
63if ($action=="input")
64{
65 $action_document_type->set_order(["dt_id", "dt_value","dt_prefix"]);
66
67 header('Content-type: text/xml; charset=UTF-8');
68 echo $action_document_type->ajax_input()->saveXML();
69 return;
70}
71elseif ($action=="save")
72{
73 $action_document_type->set_order(["dt_id", "dt_prefix","dt_value"]);
74 $xml=$action_document_type->ajax_save();
75 header('Content-type: text/xml; charset=UTF-8');
76 echo $xml->saveXML();
77}
78elseif ($action=="delete")
79{
80 $xml=$action_document_type->ajax_delete();
81 header('Content-type: text/xml; charset=UTF-8');
82 echo $xml->saveXML();
83}
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
switch($op2) $xml
Definition: ajax_card.php:806
$action_document_type
catch(Exception $ex) $doc_type
$action
if($g_user->check_action(PARCATDOC)==0) $http
$ctl_id
$ex
Definition: balance.inc.php:45
display , modify and add document_type for follow up
abstract of the table public.document_type
manage the http input (get , post, request) and extract from an array
const PARCATDOC
if( $delta< 0) elseif( $delta==0)
$table
Definition: menu.inc.php:103