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