noalyss Version-9
ajax_tag_add_action.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// Copyright Author Dany De Bontridder danydb@aevalys.eu
20if ( !defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
21/**
22 *@file
23 *@brief remove tag , call from follow up
24 *@see Follow_Up
25 *@see Tag
26 */
28
30
31$fl->ag_id=$http->request("ag_id","number");
32
33if ( $g_user->can_write_action($fl->ag_id) != TRUE ) return;
34
35if ( $http->request("isgroup") == 't') {
36 $fl->tag_add($http->request('t_id',"number"));
37} else {
38 // Add all the tag from the group
39 $aTag=$cn->get_array("select t_id,t_tag ,t_color from jnt_tag_group_tag jtgt join tags on (tag_id=t_id) where tag_group_id=$1 order by 2 ",[$http->request("t_id","number")]);
41 if ( $nb_atag > 0) {
42 for ($i=0;$i<$nb_atag;$i++){
43 $fl->tag_add($aTag[$i]['t_id']);
44 }
45 }
46}
47
48ob_start();
49
50$fl->tag_cell();
51
52$response= ob_get_clean();
54header('Content-type: text/xml; charset=UTF-8');
55echo <<<EOF
56<?xml version="1.0" encoding="UTF-8"?>
57<data>
58<ctl></ctl>
59<code>$html</code>
60</data>
61EOF;
62exit();
63
64
65?>
global $g_user
if no group available , then stop
manage the http input (get , post, request) and extract from an array
for($e=0; $e< count($afiche); $e++) exit
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...