noalyss
Version-9
include
ajax
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
*/
26
if
( ! defined (
'ALLOWED'
) ) die(
'Appel direct ne sont pas permis'
);
27
ob_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
// -----------------------------------------------------------------
36
if
(
$id
> 0) {
37
$array
=
$op
->load();
38
}
else
{
39
$ledger_id
=
$http
->get(
"ledger_id"
,
"number"
);
40
$op
->set_jrn(
$ledger_id
);
41
$array
=
$op
->blank(
$ledger_id
);
42
}
43
echo
HtmlInput::title_box
(_(
'Modification du nom'
),
'mod_predf_op'
,
'close'
,
''
,
'n'
);
44
45
echo
'
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;
50
echo
"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;
54
echo
'<p>'
;
55
echo _(
"Description (max 50 car.)"
);
56
echo
$opd_description
->input();
57
echo
'</p>'
;
58
echo dossier::hidden() .
HtmlInput::hidden
(
'od_id'
,
$_GET
[
'id'
]);
59
echo
"<hr>"
;
60
//////////////////////////////////////////////////////////////////////////////
61
// Detail operation
62
//////////////////////////////////////////////////////////////////////////////
63
echo
$op
->display();
64
65
66
echo
HtmlInput::submit
(
'save'
, _(
'Sauve'
));
67
echo
HtmlInput::button
(
'close'
, _(
'Annuler'
),
'onclick="removeDiv(\'mod_predf_op\')"'
);
68
echo
'</form>'
;
69
70
71
$html1
= ob_get_contents();
72
ob_end_clean();
73
$html
=
escape_xml
(
$html1
);
74
if
(headers_sent() )
75
{
76
echo
$html1
;
77
}
78
else
{
79
header(
'Content-type: text/xml; charset=UTF-8'
);
80
}
81
echo <<<EOF
82
<?xml version=
"1.0"
encoding=
"UTF-8"
?>
83
<data>
84
<ctl>mod_predf_op</ctl>
85
<code>
$html
</code>
86
</data>
87
EOF;
$http
$http
Definition:
action.common.inc.php:33
$cn
$cn
Definition:
ajax_anc_accounting.php:30
$opd_description
$opd_description
Definition:
ajax_mod_predf_op.php:51
$html
$html
Definition:
ajax_mod_predf_op.php:73
$op
$op
Definition:
ajax_mod_predf_op.php:30
$html1
$html1
Definition:
ajax_mod_predf_op.php:71
$name
$name
Definition:
ajax_mod_predf_op.php:47
$array
$array
Definition:
ajax_mod_predf_op.php:41
$id
$id
Definition:
ajax_mod_predf_op.php:28
$ledger_id
$ledger_id
Definition:
ajax_periode.php:53
$_GET
$_GET['qcode']
Definition:
category_followup.inc.php:53
HtmlInput\button
static button($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Definition:
html_input.class.php:218
HtmlInput\hidden
static hidden($p_name, $p_value, $p_id="")
Definition:
html_input.class.php:230
HtmlInput\title_box
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".
Definition:
html_input.class.php:874
HtmlInput\submit
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Definition:
html_input.class.php:211
IText
Html Input.
Definition:
itext.class.php:30
ITextarea
Manage the TEXTAREA html element.
Definition:
itextarea.class.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:2721