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 
22 if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
23 /**
24  *@file
25  *@brief remove concerned operation , call from follow up
26  */
28 try
29 {
30  $ag_id=$http->get("ag_id", "number");
31  $f_id=$http->get("f_id", "number");
32 }
33 catch (Exception $exc)
34 {
35  echo $exc->getMessage();
36  error_log($exc->getTraceAsString());
37  return;
38 }
39 /*
40  * security Who can do it ?
41  */
42 if ( ! $g_user->can_read_action($ag_id) ) {
43  record_log(__FILE__."security : access refused");
44  return;
45 }
46 
48 
49 ob_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();
57 echo $follow->button_action_add_concerned_card( );
58 
59 $response = ob_get_clean();
60 
61 if (headers_sent() && DEBUGNOALYSS > 0) {
62  echo $response;
63 }
65 header('Content-type: text/xml; charset=UTF-8');
66 echo <<<EOF
67 <?xml version="1.0" encoding="UTF-8"?>
68 <data>
69 <ctl>$ctl</ctl>
70 <code>$html</code>
71 </data>
72 EOF;
73 ?>
$follow
catch(Exception $exc) if(! $g_user->can_read_action($ag_id)) $follow
Definition: ajax_action_remove_concerned.php:47
HttpInput
manage the http input (get , post, request) and extract from an array
Definition: http_input.class.php:37
$action_person_id
$action_person_id
Definition: ajax_action_remove_concerned.php:50
$ag_id
$ag_id
Definition: action.inc.php:54
$html
if(headers_sent() &&DEBUGNOALYSS > 0) $html
Definition: ajax_action_remove_concerned.php:64
$ctl
$ctl
Definition: ajax_action_remove_concerned.php:53
$g_user
global $g_user
Find the default module or the first one.
Definition: action.inc.php:24
$http
$http
Definition: ajax_action_remove_concerned.php:27
$f_id
$f_id
Definition: ajax_action_remove_concerned.php:31
escape_xml
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...
Definition: function_javascript.php:2720
$cn
$cn
Definition: ajax_anc_accounting.php:30
$response
$response
Definition: ajax_action_remove_concerned.php:59
Follow_Up_Other_Concerned
Others concerned card in an action.
Definition: follow_up_other_concerned.class.php:34
record_log
record_log($p_message)
Record an error message into the log file of the server.
Definition: ac_common.php:1400