Definition at line 32 of file class_rapav_formulaire.php.
RAPAV_Formulaire::__construct |
( |
|
$f_id = -1 | ) |
|
RAPAV_Formulaire::anchor_document |
( |
| ) |
|
Anchor to the template.
- Returns
- html anchor string
Definition at line 57 of file class_rapav_formulaire.php.
References $url.
59 $url=HtmlInput::request_to_string(array(
'gDossier',
'ac',
'plugin_code'));
60 $url=
'extension.raw.php'.$url.
'&act=export_definition_modele&id='.$this->f_id;
61 return HtmlInput::anchor($this->f_filename,
$url);
RAPAV_Formulaire::echo_formulaire |
( |
| ) |
|
Definition at line 243 of file class_rapav_formulaire.php.
245 echo
'<h2>' . h($this->f_title) .
'</h2>';
246 echo
'<p>' . h($this->f_description) .
'<p>';
static RAPAV_Formulaire::generate_code |
( |
| ) |
|
|
static |
Definition at line 272 of file class_rapav_formulaire.php.
References $max.
Referenced by update_definition(), and verify_definition().
273 $a_possible= explode(
',',
'A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9');
274 $max=count($a_possible);
276 $code=$a_possible[rand(0,
$max)].
277 $a_possible[rand(0,
$max)].
278 $a_possible[rand(0,
$max)].
279 $a_possible[rand(0,
$max)].
280 $a_possible[rand(0,
$max)].
281 $a_possible[rand(0,
$max)]
RAPAV_Formulaire::input_definition |
( |
| ) |
|
RAPAV_Formulaire::input_formulaire |
( |
| ) |
|
RAPAV_Formulaire::input_parameter |
( |
| ) |
|
static RAPAV_Formulaire::listing |
( |
| ) |
|
|
static |
show a list of all existing declaration type $cn database connection
Definition at line 46 of file class_rapav_formulaire.php.
References $cn.
49 $alist = $cn->get_array(
"select f_id,f_title,f_description
50 from rapport_advanced.formulaire order by 2");
51 require
'template/formulaire_listing.php';
RAPAV_Formulaire::load_definition |
( |
| ) |
|
Get data from database, from the table rapport_advanced.formulaire_param.
Definition at line 66 of file class_rapav_formulaire.php.
References $f, $max, and $ret.
68 $f =
new Formulaire_Param_Sql();
69 $ret =
$f->seek(
" where f_id=" . sql_string($this->f_id) .
" order by p_order ");
72 for ($i = 0; $i <
$max; $i++)
74 $o =
new Formulaire_Param_Sql();
76 $this->definition[] = clone $o;
Definition at line 206 of file class_rapav_formulaire.php.
References $cn, and $name.
210 if (
sizeof($_FILES) == 0)
215 $name = $_FILES[
'rapav_template'][
'name'];
216 $new_name = tempnam($_ENV[
'TMP'],
'rapav_template');
218 if (strlen($_FILES[
'rapav_template'][
'tmp_name']) != 0)
221 if (move_uploaded_file($_FILES[
'rapav_template'][
'tmp_name'], $new_name))
223 $oid = $cn->lo_import($new_name);
232 $p_rapav->f_lob = $oid;
233 $p_rapav->f_filename = $_FILES[
'rapav_template'][
'name'];
234 $p_rapav->f_mimetype = $_FILES[
'rapav_template'][
'type'];
235 $p_rapav->f_size= $_FILES[
'rapav_template'][
'size'];
RAPAV_Formulaire::remove_doc_template |
( |
| ) |
|
remove a doc template
Definition at line 262 of file class_rapav_formulaire.php.
References $cn.
265 $cn->lo_unlink($this->f_lob);
266 $this->f_filename=null;
268 $this->f_mimetype=null;
static RAPAV_Formulaire::save_definition |
( |
|
$p_array | ) |
|
|
static |
save the definition $p_array contains
- f_id id of the formulaire
- f_title title of the formulaire
- f_description description of the formulaire
- p_id array of the row in formulaire_param
- p_code array of the row in formulaire_param
- p_libelle array of the row in formulaire_param
- p_type array of the row in formulaire_param
- t_id array of the row in formulaire_param
- p_order array of the row in formulaire_param
Definition at line 111 of file class_rapav_formulaire.php.
113 self::verify_definition($p_array);
114 self::update_definition($p_array);
static RAPAV_Formulaire::update_definition |
( |
|
$p_array | ) |
|
|
static |
- See Also
- save_definition
- Parameters
-
Definition at line 153 of file class_rapav_formulaire.php.
References $cn, $ret, and generate_code().
158 $rapav->f_title = $p_array[
'f_title'];
159 $rapav->f_description = $p_array[
'f_description'];
161 $nb_line=count($p_array[
'p_id']);
162 for ($i = 0; $i < $nb_line ; $i++)
167 $form_param->p_code=str_replace(
' ',
"",$form_param->p_code);
169 $form_param->p_libelle = trim($p_array[
'p_libelle'][$i]);
170 if ( $form_param->p_libelle ==
'')
continue;
171 $form_param->p_type = $p_array[
'p_type'][$i];
172 $form_param->p_order = (isNumber($p_array[
'p_order'][$i]) == 0) ? ($i+1) * 10 : $p_array[
'p_order'][$i];
173 $form_param->t_id = $p_array[
't_id'][$i];
174 $form_param->f_id = $p_array[
'f_id'];
176 if ($p_array[
'p_id'][$i] == -1)
177 $form_param->insert();
179 $form_param->update();
183 if ( isset ($p_array[
"del_row"]))
185 for ($i=0;$i<count($p_array[
'del_row']);$i++)
187 if (isNumber($p_array[
'del_row'][$i]) == 1 && $p_array[
'del_row'][$i]!=-1) {
188 $cn->exec_sql(
'delete from rapport_advanced.formulaire_param where p_id=$1',array($p_array[
'del_row'][$i]));
195 $ret=$order_param->seek(
' where f_id=$1 order by p_order',array($p_array[
'f_id']));
196 $nb_rows=Database::num_row(
$ret);
197 for ($i=0;$i < $nb_rows;$i++)
199 $param=$order_param->next(
$ret,$i);
200 $param->p_order=($i+1)*10;
203 self::load_file($rapav);
static RAPAV_Formulaire::verify_definition |
( |
& |
$p_array | ) |
|
|
static |
Check data and change them if needed database connection $cn.
- Parameters
-
array | $p_array | normally $_POST |
Definition at line 122 of file class_rapav_formulaire.php.
References $cn, and generate_code().
125 $count_code=count($p_array[
'p_code']);
126 for ($i=0;$i<$count_code;$i++)
128 $c=$cn->get_value(
'select count(*) from rapport_advanced.formulaire_param
129 where p_code=$1 and p_id <> $2 and f_id=$3',
130 array($p_array[
'p_code'][$i],$p_array[
'p_id'][$i],$p_array[
'f_id']));
137 for ($i=0;$i<$count_code;$i++)
139 for ($e=0;$e<$count_code;$e++) {
140 if ($p_array[
'p_code'][$i] == $p_array[
'p_code'][$e] && $i != $e)
The documentation for this class was generated from the following file: