noalyss Version-9
ajax_action_save_concerned.php
Go to the documentation of this file.
1<?php
2/*
3 * This file is part of NOALYSS.
4 *
5 * NOALYSS is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * NOALYSS is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with NOALYSS; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20// Copyright 2014 Author Dany De Bontridder danydb@aevalys.eu
21/**
22 *@file
23 *@brief insert concerned operation , call from follow up
24 */
25
26// require_once '.php';
27if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
28/**
29 * Insert into follow-up the card (f_id) for the action_gestion (ag_id)
30 */
32try {
33 // follow_up id
34 $ag_id=$http->request("ag_id","number");
35 $ctl=$http->request("ctl");
36 $selected_card=$http->request("selected_card","array",[]);
37} catch (Exception $ex) {
38 record_log(__FILE__.$ex->getMessage().$ex->getTraceAsString());
39 return;
40}
41/*
42 * security Who can do it ?
43 */
44if ( ! $g_user->can_write_action($ag_id) ) {
45 record_log(__FILE__."security : access refused");
46 return;
47}
48
51for ($i=0;$i< $nb_card;$i++)
52{
53 $elt=$selected_card[$i];
54 if (isNumber($elt)) {
55 $follow->insert_linked_card($elt);
56 }
57}
58/**
59 * Display all the linked card
60 */
61
62ob_start();
63$follow->display_linked_count();
64echo $follow->button_action_add_concerned_card( );
65$response = ob_get_clean();
67header('Content-type: text/xml; charset=UTF-8');
68echo <<<EOF
69<?xml version="1.0" encoding="UTF-8"?>
70<data>
71<ctl>$ctl</ctl>
72<code>$html</code>
73</data>
74EOF;
75?>
isNumber($p_int)
Definition: ac_common.php:215
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
$ag_id
Definition: action.inc.php:54
$http
Insert into follow-up the card (f_id) for the action_gestion (ag_id)
catch(Exception $ex) if(! $g_user->can_write_action($ag_id)) $follow
$ex
Definition: balance.inc.php:45
Others concerned card in an action.
manage the http input (get , post, request) and extract from an array
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...