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