dolibarr  13.0.2
fichinter.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4  * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5  * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6  * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
7  * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
8  * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
9  * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License as published by
13  * the Free Software Foundation; either version 3 of the License, or
14  * (at your option) any later version.
15  *
16  * This program is distributed in the hope that it will be useful,
17  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19  * GNU General Public License for more details.
20  *
21  * You should have received a copy of the GNU General Public License
22  * along with this program. If not, see <https://www.gnu.org/licenses/>.
23  */
24 
31 require '../main.inc.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
36 
37 // Load translation files required by the page
38 $langs->loadLangs(array('admin', 'errors', 'interventions', 'other'));
39 
40 if (!$user->admin) accessforbidden();
41 
42 $action = GETPOST('action', 'aZ09');
43 $value = GETPOST('value', 'alpha');
44 $label = GETPOST('label', 'alpha');
45 $scandir = GETPOST('scan_dir', 'alpha');
46 $type = 'ficheinter';
47 
48 
49 /*
50  * Actions
51  */
52 
53 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
54 
55 if ($action == 'updateMask')
56 {
57  $maskconst = GETPOST('maskconst', 'alpha');
58  $maskvalue = GETPOST('maskvalue', 'alpha');
59  if ($maskconst) $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
60 
61  if (!($res > 0)) $error++;
62 
63  if (!$error)
64  {
65  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
66  } else {
67  setEventMessages($langs->trans("Error"), null, 'errors');
68  }
69 } elseif ($action == 'specimen') // For fiche inter
70 {
71  $modele = GETPOST('module', 'alpha');
72 
73  $inter = new Fichinter($db);
74  $inter->initAsSpecimen();
75 
76  // Search template files
77  $file = ''; $classname = ''; $filefound = 0;
78  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
79  foreach ($dirmodels as $reldir)
80  {
81  $file = dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php", 0);
82  if (file_exists($file))
83  {
84  $filefound = 1;
85  $classname = "pdf_".$modele;
86  break;
87  }
88  }
89 
90  if ($filefound)
91  {
92  require_once $file;
93 
94  $module = new $classname($db);
95 
96  if ($module->write_file($inter, $langs) > 0)
97  {
98  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
99  return;
100  } else {
101  setEventMessages($module->error, $module->errors, 'errors');
102  dol_syslog($module->error, LOG_ERR);
103  }
104  } else {
105  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
106  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
107  }
108 }
109 
110 // Activate a model
111 elseif ($action == 'set')
112 {
113  $ret = addDocumentModel($value, $type, $label, $scandir);
114 } elseif ($action == 'del')
115 {
116  $ret = delDocumentModel($value, $type);
117  if ($ret > 0)
118  {
119  if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity);
120  }
121 }
122 
123 // Set default model
124 elseif ($action == 'setdoc')
125 {
126  if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity))
127  {
128  // La constante qui a ete lue en avant du nouveau set
129  // on passe donc par une variable pour avoir un affichage coherent
130  $conf->global->FICHEINTER_ADDON_PDF = $value;
131  }
132 
133  // On active le modele
134  $ret = delDocumentModel($value, $type);
135  if ($ret > 0)
136  {
137  $ret = addDocumentModel($value, $type, $label, $scandir);
138  }
139 } elseif ($action == 'setmod')
140 {
141  // TODO Verifier si module numerotation choisi peut etre active
142  // par appel methode canBeActivated
143 
144  dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
145 } elseif ($action == 'set_FICHINTER_FREE_TEXT')
146 {
147  $freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
148  $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
149 
150  if (!($res > 0)) $error++;
151 
152  if (!$error)
153  {
154  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
155  } else {
156  setEventMessages($langs->trans("Error"), null, 'errors');
157  }
158 } elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK')
159 {
160  $draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
161  $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
162 
163  if (!($res > 0)) $error++;
164 
165  if (!$error)
166  {
167  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
168  } else {
169  setEventMessages($langs->trans("Error"), null, 'errors');
170  }
171 } elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
172 {
173  $val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha');
174  $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
175 
176  if (!($res > 0)) $error++;
177 
178  if (!$error)
179  {
180  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
181  } else {
182  setEventMessages($langs->trans("Error"), null, 'errors');
183  }
184 } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
185  $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
186  $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
187 
188  if (!($res > 0)) {
189  $error++;
190  }
191 
192  if (!$error) {
193  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
194  } else {
195  setEventMessages($langs->trans("Error"), null, 'errors');
196  }
197 } elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
198  $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
199  $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
200 
201  if (!($res > 0)) {
202  $error++;
203  }
204 
205  if (!$error) {
206  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
207  } else {
208  setEventMessages($langs->trans("Error"), null, 'errors');
209  }
210 } elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
211  $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
212  $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
213 
214  if (!($res > 0)) {
215  $error++;
216  }
217 
218  if (!$error) {
219  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
220  } else {
221  setEventMessages($langs->trans("Error"), null, 'errors');
222  }
223 }
224 
225 
226 
227 /*
228  * View
229  */
230 
231 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
232 
233 llxHeader();
234 
235 $form = new Form($db);
236 
237 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
238 print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup');
239 
240 
242 
243 print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
244 
245 // Interventions numbering model
246 
247 print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
248 
249 print '<table class="noborder centpercent">';
250 print '<tr class="liste_titre">';
251 print '<td width="100">'.$langs->trans("Name").'</td>';
252 print '<td>'.$langs->trans("Description").'</td>';
253 print '<td>'.$langs->trans("Example").'</td>';
254 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
255 print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
256 print "</tr>\n";
257 
258 clearstatcache();
259 
260 foreach ($dirmodels as $reldir)
261 {
262  $dir = dol_buildpath($reldir."core/modules/fichinter/");
263 
264  if (is_dir($dir))
265  {
266  $handle = opendir($dir);
267  if (is_resource($handle))
268  {
269  while (($file = readdir($handle)) !== false)
270  {
271  if (preg_match('/^(mod_.*)\.php$/i', $file, $reg))
272  {
273  $file = $reg[1];
274  $classname = substr($file, 4);
275 
276  require_once $dir.$file.'.php';
277 
278  $module = new $file;
279 
280  if ($module->isEnabled())
281  {
282  // Show modules according to features level
283  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
284  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
285 
286 
287  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
288  print $module->info();
289  print '</td>';
290 
291  // Show example of numbering model
292  print '<td class="nowrap">';
293  $tmp = $module->getExample();
294  if (preg_match('/^Error/', $tmp)) {
295  $langs->load("errors");
296  print '<div class="error">'.$langs->trans($tmp).'</div>';
297  } elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
298  else print $tmp;
299  print '</td>'."\n";
300 
301  print '<td class="center">';
302  if ($conf->global->FICHEINTER_ADDON == $classname)
303  {
304  print img_picto($langs->trans("Activated"), 'switch_on');
305  } else {
306  print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;token='.newToken().'&amp;value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
307  }
308  print '</td>';
309 
310  $ficheinter = new Fichinter($db);
311  $ficheinter->initAsSpecimen();
312 
313  // Info
314  $htmltooltip = '';
315  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
316  $nextval = $module->getNextValue($mysoc, $ficheinter);
317  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
318  $htmltooltip .= ''.$langs->trans("NextValue").': ';
319  if ($nextval) {
320  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
321  $nextval = $langs->trans($nextval);
322  $htmltooltip .= $nextval.'<br>';
323  } else {
324  $htmltooltip .= $langs->trans($module->error).'<br>';
325  }
326  }
327  print '<td class="center">';
328  print $form->textwithpicto('', $htmltooltip, 1, 0);
329  print '</td>';
330 
331  print '</tr>';
332  }
333  }
334  }
335  closedir($handle);
336  }
337  }
338 }
339 
340 print '</table><br>';
341 
342 
343 /*
344  * Documents models for Interventions
345  */
346 
347 print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', '');
348 
349 // Defini tableau def des modeles
350 $type = 'ficheinter';
351 $def = array();
352 $sql = "SELECT nom";
353 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
354 $sql .= " WHERE type = '".$db->escape($type)."'";
355 $sql .= " AND entity = ".$conf->entity;
356 $resql = $db->query($sql);
357 if ($resql)
358 {
359  $i = 0;
360  $num_rows = $db->num_rows($resql);
361  while ($i < $num_rows)
362  {
363  $array = $db->fetch_array($resql);
364  array_push($def, $array[0]);
365  $i++;
366  }
367 } else {
368  dol_print_error($db);
369 }
370 
371 
372 print '<table class="noborder centpercent">';
373 print '<tr class="liste_titre">';
374 print '<td>'.$langs->trans("Name").'</td>';
375 print '<td>'.$langs->trans("Description").'</td>';
376 print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
377 print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
378 print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
379 print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
380 print "</tr>\n";
381 
382 clearstatcache();
383 
384 foreach ($dirmodels as $reldir)
385 {
386  $realpath = $reldir."core/modules/fichinter/doc";
387  $dir = dol_buildpath($realpath);
388 
389  if (is_dir($dir))
390  {
391  $handle = opendir($dir);
392  if (is_resource($handle))
393  {
394  while (($file = readdir($handle)) !== false)
395  {
396  $filelist[] = $file;
397  }
398  closedir($handle);
399  arsort($filelist);
400 
401  foreach ($filelist as $file)
402  {
403  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file))
404  {
405  if (file_exists($dir.'/'.$file))
406  {
407  $name = substr($file, 4, dol_strlen($file) - 16);
408  $classname = substr($file, 0, dol_strlen($file) - 12);
409 
410  require_once $dir.'/'.$file;
411  $module = new $classname($db);
412 
413  $modulequalified = 1;
414  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
415  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
416 
417  if ($modulequalified)
418  {
419  print '<tr class="oddeven"><td width="100">';
420  print (empty($module->name) ? $name : $module->name);
421  print "</td><td>\n";
422  if (method_exists($module, 'info')) print $module->info($langs);
423  else print $module->description;
424  print '</td>';
425 
426  // Active
427  if (in_array($name, $def))
428  {
429  print "<td align=\"center\">\n";
430  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
431  print img_picto($langs->trans("Enabled"), 'switch_on');
432  print '</a>';
433  print "</td>";
434  } else {
435  print "<td align=\"center\">\n";
436  print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
437  print "</td>";
438  }
439 
440  // Default
441  print "<td align=\"center\">";
442  if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
443  {
444  print img_picto($langs->trans("Default"), 'on');
445  } else {
446  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
447  }
448  print '</td>';
449 
450  // Info
451  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
452  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
453  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
454  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
455 
456  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
457  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
458  $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
459  $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
460  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
461  $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
462  print '<td class="center">';
463  print $form->textwithpicto('', $htmltooltip, -1, 0);
464  print '</td>';
465 
466  // Preview
467  print '<td class="center">';
468  if ($module->type == 'pdf')
469  {
470  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
471  } else {
472  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
473  }
474  print '</td>';
475 
476  print '</tr>';
477  }
478  }
479  }
480  }
481  }
482  }
483 }
484 
485 print '</table>';
486 print "<br>";
487 
488 /*
489  * Other options
490  */
491 
492 print load_fiche_titre($langs->trans("OtherOptions"), '', '');
493 print '<table class="noborder centpercent">';
494 print '<tr class="liste_titre">';
495 print '<td>'.$langs->trans("Parameter").'</td>';
496 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
497 print "<td>&nbsp;</td>\n";
498 print "</tr>\n";
499 
500 $substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
501 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
502 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
503 foreach ($substitutionarray as $key => $val) $htmltext .= $key.'<br>';
504 $htmltext .= '</i>';
505 
506 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
507 print '<input type="hidden" name="token" value="'.newToken().'">';
508 print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
509 print '<tr class="oddeven"><td colspan="2">';
510 print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
511 $variablename = 'FICHINTER_FREE_TEXT';
512 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
513 {
514  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
515 } else {
516  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
517  $doleditor = new DolEditor($variablename, $conf->global->$variablename, '', 80, 'dolibarr_notes');
518  print $doleditor->Create();
519 }
520 print '</td><td class="right">';
521 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
522 print "</td></tr>\n";
523 print '</form>';
524 
525 //Use draft Watermark
526 print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
527 print '<input type="hidden" name="token" value="'.newToken().'">';
528 print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
529 print '<tr class="oddeven"><td>';
530 print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
531 print '</td><td>';
532 print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
533 print '</td><td class="right">';
534 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
535 print "</td></tr>\n";
536 print '</form>';
537 // print products on fichinter
538 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
539 print '<input type="hidden" name="token" value="'.newToken().'">';
540 print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
541 print '<tr class="oddeven"><td>';
542 print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
543 print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
544 if ($conf->global->FICHINTER_PRINT_PRODUCTS)
545  print 'checked ';
546 print '/>';
547 print '</td><td class="right">';
548 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
549 print "</td></tr>\n";
550 print '</form>';
551 // Use services duration
552 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
553 print '<input type="hidden" name="token" value="'.newToken().'">';
554 print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
555 print '<tr class="oddeven">';
556 print '<td>';
557 print $langs->trans("UseServicesDurationOnFichinter");
558 print '</td>';
559 print '<td class="center">';
560 print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"'.($conf->global->FICHINTER_USE_SERVICE_DURATION ? ' checked' : '').'>';
561 print '</td>';
562 print '<td class="right">';
563 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
564 print '</td>';
565 print '</tr>';
566 print '</form>';
567 // Use duration
568 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
569 print '<input type="hidden" name="token" value="'.newToken().'">';
570 print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
571 print '<tr class="oddeven">';
572 print '<td>';
573 print $langs->trans("UseDurationOnFichinter");
574 print '</td>';
575 print '<td class="center">';
576 print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"'.($conf->global->FICHINTER_WITHOUT_DURATION ? ' checked' : '').'>';
577 print '</td>';
578 print '<td class="right">';
579 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
580 print '</td>';
581 print '</tr>';
582 print '</form>';
583 // use date without hour
584 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
585 print '<input type="hidden" name="token" value="'.newToken().'">';
586 print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
587 print '<tr class="oddeven">';
588 print '<td>';
589 print $langs->trans("UseDateWithoutHourOnFichinter");
590 print '</td>';
591 print '<td class="center">';
592 print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"'.($conf->global->FICHINTER_DATE_WITHOUT_HOUR ? ' checked' : '').'>';
593 print '</td>';
594 print '<td class="right">';
595 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
596 print '</td>';
597 print '</tr>';
598 print '</form>';
599 
600 print '</table>';
601 
602 print '<br>';
603 
604 // End of page
605 llxFooter();
606 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1748
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Class to manage interventions.
dolibarr_set_const($db, $name, $value, $type= 'chaine', $visible=0, $note= '', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
Definition: admin.lib.php:575
addDocumentModel($name, $type, $label= '', $description= '')
Add document model used by doc generator.
Definition: admin.lib.php:1717
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
llxHeader()
Empty header.
Definition: wrapper.php:45
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage generation of HTML components Only common components must be here.
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
dol_strlen($string, $stringencoding= 'UTF-8')
Make a strlen call.
fichinter_admin_prepare_head()
Return array head with list of tabs to view object informations.
dolibarr_del_const($db, $name, $entity=1)
Effacement d&#39;une constante dans la base de donnees.
Definition: admin.lib.php:499
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt= '', $morecss= '', $marginleftonlyshort=2)
Show picto whatever it&#39;s its name (generic function)
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename= '', $restricttologhandler= '', $logcontext=null)
Write log message into outputs.
if(!GETPOST('transkey', 'alphanohtml')&&!GETPOST('transphrase', 'alphanohtml')) else
View.
Definition: notice.php:44
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
pdf_getSubstitutionArray($outputlangs, $exclude=null, $object=null, $onlykey=0)
Return array of possible substitutions for PDF content (without external module substitutions).
Definition: pdf.lib.php:643
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
Definition: index.php:89
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->don->lire) if(!empty($conf->tax->enabled)&&$user->rights->tax->charges->lire) if(!empty($conf->facture->enabled)&&!empty($conf->commande->enabled)&&$user->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if((!empty($conf->fournisseur->enabled)&&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)||!empty($conf->supplier_invoice->enabled))&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1232
dol_print_error($db= '', $error= '', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
newToken()
Return the value of token currently saved into session with name &#39;newtoken&#39;.
print $_SERVER["PHP_SELF"] n
Edit parameters.
Definition: categories.php:101
Class to manage a WYSIWYG editor.
llxFooter()
Empty footer.
Definition: wrapper.php:59
if(!defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN'
Draft customers invoices.