noalyss Version-9
ajax_action_remove_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
22if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
23/**
24 *@file
25 *@brief remove concerned operation , call from follow up
26 */
28try
29{
30 $ag_id=$http->get("ag_id", "number");
31 $f_id=$http->get("f_id", "number");
32}
33catch (Exception $exc)
34{
35 echo $exc->getMessage();
36 error_log($exc->getTraceAsString());
37 return;
38}
39/*
40 * security Who can do it ?
41 */
42if ( ! $g_user->can_read_action($ag_id) ) {
43 record_log(__FILE__."security : access refused");
44 return;
45}
46
48
49ob_start();
50$action_person_id=$cn->get_value(" select ap_id from action_person where ag_id =$1 and f_id =$2 ",[$ag_id,$f_id]);
51
52// row id to update
53$ctl= "other_".$action_person_id;
54
55$follow->remove_linked_card($f_id);
56$follow->display_linked_count();
57echo $follow->button_action_add_concerned_card( );
58
59$response = ob_get_clean();
60
61if (headers_sent() && DEBUGNOALYSS > 0) {
62 echo $response;
63}
65header('Content-type: text/xml; charset=UTF-8');
66echo <<<EOF
67<?xml version="1.0" encoding="UTF-8"?>
68<data>
69<ctl>$ctl</ctl>
70<code>$html</code>
71</data>
72EOF;
73?>
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
if(headers_sent() &&DEBUGNOALYSS > 0) $html
catch(Exception $exc) if(! $g_user->can_read_action($ag_id)) $follow
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,...