noalyss Version-9
ajax_view_action.php
Go to the documentation of this file.
1<?php
2
3/*
4 * This file is part of NOALYSS.
5 *
6 * NOALYSS 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 NOALYSS; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21// Copyright Author Dany De Bontridder danydb@aevalys.eu
22
23/**
24 * @file
25 * @brief show the detail of an action
26 *
27 */
28if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
29ob_start();
30
31echo HtmlInput::title_box(_("Détail action"), $div,"close","","y");
33$act->ag_id = $ag_id;
34$act->get();
35
36$code='nok';
37if ( ($g_user->can_write_action($ag_id) == true || $g_user->can_read_action($ag_id) == true || $act->ag_dest == -1) && $act->ag_id !=0)
38{
39 $menu=new Default_Menu();
40 echo $act->Display('READ', false, "ajax", "");
41 //$action=HtmlInput::array_to_string(array("gDossier","ag_id"), $_GET)."&ac=FOLLOW&sa=detail";
42 $action= "do.php?".http_build_query(array("gDossier"=>Dossier::id(),"ag_id"=>$ag_id,"ac"=>$menu->get('code_follow'),"sa"=>"detail"));
43 $code='ok';
44?>
45<a href="<?php echo $action?>" target="_blank" class="smallbutton"><?php echo _("Modifier")?> </a>
46<?php
47}
48else
49{
50 $forbidden = _("Ce document n'est pas accessible");
51 ?>
52 <div style="margin:0px;padding:0px;background-color:red;text-align:center;">
53 <h2 class="error"><?php echo $forbidden ?></h2>;
54</div>
55 <?php
56}
58$response = ob_get_clean();
60header('Content-type: text/xml; charset=UTF-8');
61echo <<<EOF
62<?xml version="1.0" encoding="UTF-8"?>
63<data>
64<ctl>$code</ctl>
65<code>$html</code>
66</data>
67EOF;
68exit();
69
70?>
h2($p_string, $p_class="", $raw="")
Definition: ac_common.php:68
global $g_user
if no group available , then stop
$ag_id
Definition: action.inc.php:54
$action
$div
$opd_description style
</div > $response
Description of class_default_menu.
static id()
return the 'gDossier' value after a check
static button_close($div_name, $class='smallbutton')
close button for the HTML popup
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n", $p_enlarge='n')
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
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,...