dolibarr  7.0.0-beta
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@capnetworks.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-2017 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 <http://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 $langs->load("admin");
38 $langs->load("errors");
39 $langs->load("interventions");
40 $langs->load('other');
41 
42 if (! $user->admin) accessforbidden();
43 
44 $action = GETPOST('action','alpha');
45 $value = GETPOST('value','alpha');
46 $label = GETPOST('label','alpha');
47 $scandir = GETPOST('scan_dir','alpha');
48 $type='ficheinter';
49 
50 
51 /*
52  * Actions
53  */
54 
55 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
56 
57 if ($action == 'updateMask')
58 {
59  $maskconst=GETPOST('maskconst','alpha');
60  $maskvalue=GETPOST('maskvalue','alpha');
61  if ($maskconst) $res = dolibarr_set_const($db,$maskconst,$maskvalue,'chaine',0,'',$conf->entity);
62 
63  if (! $res > 0) $error++;
64 
65  if (! $error)
66  {
67  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
68  }
69  else
70  {
71  setEventMessages($langs->trans("Error"), null, 'errors');
72  }
73 }
74 
75 else if ($action == 'specimen') // For fiche inter
76 {
77  $modele= GETPOST('module','alpha');
78 
79  $inter = new Fichinter($db);
80  $inter->initAsSpecimen();
81 
82  // Search template files
83  $file=''; $classname=''; $filefound=0;
84  $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
85  foreach($dirmodels as $reldir)
86  {
87  $file=dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php",0);
88  if (file_exists($file))
89  {
90  $filefound=1;
91  $classname = "pdf_".$modele;
92  break;
93  }
94  }
95 
96  if ($filefound)
97  {
98  require_once $file;
99 
100  $module = new $classname($db);
101 
102  if ($module->write_file($inter,$langs) > 0)
103  {
104  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
105  return;
106  }
107  else
108  {
109  setEventMessages($module->error, $module->errors, 'errors');
110  dol_syslog($module->error, LOG_ERR);
111  }
112  }
113  else
114  {
115  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
116  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
117  }
118 }
119 
120 // Activate a model
121 else if ($action == 'set')
122 {
123  $ret = addDocumentModel($value, $type, $label, $scandir);
124 }
125 
126 else if ($action == 'del')
127 {
128  $ret = delDocumentModel($value, $type);
129  if ($ret > 0)
130  {
131  if ($conf->global->FICHEINTER_ADDON_PDF == "$value") dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF',$conf->entity);
132  }
133 }
134 
135 // Set default model
136 else if ($action == 'setdoc')
137 {
138  if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF",$value,'chaine',0,'',$conf->entity))
139  {
140  // La constante qui a ete lue en avant du nouveau set
141  // on passe donc par une variable pour avoir un affichage coherent
142  $conf->global->FICHEINTER_ADDON_PDF = $value;
143  }
144 
145  // On active le modele
146  $ret = delDocumentModel($value, $type);
147  if ($ret > 0)
148  {
149  $ret = addDocumentModel($value, $type, $label, $scandir);
150  }
151 }
152 
153 else if ($action == 'setmod')
154 {
155  // TODO Verifier si module numerotation choisi peut etre active
156  // par appel methode canBeActivated
157 
158  dolibarr_set_const($db, "FICHEINTER_ADDON",$value,'chaine',0,'',$conf->entity);
159 }
160 
161 else if ($action == 'set_FICHINTER_FREE_TEXT')
162 {
163  $freetext= GETPOST('FICHINTER_FREE_TEXT','none'); // No alpha here, we want exact string
164  $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT",$freetext,'chaine',0,'',$conf->entity);
165 
166  if (! $res > 0) $error++;
167 
168  if (! $error)
169  {
170  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
171  }
172  else
173  {
174  setEventMessages($langs->trans("Error"), null, 'errors');
175  }
176 }
177 
178 else if ($action == 'set_FICHINTER_DRAFT_WATERMARK')
179 {
180  $draft= GETPOST('FICHINTER_DRAFT_WATERMARK','alpha');
181  $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK",trim($draft),'chaine',0,'',$conf->entity);
182 
183  if (! $res > 0) $error++;
184 
185  if (! $error)
186  {
187  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
188  }
189  else
190  {
191  setEventMessages($langs->trans("Error"), null, 'errors');
192  }
193 }
194 
195 elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS')
196 {
197  $val = GETPOST('FICHINTER_PRINT_PRODUCTS','alpha');
198  $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS",($val == 'on' ? 1 : 0),'bool',0,'',$conf->entity);
199 
200  if (! $res > 0) $error++;
201 
202  if (! $error)
203  {
204  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
205  }
206  else
207  {
208  setEventMessages($langs->trans("Error"), null, 'errors');
209  }
210 } elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
211  $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
212  $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
213  $conf->entity);
214 
215  if (!$res > 0) {
216  $error++;
217  }
218 
219  if (!$error) {
220  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
221  } else {
222  setEventMessages($langs->trans("Error"), null, 'errors');
223  }
224 } elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
225  $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
226  $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '',
227  $conf->entity);
228 
229  if (!$res > 0) {
230  $error++;
231  }
232 
233  if (!$error) {
234  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
235  } else {
236  setEventMessages($langs->trans("Error"), null, 'errors');
237  }
238 } elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
239  $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
240  $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '',
241  $conf->entity);
242 
243  if (!$res > 0) {
244  $error++;
245  }
246 
247  if (!$error) {
248  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
249  } else {
250  setEventMessages($langs->trans("Error"), null, 'errors');
251  }
252 }
253 
254 
255 
256 /*
257  * View
258  */
259 
260 $dirmodels=array_merge(array('/'),(array) $conf->modules_parts['models']);
261 
262 llxHeader();
263 
264 $form=new Form($db);
265 
266 $linkback='<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
267 print load_fiche_titre($langs->trans("InterventionsSetup"),$linkback,'title_setup');
268 
269 
271 
272 dol_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
273 
274 // Interventions numbering model
275 
276 print load_fiche_titre($langs->trans("FicheinterNumberingModules"),'','');
277 
278 print '<table class="noborder" width="100%">';
279 print '<tr class="liste_titre">';
280 print '<td width="100">'.$langs->trans("Name").'</td>';
281 print '<td>'.$langs->trans("Description").'</td>';
282 print '<td>'.$langs->trans("Example").'</td>';
283 print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
284 print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
285 print "</tr>\n";
286 
287 clearstatcache();
288 
289 foreach ($dirmodels as $reldir)
290 {
291  $dir = dol_buildpath($reldir."core/modules/fichinter/");
292 
293  if (is_dir($dir))
294  {
295  $handle = opendir($dir);
296  if (is_resource($handle))
297  {
298 
299  while (($file = readdir($handle))!==false)
300  {
301  if (preg_match('/^(mod_.*)\.php$/i',$file,$reg))
302  {
303  $file = $reg[1];
304  $classname = substr($file,4);
305 
306  require_once $dir.$file.'.php';
307 
308  $module = new $file;
309 
310  if ($module->isEnabled())
311  {
312  // Show modules according to features level
313  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
314  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
315 
316 
317  print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
318  print $module->info();
319  print '</td>';
320 
321  // Show example of numbering model
322  print '<td class="nowrap">';
323  $tmp=$module->getExample();
324  if (preg_match('/^Error/',$tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
325  elseif ($tmp=='NotConfigured') print $langs->trans($tmp);
326  else print $tmp;
327  print '</td>'."\n";
328 
329  print '<td align="center">';
330  if ($conf->global->FICHEINTER_ADDON == $classname)
331  {
332  print img_picto($langs->trans("Activated"),'switch_on');
333  }
334  else
335  {
336  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&amp;value='.$classname.'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
337  }
338  print '</td>';
339 
340  $ficheinter=new Fichinter($db);
341  $ficheinter->initAsSpecimen();
342 
343  // Info
344  $htmltooltip='';
345  $htmltooltip.=''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
346  $nextval=$module->getNextValue($mysoc,$ficheinter);
347  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
348  $htmltooltip.=''.$langs->trans("NextValue").': ';
349  if ($nextval) {
350  if (preg_match('/^Error/',$nextval) || $nextval=='NotConfigured')
351  $nextval = $langs->trans($nextval);
352  $htmltooltip.=$nextval.'<br>';
353  } else {
354  $htmltooltip.=$langs->trans($module->error).'<br>';
355  }
356  }
357  print '<td align="center">';
358  print $form->textwithpicto('',$htmltooltip,1,0);
359  print '</td>';
360 
361  print '</tr>';
362  }
363  }
364  }
365  closedir($handle);
366  }
367  }
368 }
369 
370 print '</table><br>';
371 
372 
373 /*
374  * Documents models for Interventions
375  */
376 
377 print load_fiche_titre($langs->trans("TemplatePDFInterventions"),'','');
378 
379 // Defini tableau def des modeles
380 $type='ficheinter';
381 $def = array();
382 $sql = "SELECT nom";
383 $sql.= " FROM ".MAIN_DB_PREFIX."document_model";
384 $sql.= " WHERE type = '".$type."'";
385 $sql.= " AND entity = ".$conf->entity;
386 $resql=$db->query($sql);
387 if ($resql)
388 {
389  $i = 0;
390  $num_rows=$db->num_rows($resql);
391  while ($i < $num_rows)
392  {
393  $array = $db->fetch_array($resql);
394  array_push($def, $array[0]);
395  $i++;
396  }
397 }
398 else
399 {
400  dol_print_error($db);
401 }
402 
403 
404 print '<table class="noborder" width="100%">';
405 print '<tr class="liste_titre">';
406 print '<td>'.$langs->trans("Name").'</td>';
407 print '<td>'.$langs->trans("Description").'</td>';
408 print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
409 print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
410 print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
411 print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
412 print "</tr>\n";
413 
414 clearstatcache();
415 
416 foreach ($dirmodels as $reldir)
417 {
418  $dir = dol_buildpath($reldir."core/modules/fichinter/doc/");
419 
420  if (is_dir($dir))
421  {
422  $handle=opendir($dir);
423  if (is_resource($handle))
424  {
425  while (($file = readdir($handle))!==false)
426  {
427  $filelist[]=$file;
428  }
429  closedir($handle);
430  arsort($filelist);
431 
432  foreach($filelist as $file)
433  {
434  if (preg_match('/\.modules\.php$/i',$file) && preg_match('/^(pdf_|doc_)/',$file))
435  {
436  if (file_exists($dir.'/'.$file))
437  {
438 
439 
440  $name = substr($file, 4, dol_strlen($file) -16);
441  $classname = substr($file, 0, dol_strlen($file) -12);
442 
443  require_once $dir.'/'.$file;
444  $module = new $classname($db);
445 
446  $modulequalified=1;
447  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified=0;
448  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified=0;
449 
450  if ($modulequalified)
451  {
452  print '<tr class="oddeven"><td width="100">';
453  print (empty($module->name)?$name:$module->name);
454  print "</td><td>\n";
455  if (method_exists($module,'info')) print $module->info($langs);
456  else print $module->description;
457  print '</td>';
458 
459  // Active
460  if (in_array($name, $def))
461  {
462  print "<td align=\"center\">\n";
463  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">';
464  print img_picto($langs->trans("Enabled"),'switch_on');
465  print '</a>';
466  print "</td>";
467  }
468  else
469  {
470  print "<td align=\"center\">\n";
471  print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').'</a>';
472  print "</td>";
473  }
474 
475  // Default
476  print "<td align=\"center\">";
477  if ($conf->global->FICHEINTER_ADDON_PDF == "$name")
478  {
479  print img_picto($langs->trans("Default"),'on');
480  }
481  else
482  {
483  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').'</a>';
484  }
485  print '</td>';
486 
487  // Info
488  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
489  $htmltooltip.='<br>'.$langs->trans("Type").': '.($module->type?$module->type:$langs->trans("Unknown"));
490  $htmltooltip.='<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
491  $htmltooltip.='<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
492  $htmltooltip.='<br>'.$langs->trans("Logo").': '.yn($module->option_logo,1,1);
493  $htmltooltip.='<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg,1,1);
494  $htmltooltip.='<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg,1,1);
495  $htmltooltip.='<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang,1,1);
496  $htmltooltip.='<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark,1,1);
497  print '<td align="center">';
498  print $form->textwithpicto('',$htmltooltip,-1,0);
499  print '</td>';
500 
501  // Preview
502  print '<td align="center">';
503  if ($module->type == 'pdf')
504  {
505  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"),'intervention').'</a>';
506  }
507  else
508  {
509  print img_object($langs->trans("PreviewNotAvailable"),'generic');
510  }
511  print '</td>';
512 
513  print '</tr>';
514  }
515  }
516  }
517  }
518  }
519  }
520 }
521 
522 print '</table>';
523 print "<br>";
524 
525 /*
526  * Other options
527  */
528 
529 print load_fiche_titre($langs->trans("OtherOptions"),'','');
530 print '<table class="noborder" width="100%">';
531 print '<tr class="liste_titre">';
532 print '<td>'.$langs->trans("Parameter").'</td>';
533 print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
534 print "<td>&nbsp;</td>\n";
535 print "</tr>\n";
536 
537 $substitutionarray=pdf_getSubstitutionArray($langs, null, null, 2);
538 $substitutionarray['__(AnyTranslationKey)__']=$langs->trans("Translation");
539 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
540 foreach($substitutionarray as $key => $val) $htmltext.=$key.'<br>';
541 $htmltext.='</i>';
542 
543 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
544 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
545 print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
546 print '<tr class="oddeven"><td colspan="2">';
547 print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
548 $variablename='FICHINTER_FREE_TEXT';
549 if (empty($conf->global->PDF_ALLOW_HTML_FOR_FREE_TEXT))
550 {
551  print '<textarea name="'.$variablename.'" class="flat" cols="120">'.$conf->global->$variablename.'</textarea>';
552 }
553 else
554 {
555  include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
556  $doleditor=new DolEditor($variablename, $conf->global->$variablename,'',80,'dolibarr_notes');
557  print $doleditor->Create();
558 }
559 print '</td><td align="right">';
560 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
561 print "</td></tr>\n";
562 print '</form>';
563 
564 //Use draft Watermark
565 
566 print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
567 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
568 print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
569 print '<tr class="oddeven"><td>';
570 print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
571 print '</td><td>';
572 print '<input size="50" class="flat" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.$conf->global->FICHINTER_DRAFT_WATERMARK.'">';
573 print '</td><td align="right">';
574 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
575 print "</td></tr>\n";
576 print '</form>';
577 // print products on fichinter
578 print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
579 print '<input type="hidden" name="token" value="'.$_SESSION['newtoken'].'">';
580 print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
581 print '<tr class="oddeven"><td>';
582 print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
583 print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
584 if ($conf->global->FICHINTER_PRINT_PRODUCTS)
585  print 'checked ';
586 print '/>';
587 print '</td><td align="right">';
588 print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
589 print "</td></tr>\n";
590 print '</form>';
591 // Use services duration
592 print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
593 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
594 print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
595 print '<tr class="oddeven">';
596 print '<td>';
597 print $langs->trans("UseServicesDurationOnFichinter");
598 print '</td>';
599 print '<td align="center">';
600 print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"' . ($conf->global->FICHINTER_USE_SERVICE_DURATION?' checked':'') . '>';
601 print '</td>';
602 print '<td align="right">';
603 print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
604 print '</td>';
605 print '</tr>';
606 print '</form>';
607 // Use duration
608 print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
609 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
610 print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
611 print '<tr class="oddeven">';
612 print '<td>';
613 print $langs->trans("UseDurationOnFichinter");
614 print '</td>';
615 print '<td align="center">';
616 print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"' . ($conf->global->FICHINTER_WITHOUT_DURATION?' checked':'') . '>';
617 print '</td>';
618 print '<td align="right">';
619 print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
620 print '</td>';
621 print '</tr>';
622 print '</form>';
623 // use date without hour
624 print '<form action="' . $_SERVER["PHP_SELF"] . '" method="post">';
625 print '<input type="hidden" name="token" value="' . $_SESSION['newtoken'] . '">';
626 print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
627 print '<tr class="oddeven">';
628 print '<td>';
629 print $langs->trans("UseDateWithoutHourOnFichinter");
630 print '</td>';
631 print '<td align="center">';
632 print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"' . ($conf->global->FICHINTER_DATE_WITHOUT_HOUR?' checked':'') . '>';
633 print '</td>';
634 print '<td align="right">';
635 print '<input type="submit" class="button" value="' . $langs->trans("Modify") . '">';
636 print '</td>';
637 print '</tr>';
638 print '</form>';
639 
640 
641 
642 
643 print '</table>';
644 
645 print '<br>';
646 
647 llxFooter();
648 $db->close();
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1540
llxFooter()
Empty footer.
Definition: wrapper.php:58
img_picto($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='')
Show picto whatever it's its name (generic function)
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
setEventMessages($mesg, $mesgs, $style='mesgs')
Set event messages in dol_events session object.
if(!GETPOST('transkey')&&!GETPOST('transphrase')) else
View.
Definition: notice.php:43
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
if(GETPOST('cancel','alpha')) if(!GETPOST('confirmmassaction','alpha')&&$massaction!= 'presend'&&$massaction!= 'confirm_presend')
Draft customers invoices.
Definition: list.php:147
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:485
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1506
dol_print_error($db='', $error='', $errors=null)
Affiche message erreur system avec toutes les informations pour faciliter le diagnostic et la remonte...
if(empty($reshook)) $form
View.
Definition: perms.php:103
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
GETPOST($paramname, $check='none', $method=0, $filter=NULL, $options=NULL, $noreplace=0)
Return value of a param into GET or POST supervariable.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
Class to manage generation of HTML components Only common components must be here.
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='')
Write log message into outputs.
fichinter_admin_prepare_head()
Return array head with list of tabs to view object informations.
dolibarr_del_const($db, $name, $entity=1)
Effacement d'une constante dans la base de donnees.
Definition: admin.lib.php:410
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
img_object($titlealt, $picto, $moreatt= '', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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:603
print
Draft customers invoices.
Definition: index.php:91
if(!empty($conf->facture->enabled)&&$user->rights->facture->lire) if(!empty($conf->fournisseur->enabled)&&$user->rights->fournisseur->facture->lire) if(!empty($conf->don->enabled)&&$user->rights->societe->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)&&$user->rights->fournisseur->facture->lire) $resql
Social contributions to pay.
Definition: index.php:1013
Class to manage a WYSIWYG editor.
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.