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