noalyss Version-9
ajax_template_cat_card.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 * 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 PhpCompta; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20// Copyright (2016) Author Dany De Bontridder <dany@alchimerys.be>
21
22if (!defined('ALLOWED'))
23 die('Appel direct ne sont pas permis');
24
25/**
26 * @file
27 * @brief Manage the template of category of card
28 */
29
30/**
31 * ajax_template_cat_card add security , accessible only for CFGCARDCAT
32 */
33if ( $g_user->check_module ("CMCARD")==0)
34{
35 return;
36}
37
39$action=$http->request("action");
40$p_id=$http->request("p_id");
41$ctl=$http->request("ctl");
42
43$cat_sql=new Fiche_Def_Ref_SQL($cn, $p_id);
45$cat->set_callback("ajax_misc.php");
46$cat->add_json_param("gDossier", Dossier::id());
47$cat->add_json_param("op", "template_cat_card");
48$cat->set_object_name($ctl);
49
50switch ($action)
51{
52 case "input":
53 // Display a box with the data
54 header('Content-type: text/xml; charset=UTF-8');
55 echo $cat->ajax_input()->saveXML();
56 return;
57 break;
58 case "save":
59 header('Content-type: text/xml; charset=UTF-8');
60 echo $cat->ajax_save()->saveXML();
61 if ( $p_id == -1 && $cat->get_table()->getp("frd_id")!=-1)
62 {
63 $cat->add_mandatory_attr();
64 }
65 return;
66 break;
67 case "delete":
68 header('Content-type: text/xml; charset=UTF-8');
69 echo $cat->ajax_delete()->saveXML();
70 return;
71 break;
72 default:
73 break;
74}
global $g_user
if no group available , then stop
if( $g_user->check_module("CMCARD")==0) $http
ajax_template_cat_card add security , accessible only for CFGCARDCAT
static id()
return the 'gDossier' value after a check
manage the http input (get , post, request) and extract from an array
Manage the template of card category.