dolibarr 24.0.0-beta
fichinter.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6 * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@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 * Copyright (C) 2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
13 *
14 * This program is free software; you can redistribute it and/or modify
15 * it under the terms of the GNU General Public License as published by
16 * the Free Software Foundation; either version 3 of the License, or
17 * (at your option) any later version.
18 *
19 * This program is distributed in the hope that it will be useful,
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 * GNU General Public License for more details.
23 *
24 * You should have received a copy of the GNU General Public License
25 * along with this program. If not, see <https://www.gnu.org/licenses/>.
26 */
27
34// Load Dolibarr environment
35require '../main.inc.php';
44require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
45require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
46require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
47require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
48
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 $setFichInterPrintProducts = GETPOSTINT('value');
182 $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", $setFichInterPrintProducts, 'yesno', 0, '', $conf->entity);
183 if (!($res > 0)) {
184 $error++;
185 }
186
187 if (!$error) {
188 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
189 } else {
190 setEventMessages($langs->trans("Error"), null, 'mesgs');
191 }
192} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
193 $setFichInterUseServiceDuration = GETPOSTINT('value');
194 $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", $setFichInterUseServiceDuration, 'yesno', 0, '', $conf->entity);
195 if (!($res > 0)) {
196 $error++;
197 }
198
199 if (!$error) {
200 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
201 } else {
202 setEventMessages($langs->trans("Error"), null, 'mesgs');
203 }
204} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
205 $setFichInterWithoutDuration = GETPOSTINT('value');
206 $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", $setFichInterWithoutDuration, 'yesno', 0, '', $conf->entity);
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, 'mesgs');
215 }
216} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
217 $setFichInterDateWithoutHour = GETPOSTINT('value');
218 $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", $setFichInterDateWithoutHour, 'yesno', 0, '', $conf->entity);
219 if (!($res > 0)) {
220 $error++;
221 }
222
223 if (!$error) {
224 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
225 } else {
226 setEventMessages($langs->trans("Error"), null, 'mesgs');
227 }
228} elseif ($action == "set_FICHINTER_ALLOW_ONLINE_SIGN") {
229 $setFichInterAllowOnlineSign = GETPOSTINT('value');
230 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", $setFichInterAllowOnlineSign, 'yesno', 0, '', $conf->entity);
231 if (!($res > 0)) {
232 $error++;
233 }
234
235 if (!$error) {
236 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
237 } else {
238 setEventMessages($langs->trans("Error"), null, 'mesgs');
239 }
240} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") {
241 $setFichInterAllowExternalDownload = GETPOSTINT('value');
242 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", $setFichInterAllowExternalDownload, 'yesno', 0, '', $conf->entity);
243 if (!($res > 0)) {
244 $error++;
245 }
246
247 if (!$error) {
248 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
249 } else {
250 setEventMessages($langs->trans("Error"), null, 'mesgs');
251 }
252}
253
254
255
256/*
257 * View
258 */
259
260$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
261
262llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-fichinter');
263
264$form = new Form($db);
265
266$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>';
267
268print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup');
269
270
272
273print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
274
275// Interventions numbering model
276
277print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
278
279print '<div class="div-table-responsive-no-min">';
280print '<table class="noborder centpercent">';
281print '<tr class="liste_titre">';
282print '<td width="100">'.$langs->trans("Name").'</td>';
283print '<td>'.$langs->trans("Description").'</td>';
284print '<td>'.$langs->trans("Example").'</td>';
285print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
286print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
287print "</tr>\n";
288
289clearstatcache();
290
291foreach ($dirmodels as $reldir) {
292 $dir = dol_buildpath($reldir."core/modules/fichinter/");
293
294 if (is_dir($dir)) {
295 $handle = opendir($dir);
296 if (is_resource($handle)) {
297 while (($file = readdir($handle)) !== false) {
298 if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) {
299 $file = $reg[1];
300 $classname = substr($file, 4);
301
302 require_once $dir.$file.'.php';
303
304 $module = new $file();
305
306 '@phan-var-force ModeleNumRefFicheinter $module';
307
308 if ($module->isEnabled()) {
309 // Show modules according to features level
310 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
311 continue;
312 }
313 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
314 continue;
315 }
316
317
318 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
319 print $module->info($langs);
320 print '</td>';
321
322 // Show example of numbering model
323 print '<td class="nowrap">';
324 $tmp = $module->getExample();
325 if (preg_match('/^Error/', $tmp)) {
326 $langs->load("errors");
327 print '<div class="error">'.$langs->trans($tmp).'</div>';
328 } elseif ($tmp == 'NotConfigured') {
329 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
330 } else {
331 print $tmp;
332 }
333 print '</td>'."\n";
334
335 print '<td class="center">';
336 if (getDolGlobalString('FICHEINTER_ADDON') == $classname) {
337 print img_picto($langs->trans("Activated"), 'switch_on');
338 } else {
339 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>';
340 }
341 print '</td>';
342
343 $ficheinter = new Fichinter($db);
344 $ficheinter->initAsSpecimen();
345
346 // Info
347 $htmltooltip = '';
348 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
349 $nextval = $module->getNextValue($mysoc, $ficheinter);
350 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
351 $htmltooltip .= ''.$langs->trans("NextValue").': ';
352 if ($nextval) {
353 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
354 $nextval = $langs->trans($nextval);
355 }
356 $htmltooltip .= $nextval.'<br>';
357 } else {
358 $htmltooltip .= $langs->trans($module->error).'<br>';
359 }
360 }
361 print '<td class="center">';
362 print $form->textwithpicto('', $htmltooltip, 1, 'info');
363 print '</td>';
364
365 print '</tr>';
366 }
367 }
368 }
369 closedir($handle);
370 }
371 }
372}
373
374print '</table>';
375print '</div>';
376
377print '<br>';
378
379
380/*
381 * Documents models for Interventions
382 */
383
384print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', '');
385
386// Defini tableau def des modeles
387$type = 'ficheinter';
388$def = array();
389$sql = "SELECT nom";
390$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
391$sql .= " WHERE type = '".$db->escape($type)."'";
392$sql .= " AND entity = ".((int) $conf->entity);
393$resql = $db->query($sql);
394if ($resql) {
395 $i = 0;
396 $num_rows = $db->num_rows($resql);
397 while ($i < $num_rows) {
398 $array = $db->fetch_array($resql);
399 if (is_array($array)) {
400 array_push($def, $array[0]);
401 }
402 $i++;
403 }
404} else {
406}
407
408
409print '<div class="div-table-responsive-no-min">';
410print '<table class="noborder centpercent">';
411print '<tr class="liste_titre">';
412print '<td>'.$langs->trans("Name").'</td>';
413print '<td>'.$langs->trans("Description").'</td>';
414print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
415print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
416print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
417print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
418print "</tr>\n";
419
420clearstatcache();
421
422foreach ($dirmodels as $reldir) {
423 $realpath = $reldir."core/modules/fichinter/doc";
424 $dir = dol_buildpath($realpath);
425
426 if (is_dir($dir)) {
427 $handle = opendir($dir);
428 if (is_resource($handle)) {
429 $filelist = array();
430 while (($file = readdir($handle)) !== false) {
431 $filelist[] = $file;
432 }
433 closedir($handle);
434 arsort($filelist);
435
436 foreach ($filelist as $file) {
437 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
438 if (file_exists($dir.'/'.$file)) {
439 $name = substr($file, 4, dol_strlen($file) - 16);
440 $classname = substr($file, 0, dol_strlen($file) - 12);
441
442 require_once $dir.'/'.$file;
443 $module = new $classname($db);
444
445 '@phan-var-force ModelePDFFicheinter $module';
446
447 $modulequalified = 1;
448 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
449 $modulequalified = 0;
450 }
451 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
452 $modulequalified = 0;
453 }
454
455 if ($modulequalified) {
456 print '<tr class="oddeven"><td width="100">';
457 print(empty($module->name) ? $name : $module->name);
458 print "</td><td>\n";
459 if (method_exists($module, 'info')) {
460 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
461 } else {
462 print $module->description;
463 }
464 print '</td>';
465
466 // Active
467 if (in_array($name, $def)) {
468 print "<td align=\"center\">\n";
469 print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
470 print img_picto($langs->trans("Enabled"), 'switch_on');
471 print '</a>';
472 print "</td>";
473 } else {
474 print "<td align=\"center\">\n";
475 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>';
476 print "</td>";
477 }
478
479 // Default
480 print "<td align=\"center\">";
481 if (getDolGlobalString('FICHEINTER_ADDON_PDF') == "$name") {
482 print img_picto($langs->trans("Default"), 'on');
483 } else {
484 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>';
485 }
486 print '</td>';
487
488 // Info
489 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
490 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
491 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
492 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
493
494 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
495 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
496 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
497 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
498 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
499 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
500 print '<td class="center">';
501 print $form->textwithpicto('', $htmltooltip, -1, 'info');
502 print '</td>';
503
504 // Preview
505 print '<td class="center">';
506 if ($module->type == 'pdf') {
507 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
508 } else {
509 print img_object($langs->transnoentitiesnoconv("PreviewNotAvailable"), 'generic');
510 }
511 print '</td>';
512
513 print '</tr>';
514 }
515 }
516 }
517 }
518 }
519 }
520}
521
522print '</table>';
523print '</div>';
524print "<br>";
525
526/*
527 * Other options
528 */
529
530print load_fiche_titre($langs->trans("OtherOptions"), '', '');
531
532print '<div class="div-table-responsive-no-min">';
533print '<table class="noborder centpercent">';
534print '<tr class="liste_titre">';
535print '<td>'.$langs->trans("Parameter").'</td>';
536print '<td align="center" width="60"></td>';
537print "<td>&nbsp;</td>\n";
538print "</tr>\n";
539
540$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
541$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
542$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
543foreach ($substitutionarray as $key => $val) {
544 $htmltext .= $key.'<br>';
545}
546$htmltext .= '</i>';
547
548print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
549print '<input type="hidden" name="token" value="'.newToken().'">';
550print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
551print '<tr class="oddeven"><td colspan="2">';
552print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
553$variablename = 'FICHINTER_FREE_TEXT';
554if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
555 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
556} else {
557 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
558 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
559 print $doleditor->Create();
560}
561print '</td><td class="right">';
562print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
563print "</td></tr>\n";
564print '</form>';
565
566//Use draft Watermark
567print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
568print '<input type="hidden" name="token" value="'.newToken().'">';
569print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
570print '<tr class="oddeven"><td>';
571print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
572print '</td><td>';
573print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
574print '</td><td class="right">';
575print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
576print "</td></tr>\n";
577print '</form>';
578
579// Print products on fichinter
580print '<tr class="oddeven">';
581print '<td width="80%">'.$langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
582print '<td>&nbsp;</td>';
583print '<td class="center">';
584if ($conf->use_javascript_ajax) {
585 print ajax_constantonoff('FICHINTER_PRINT_PRODUCTS');
586} else {
587 if (getDolGlobalString('FICHINTER_PRINT_PRODUCTS')) {
588 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=0">';
589 print img_picto($langs->trans("Activated"), 'switch_on');
590 } else {
591 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=1">';
592 print img_picto($langs->trans("Disabled"), 'switch_off');
593 }
594 print '</a>';
595}
596print '</td>';
597print '</tr>';
598
599// Use services duration
600print '<tr class="oddeven">';
601print '<td width="80%">'.$langs->trans("UseServicesDurationOnFichinter").'</td>';
602print '<td>&nbsp;</td>';
603print '<td class="center">';
604if ($conf->use_javascript_ajax) {
605 print ajax_constantonoff('FICHINTER_USE_SERVICE_DURATION');
606} else {
607 if (getDolGlobalString('FICHINTER_USE_SERVICE_DURATION')) {
608 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=0">';
609 print img_picto($langs->trans("Activated"), 'switch_on');
610 } else {
611 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=1">';
612 print img_picto($langs->trans("Disabled"), 'switch_off');
613 }
614 print '</a>';
615}
616print '</td>';
617print '</tr>';
618
619// Use duration
620print '<tr class="oddeven">';
621print '<td width="80%">'.$langs->trans("UseDurationOnFichinter").'</td>';
622print '<td>&nbsp;</td>';
623print '<td class="center">';
624if ($conf->use_javascript_ajax) {
625 print ajax_constantonoff('FICHINTER_WITHOUT_DURATION');
626} else {
627 if (getDolGlobalString('FICHINTER_WITHOUT_DURATION')) {
628 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=0">';
629 print img_picto($langs->trans("Activated"), 'switch_on');
630 } else {
631 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=1">';
632 print img_picto($langs->trans("Disabled"), 'switch_off');
633 }
634 print '</a>';
635}
636print '</td>';
637print '</tr>';
638
639// Use date without hour
640print '<tr class="oddeven">';
641print '<td width="80%">'.$langs->trans("UseDateWithoutHourOnFichinter").'</td>';
642print '<td>&nbsp;</td>';
643print '<td class="center">';
644if ($conf->use_javascript_ajax) {
645 print ajax_constantonoff('FICHINTER_DATE_WITHOUT_HOUR');
646} else {
647 if (getDolGlobalString('FICHINTER_DATE_WITHOUT_HOUR')) {
648 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=0">';
649 print img_picto($langs->trans("Activated"), 'switch_on');
650 } else {
651 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=1">';
652 print img_picto($langs->trans("Disabled"), 'switch_off');
653 }
654 print '</a>';
655}
656print '</td>';
657print '</tr>';
658
659// Allow online signing
660print '<tr class="oddeven">';
661print '<td width="80%">'.$langs->trans("AllowOnlineSign").'</td>';
662print '<td>&nbsp;</td>';
663print '<td class="center">';
664if ($conf->use_javascript_ajax) {
665 print ajax_constantonoff('FICHINTER_ALLOW_ONLINE_SIGN');
666} else {
667 if (getDolGlobalString('FICHINTER_ALLOW_ONLINE_SIGN')) {
668 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=0">';
669 print img_picto($langs->trans("Activated"), 'switch_on');
670 } else {
671 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=1">';
672 print img_picto($langs->trans("Disabled"), 'switch_off');
673 }
674 print '</a>';
675}
676print '</td>';
677print '</tr>';
678
679// Allow external download
680print '<tr class="oddeven">';
681print '<td width="80%">'.$langs->trans("AllowExternalDownload").'</td>';
682print '<td>&nbsp;</td>';
683print '<td class="center">';
684if ($conf->use_javascript_ajax) {
685 print ajax_constantonoff('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD');
686} else {
687 if (getDolGlobalString('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD')) {
688 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=0">';
689 print img_picto($langs->trans("Activated"), 'switch_on');
690 } else {
691 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=1">';
692 print img_picto($langs->trans("Disabled"), 'switch_off');
693 }
694 print '</a>';
695}
696print '</td>';
697print '</tr>';
698
699
700print '</table>';
701print '</div>';
702
703print '<br>';
704
705// End of page
706llxFooter();
707$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
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
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:1135
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:133
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.