noalyss Version-9
modele_document.php
Go to the documentation of this file.
1<?php
2//This file is part of NOALYSS and is under GPL
3//see licence.txt
4global $doc,$cn;
6echo \Noalyss\Dbg::echo_var(1,"MAX SIZE IS ".MAX_FILE_SIZE);
7?>
8 <?php echo HtmlInput::title_box("Modèle de document","mod_doc",'hide')?>
9<form method="post" enctype="multipart/form-data" onsubmit="return check_file_size(this,<?=MAX_FILE_SIZE?>)">
10<?php echo \HtmlInput::hidden("MAX_FILE_SIZE", MAX_FILE_SIZE);?>
11<table>
12
13<tr>
14<td><?php echo _("Nom du document")?></td>
15
16<td>
17<?php
18$a=new IText('md_name');
19$a->value=$doc->md_name;
20echo $a->input();
21?>
22</td>
23</tr>
24
25<tr>
26<td>
27<?php echo _("Catégorie de document")?>
28</td>
29<td>
30<?php
31// Load all the category
32 $w=new ISelect();
33 $w->name="md_type";
34
35 $w->value=$cn->make_array('select dt_id,dt_value from document_type order by dt_value');
36 $w->selected=$doc->md_type;
37 echo $w->input();
38?>
39
40</td>
41</tr>
42<tr>
43<td>
44<?php echo _("Affectation")?>
45</td>
46<td>
47<?php
48
49 $waffect=new ISelect();
50 $waffect->name='md_affect';
51 $waffect->value=$cn->make_array("select dc_code,dc_comment from public.document_component order by dc_code");
52
53 $waffect->selected=$doc->md_affect;
54 echo $waffect->input();
55?>
56</td>
57</tr>
58<tr>
59
60<tr>
61<td>
62<?php echo _("Fichier")?>
63<?php
64 $dosid=dossier::id();
65 $href=http_build_query(array('gDossier'=>$dosid,'md_id'=>$doc->md_id,'act'=>'RAW:document_template'));
66
67 echo '<A HREF="export.php?'.$href.'">'.'('._('fichier actuel').')</a>';
68?>
69</td>
70<td>
71<?php
72$file=new IFile('doc');
73$file->setAlertOnSize(true);
74echo $file->input();
75
76
77?>
78</td>
79</tr>
80
81<tr>
82<td>
83<?php echo _("Dernier numéro utilisé pour ce type de document")?>
84</td>
85<td>
86<?php
87$last=0;
88 if ( $cn->exist_sequence("seq_doc_type_".$doc->md_type) )
89 {
90 $ret= $cn->get_array("select last_value,is_called from seq_doc_type_".$doc->md_type) ;
91
92 $last=$ret[0]['last_value'];
93 /*!
94 *\note With PSQL sequence , the last_value column is 1 when before AND after the first call, to make the difference between them
95 * I have to check whether the sequence has been already called or not */
96 if ($ret[0]['is_called']=='f' ) $last--;
97 }
98echo $last;
99?>
100</td>
101</tr>
102<tr>
103<td>
104<?php echo _("Redémarrer la séquence (laisser à 0 pour ne pas changer)")?>
105</td>
106<td>
107<?php
108$pj=new INum('seq');
109$pj->value=0;
110echo $pj->input();
111?>
112</td>
113</tr>
114
115</table>
116<?php
117echo HtmlInput::hidden('p_action','document');
118echo dossier::hidden();
119echo HtmlInput::hidden('sa','mod_template');
120echo HtmlInput::hidden('id',$doc->md_id);
121echo HtmlInput::submit("mod",_('Sauver'));
122echo HtmlInput::button_hide("mod_doc");
123?>
124</form>
tr($p_string, $p_extra='')
Definition: ac_common.php:88
td($p_string='', $p_extra='')
surround the string with td
Definition: ac_common.php:83
foreach($array as $idx=> $m) $w
if(! empty( $error)) for($i=0;$i< count($error);$i++)( $last !=$error[$i]) $last
$input_from id
Definition: balance.inc.php:63
static button_hide($div_name)
Hide the HTML popup.
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 for uploading file, must be in a form with enctype="multipart/form-data".
Definition: ifile.class.php:31
This class handles only the numeric input, the input will call a javascript to change comma to period...
Definition: inum.class.php:42
Html Input , create a tag <SELECT> ... </SELECT> if readonly == true then display the label correspon...
Html Input.
Definition: itext.class.php:30
static echo_file($msg, $print=true)
display the file
Definition: dbg.php:88
$all table
global $doc
global $cn