noalyss  Version-7.2
document_mod_change.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
20 
21 /**\file
22  * \brief this file respond to an ajax request to modify a type of document
23  */
24 require_once NOALYSS_INCLUDE.'/class/document_type.class.php';
25 echo HtmlInput::title_box(_('Type de document'),'change_doc_div');
26 
28 $doc_type->get();
29 ?>
30 <form method="POST" id="cat_doc_f" onsubmit="cat_doc_change_record('cat_doc_f');">
31  <?php echo HtmlInput::request_to_hidden(array("ac","gDossier","dt_id"))?>
32 <table>
33 <tr>
34  <td> <?php echo _('Nom')?>
35  </td>
36  <td>
37  <?php
38  $name=new IText('dt_name',$doc_type->dt_value);
39  echo $name->input();
40  ?>
41  </td>
42 </tr>
43 
44 <tr>
45  <td><?php echo _('Préfixe')?>
46  </td>
47  <td>
48  <?php
49  $prefix=new IText('dt_prefix',$doc_type->dt_prefix);
50  echo $prefix->input();
51  ?>
52  </td>
53 </tr>
54 
55 <tr>
56  <td><?php echo _('numéro actuel')?>
57  </td>
58  <td>
59  <?php
60  $ret= $cn->get_array("select last_value,is_called from seq_doc_type_".$doc_type->dt_id) ;
61 
62  $last=$ret[0]['last_value'];
63  /*!
64  *\note With PSQL sequence , the last_value column is 1 when before AND after the first call, to make the difference between them
65  * I have to check whether the sequence has been already called or not */
66  if ($ret[0]['is_called']=='f' ) $last--;
67  echo $last;
68  ?>
69  </td>
70  <tr>
71  <td><?php echo _('Prochain numéro')?>
72  <?php echo
74  ?>
75  </td>
76  <td>
77  <?php
78  $seq=new INum('seq',0);
79  echo $seq->input();
80  ?>
81  </td>
82 </tr>
83 
84 </table>
85 
86  <?php echo HtmlInput::submit("save",_('Sauver'));?>
87 </form>
$ret
$ret
Definition: ajax_display_letter.php:52
$last
$last
Definition: document_mod_change.php:62
INum
This class handles only the numeric input, the input will call a javascript to change comma to period...
Definition: inum.class.php:42
Icon_Action\infobulle
static infobulle($p_comment)
Display a info in a bubble, text is in message_javascript.
Definition: icon_action.class.php:83
IText
Definition: itext.class.php:26
HtmlInput\request_to_hidden
static request_to_hidden($array)
transform $_REQUEST data to hidden
Definition: html_input.class.php:668
tr
tr($p_string, $p_extra='')
Definition: ac_common.php:88
table
$select_type table
Definition: card_attr.inc.php:70
Document_type
\
Definition: document_type.class.php:32
$doc_type
$doc_type
Definition: document_mod_change.php:27
HtmlInput\title_box
static title_box($p_name, $p_div, $p_mod="close", $p_js="", $p_draggable="n")
Title for boxes, you can customize the symbol thanks symbol with the mode "custom".
Definition: html_input.class.php:839
HtmlInput\submit
static submit($p_name, $p_value, $p_javascript="", $p_class="smallbutton")
Definition: html_input.class.php:201
$cn
$cn
Definition: ajax_anc_accounting.php:31
$seq
$seq
Definition: document_mod_change.php:78
$name
$name
Definition: ajax_get_profile.php:68
td
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83