noalyss Version-9
ajax_mod_predf_op.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/**\file
24 * \brief display a form to change the name of a predefined operation
25 */
26if ( ! defined ('ALLOWED') ) die('Appel direct ne sont pas permis');
27ob_start();
28$id=$http->get("id","number");
29
30$op=new Pre_Operation($cn,$id);
31
32// ----------------------------------------------------------------
33// if id > 0 then we display an existing template operation
34// otherwise a blank one
35// -----------------------------------------------------------------
36if ( $id > 0) {
37 $array = $op->load();
38} else {
39 $ledger_id=$http->get("ledger_id","number");
40 $op->set_jrn($ledger_id);
42}
43echo HtmlInput::title_box(_('Modification du nom'),'mod_predf_op','close','','n');
44
45echo '
46 <form method="POST" onsubmit="save_predf_op(this);return false;">';
47$name = new IText('opd_name');
48$name->value = $op->od_name;
49$name->size = 60;
50echo "Nom =" . $name->input();
51$opd_description=new ITextarea('od_description');
52$opd_description->style=' class="itextarea" style="width:30em;height:4em;vertical-align:top"';
53$opd_description->value=$op->od_description;
54echo '<p>';
55echo _("Description (max 50 car.)");
56echo $opd_description->input();
57echo '</p>';
58echo dossier::hidden() . HtmlInput::hidden('od_id', $_GET['id']);
59echo "<hr>";
60//////////////////////////////////////////////////////////////////////////////
61// Detail operation
62//////////////////////////////////////////////////////////////////////////////
63echo $op->display();
64
65
66echo HtmlInput::submit('save', _('Sauve'));
67echo HtmlInput::button('close', _('Annuler'), 'onclick="removeDiv(\'mod_predf_op\')"');
68echo '</form>';
69
70
71$html1 = ob_get_contents();
72ob_end_clean();
74if (headers_sent() )
75 {
76 echo $html1;
77 }
78else {
79 header('Content-type: text/xml; charset=UTF-8');
80}
81echo <<<EOF
82<?xml version="1.0" encoding="UTF-8"?>
83<data>
84<ctl>mod_predf_op</ctl>
85<code>$html</code>
86</data>
87EOF;
$opd_description
$ledger_id
$_GET['qcode']
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
static hidden($p_name, $p_value, $p_id="")
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".
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Html Input.
Definition: itext.class.php:30
Manage the TEXTAREA html element.
escape_xml($p_xml)
When data are transfered thanks ajax in a xml document, the xml can not contains some character,...