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