dolibarr 25.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-2026 MDW <mdeweerd@users.noreply.github.com>
11 * Copyright (C) 2024-2026 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', '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 $langs->load('errors');
124 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
125 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
126 }
127} elseif ($action == 'set') {
128 // Activate a model
129 $ret = addDocumentModel($value, $type, $label, $scandir);
130} elseif ($action == 'del') {
131 $ret = delDocumentModel($value, $type);
132 if ($ret > 0) {
133 if (getDolGlobalString('FICHEINTER_ADDON_PDF') == "$value") {
134 dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity);
135 }
136 }
137} elseif ($action == 'setdoc') {
138 // Set default model
139 if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
140 // The constant that was read before the new set
141 // so we go through a variable to get a consistent display
142 $conf->global->FICHEINTER_ADDON_PDF = $value;
143 }
144
145 // On active le modele
146 $ret = delDocumentModel($value, $type);
147 if ($ret > 0) {
148 $ret = addDocumentModel($value, $type, $label, $scandir);
149 }
150} elseif ($action == 'setmod') {
151 // TODO Verify if the chosen numbering module can be activated
152 // by calling method canBeActivated
153
154 dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
155} elseif ($action == 'set_FICHINTER_FREE_TEXT') {
156 $freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
157 $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
158
159 if (!($res > 0)) {
160 $error++;
161 }
162
163 if (!$error) {
164 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
165 } else {
166 setEventMessages($langs->trans("Error"), null, 'errors');
167 }
168} elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') {
169 $draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
170 $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
171
172 if (!($res > 0)) {
173 $error++;
174 }
175
176 if (!$error) {
177 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
178 } else {
179 setEventMessages($langs->trans("Error"), null, 'errors');
180 }
181} elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') {
182 $setFichInterPrintProducts = GETPOSTINT('value');
183 $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", $setFichInterPrintProducts, 'yesno', 0, '', $conf->entity);
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, 'mesgs');
192 }
193} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
194 $setFichInterUseServiceDuration = GETPOSTINT('value');
195 $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", $setFichInterUseServiceDuration, 'yesno', 0, '', $conf->entity);
196 if (!($res > 0)) {
197 $error++;
198 }
199
200 if (!$error) {
201 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
202 } else {
203 setEventMessages($langs->trans("Error"), null, 'mesgs');
204 }
205} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
206 $setFichInterWithoutDuration = GETPOSTINT('value');
207 $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", $setFichInterWithoutDuration, 'yesno', 0, '', $conf->entity);
208 if (!($res > 0)) {
209 $error++;
210 }
211
212 if (!$error) {
213 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
214 } else {
215 setEventMessages($langs->trans("Error"), null, 'mesgs');
216 }
217} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
218 $setFichInterDateWithoutHour = GETPOSTINT('value');
219 $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", $setFichInterDateWithoutHour, 'yesno', 0, '', $conf->entity);
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, 'mesgs');
228 }
229} elseif ($action == "set_FICHINTER_ALLOW_ONLINE_SIGN") {
230 $setFichInterAllowOnlineSign = GETPOSTINT('value');
231 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", $setFichInterAllowOnlineSign, 'yesno', 0, '', $conf->entity);
232 if (!($res > 0)) {
233 $error++;
234 }
235
236 if (!$error) {
237 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
238 } else {
239 setEventMessages($langs->trans("Error"), null, 'mesgs');
240 }
241} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") {
242 $setFichInterAllowExternalDownload = GETPOSTINT('value');
243 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", $setFichInterAllowExternalDownload, 'yesno', 0, '', $conf->entity);
244 if (!($res > 0)) {
245 $error++;
246 }
247
248 if (!$error) {
249 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
250 } else {
251 setEventMessages($langs->trans("Error"), null, 'mesgs');
252 }
253}
254
255
256
257/*
258 * View
259 */
260
261$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
262
263llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-fichinter');
264
265$form = new Form($db);
266
267$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>';
268
269print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup');
270
271
273
274print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
275
276// Interventions numbering model
277
278print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
279
280print '<div class="div-table-responsive-no-min">';
281print '<table class="noborder centpercent">';
282print '<tr class="liste_titre">';
283print '<td width="100">'.$langs->trans("Name").'</td>';
284print '<td>'.$langs->trans("Description").'</td>';
285print '<td>'.$langs->trans("Example").'</td>';
286print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
287print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
288print "</tr>\n";
289
290clearstatcache();
291
292$arrayofmodules = array();
293
294foreach ($dirmodels as $reldir) {
295 $dir = dol_buildpath($reldir."core/modules/fichinter/");
296
297 if (is_dir($dir)) {
298 $handle = opendir($dir);
299 if (is_resource($handle)) {
300 while (($file = readdir($handle)) !== false) {
301 if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) {
302 $file = $reg[1];
303
304 require_once $dir.$file.'.php';
305
306 $module = new $file();
307
308 '@phan-var-force ModeleNumRefFicheinter $module';
309
310 $arrayofmodules[] = $module;
311 }
312 }
313 closedir($handle);
314 }
315 }
316}
317
318$arrayofmodules = dol_sort_array($arrayofmodules, 'position');
320'@phan-var-force ModeleNumRefFicheinter[] $arrayofmodules';
321
322foreach ($arrayofmodules as $module) {
323 $classname = dol_substr(get_class($module), 4);
324
325 // Show modules according to features level
326 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
327 continue;
328 }
329 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
330 continue;
331 }
332
333 if ($module->isEnabled()) {
334 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
335 print $module->info($langs);
336 print '</td>';
337
338 // Show example of numbering model
339 print '<td class="nowrap">';
340 $tmp = $module->getExample();
341 if (preg_match('/^Error/', $tmp)) {
342 $langs->load("errors");
343 print '<div class="error">'.$langs->trans($tmp).'</div>';
344 } elseif ($tmp == 'NotConfigured') {
345 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
346 } else {
347 print $tmp;
348 }
349 print '</td>'."\n";
350
351 print '<td class="center">';
352 if (getDolGlobalString('FICHEINTER_ADDON') == $classname) {
353 print img_picto($langs->trans("Activated"), 'switch_on');
354 } else {
355 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>';
356 }
357 print '</td>';
358
359 $ficheinter = new Fichinter($db);
360 $ficheinter->initAsSpecimen();
361
362 // Info
363 $htmltooltip = '';
364 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
365 $nextval = $module->getNextValue($mysoc, $ficheinter);
366 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
367 $htmltooltip .= ''.$langs->trans("NextValue").': ';
368 if ($nextval) {
369 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
370 $langs->load('errors');
371 $nextval = $langs->trans($nextval);
372 }
373 $htmltooltip .= $nextval.'<br>';
374 } else {
375 $langs->load('errors');
376 $htmltooltip .= $langs->trans($module->error).'<br>';
377 }
378 }
379 print '<td class="center">';
380 print $form->textwithpicto('', $htmltooltip, 1, 'info');
381 print '</td>';
382
383 print '</tr>';
384 }
385}
386
387print '</table>';
388print '</div>';
389
390print '<br>';
391
392
393/*
394 * Documents models for Interventions
395 */
396
397printDocumentModelList('ficheinter', 'fichinter', 'FICHEINTER_ADDON_PDF', $langs->trans("TemplatePDFInterventions"), array(
398 'Logo' => 'option_logo',
399 'PaymentMode' => 'option_modereg',
400 'PaymentConditions' => 'option_condreg',
401 'MultiLanguage' => 'option_multilang',
402 'WatermarkOnDraftOrders' => 'option_draft_watermark',
403));
404print "<br>";
405
406/*
407 * Other options
408 */
409
410print load_fiche_titre($langs->trans("OtherOptions"), '', '');
411
412print '<div class="div-table-responsive-no-min">';
413print '<table class="noborder centpercent">';
414print '<tr class="liste_titre">';
415print '<td>'.$langs->trans("Parameter").'</td>';
416print '<td align="center" width="60"></td>';
417print "<td>&nbsp;</td>\n";
418print "</tr>\n";
419
420$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
421$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
422$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
423foreach ($substitutionarray as $key => $val) {
424 $htmltext .= $key.'<br>';
425}
426$htmltext .= '</i>';
427
428print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" spellcheck="false">';
429print '<input type="hidden" name="token" value="'.newToken().'">';
430print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
431print '<tr class="oddeven"><td colspan="2">';
432print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
433$variablename = 'FICHINTER_FREE_TEXT';
434if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
435 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
436} else {
437 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
438 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
439 print $doleditor->Create();
440}
441print '</td><td class="right">';
442print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
443print "</td></tr>\n";
444print '</form>';
445
446//Use draft Watermark
447print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" spellcheck="false">';
448print '<input type="hidden" name="token" value="'.newToken().'">';
449print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
450print '<tr class="oddeven"><td>';
451print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
452print '</td><td>';
453print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
454print '</td><td class="right">';
455print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
456print "</td></tr>\n";
457print '</form>';
458
459// Print products on fichinter
460print '<tr class="oddeven">';
461print '<td width="80%">'.$langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
462print '<td>&nbsp;</td>';
463print '<td class="center">';
464if ($conf->use_javascript_ajax) {
465 print ajax_constantonoff('FICHINTER_PRINT_PRODUCTS');
466} else {
467 if (getDolGlobalString('FICHINTER_PRINT_PRODUCTS')) {
468 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=0">';
469 print img_picto($langs->trans("Activated"), 'switch_on');
470 } else {
471 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=1">';
472 print img_picto($langs->trans("Disabled"), 'switch_off');
473 }
474 print '</a>';
475}
476print '</td>';
477print '</tr>';
478
479// Use services duration
480print '<tr class="oddeven">';
481print '<td width="80%">'.$langs->trans("UseServicesDurationOnFichinter").'</td>';
482print '<td>&nbsp;</td>';
483print '<td class="center">';
484if ($conf->use_javascript_ajax) {
485 print ajax_constantonoff('FICHINTER_USE_SERVICE_DURATION');
486} else {
487 if (getDolGlobalString('FICHINTER_USE_SERVICE_DURATION')) {
488 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=0">';
489 print img_picto($langs->trans("Activated"), 'switch_on');
490 } else {
491 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=1">';
492 print img_picto($langs->trans("Disabled"), 'switch_off');
493 }
494 print '</a>';
495}
496print '</td>';
497print '</tr>';
498
499// Use duration
500print '<tr class="oddeven">';
501print '<td width="80%">'.$langs->trans("UseDurationOnFichinter").'</td>';
502print '<td>&nbsp;</td>';
503print '<td class="center">';
504if ($conf->use_javascript_ajax) {
505 print ajax_constantonoff('FICHINTER_WITHOUT_DURATION');
506} else {
507 if (getDolGlobalString('FICHINTER_WITHOUT_DURATION')) {
508 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=0">';
509 print img_picto($langs->trans("Activated"), 'switch_on');
510 } else {
511 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=1">';
512 print img_picto($langs->trans("Disabled"), 'switch_off');
513 }
514 print '</a>';
515}
516print '</td>';
517print '</tr>';
518
519// Use date without hour
520print '<tr class="oddeven">';
521print '<td width="80%">'.$langs->trans("UseDateWithoutHourOnFichinter").'</td>';
522print '<td>&nbsp;</td>';
523print '<td class="center">';
524if ($conf->use_javascript_ajax) {
525 print ajax_constantonoff('FICHINTER_DATE_WITHOUT_HOUR');
526} else {
527 if (getDolGlobalString('FICHINTER_DATE_WITHOUT_HOUR')) {
528 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=0">';
529 print img_picto($langs->trans("Activated"), 'switch_on');
530 } else {
531 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=1">';
532 print img_picto($langs->trans("Disabled"), 'switch_off');
533 }
534 print '</a>';
535}
536print '</td>';
537print '</tr>';
538
539// Allow online signing
540print '<tr class="oddeven">';
541print '<td width="80%">'.$langs->trans("AllowOnlineSign").'</td>';
542print '<td>&nbsp;</td>';
543print '<td class="center">';
544if ($conf->use_javascript_ajax) {
545 print ajax_constantonoff('FICHINTER_ALLOW_ONLINE_SIGN');
546} else {
547 if (getDolGlobalString('FICHINTER_ALLOW_ONLINE_SIGN')) {
548 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=0">';
549 print img_picto($langs->trans("Activated"), 'switch_on');
550 } else {
551 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=1">';
552 print img_picto($langs->trans("Disabled"), 'switch_off');
553 }
554 print '</a>';
555}
556print '</td>';
557print '</tr>';
558
559// Allow external download
560print '<tr class="oddeven">';
561print '<td width="80%">'.$langs->trans("AllowExternalDownload").'</td>';
562print '<td>&nbsp;</td>';
563print '<td class="center">';
564if ($conf->use_javascript_ajax) {
565 print ajax_constantonoff('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD');
566} else {
567 if (getDolGlobalString('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD')) {
568 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=0">';
569 print img_picto($langs->trans("Activated"), 'switch_on');
570 } else {
571 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=1">';
572 print img_picto($langs->trans("Disabled"), 'switch_off');
573 }
574 print '</a>';
575}
576print '</td>';
577print '</tr>';
578
579
580print '</table>';
581print '</div>';
582
583print '<br>';
584
585// End of page
586llxFooter();
587$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
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
Class to manage a WYSIWYG editor.
Class to manage generation of HTML components Only common components must be here.
if(! $sortfield) if(! $sortorder) $module
Definition list.php:193
global $mysoc
fichinter_admin_prepare_head()
Return array head with list of tabs to view object information.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
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, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_substr($string, $start, $length=null, $stringencoding='', $trunconbytes=0)
Make a substring.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
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.
Definition html.lib.php:542
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='', $morecssonpicto='widthpictotitle')
Load a title with picto.
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:1180
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.