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', '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 // The constant that was read before the new set
140 // so we go through a variable to get a consistent display
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 = dol_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
384printDocumentModelList('ficheinter', 'fichinter', 'FICHEINTER_ADDON_PDF', $langs->trans("TemplatePDFInterventions"), array(
385 'Logo' => 'option_logo',
386 'PaymentMode' => 'option_modereg',
387 'PaymentConditions' => 'option_condreg',
388 'MultiLanguage' => 'option_multilang',
389 'WatermarkOnDraftOrders' => 'option_draft_watermark',
390));
391print "<br>";
392
393/*
394 * Other options
395 */
396
397print load_fiche_titre($langs->trans("OtherOptions"), '', '');
398
399print '<div class="div-table-responsive-no-min">';
400print '<table class="noborder centpercent">';
401print '<tr class="liste_titre">';
402print '<td>'.$langs->trans("Parameter").'</td>';
403print '<td align="center" width="60"></td>';
404print "<td>&nbsp;</td>\n";
405print "</tr>\n";
406
407$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
408$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
409$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
410foreach ($substitutionarray as $key => $val) {
411 $htmltext .= $key.'<br>';
412}
413$htmltext .= '</i>';
414
415print '<form action="'.$_SERVER["PHP_SELF"].'" method="post" spellcheck="false">';
416print '<input type="hidden" name="token" value="'.newToken().'">';
417print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
418print '<tr class="oddeven"><td colspan="2">';
419print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
420$variablename = 'FICHINTER_FREE_TEXT';
421if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
422 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
423} else {
424 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
425 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
426 print $doleditor->Create();
427}
428print '</td><td class="right">';
429print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
430print "</td></tr>\n";
431print '</form>';
432
433//Use draft Watermark
434print '<form method="post" action="'.$_SERVER["PHP_SELF"].'" spellcheck="false">';
435print '<input type="hidden" name="token" value="'.newToken().'">';
436print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
437print '<tr class="oddeven"><td>';
438print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
439print '</td><td>';
440print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
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// Print products on fichinter
447print '<tr class="oddeven">';
448print '<td width="80%">'.$langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
449print '<td>&nbsp;</td>';
450print '<td class="center">';
451if ($conf->use_javascript_ajax) {
452 print ajax_constantonoff('FICHINTER_PRINT_PRODUCTS');
453} else {
454 if (getDolGlobalString('FICHINTER_PRINT_PRODUCTS')) {
455 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=0">';
456 print img_picto($langs->trans("Activated"), 'switch_on');
457 } else {
458 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_PRINT_PRODUCTS&token=' . newToken() . '&value=1">';
459 print img_picto($langs->trans("Disabled"), 'switch_off');
460 }
461 print '</a>';
462}
463print '</td>';
464print '</tr>';
465
466// Use services duration
467print '<tr class="oddeven">';
468print '<td width="80%">'.$langs->trans("UseServicesDurationOnFichinter").'</td>';
469print '<td>&nbsp;</td>';
470print '<td class="center">';
471if ($conf->use_javascript_ajax) {
472 print ajax_constantonoff('FICHINTER_USE_SERVICE_DURATION');
473} else {
474 if (getDolGlobalString('FICHINTER_USE_SERVICE_DURATION')) {
475 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=0">';
476 print img_picto($langs->trans("Activated"), 'switch_on');
477 } else {
478 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_USE_SERVICE_DURATION&token=' . newToken() . '&value=1">';
479 print img_picto($langs->trans("Disabled"), 'switch_off');
480 }
481 print '</a>';
482}
483print '</td>';
484print '</tr>';
485
486// Use duration
487print '<tr class="oddeven">';
488print '<td width="80%">'.$langs->trans("UseDurationOnFichinter").'</td>';
489print '<td>&nbsp;</td>';
490print '<td class="center">';
491if ($conf->use_javascript_ajax) {
492 print ajax_constantonoff('FICHINTER_WITHOUT_DURATION');
493} else {
494 if (getDolGlobalString('FICHINTER_WITHOUT_DURATION')) {
495 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=0">';
496 print img_picto($langs->trans("Activated"), 'switch_on');
497 } else {
498 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_WITHOUT_DURATION&token=' . newToken() . '&value=1">';
499 print img_picto($langs->trans("Disabled"), 'switch_off');
500 }
501 print '</a>';
502}
503print '</td>';
504print '</tr>';
505
506// Use date without hour
507print '<tr class="oddeven">';
508print '<td width="80%">'.$langs->trans("UseDateWithoutHourOnFichinter").'</td>';
509print '<td>&nbsp;</td>';
510print '<td class="center">';
511if ($conf->use_javascript_ajax) {
512 print ajax_constantonoff('FICHINTER_DATE_WITHOUT_HOUR');
513} else {
514 if (getDolGlobalString('FICHINTER_DATE_WITHOUT_HOUR')) {
515 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=0">';
516 print img_picto($langs->trans("Activated"), 'switch_on');
517 } else {
518 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_DATE_WITHOUT_HOUR&token=' . newToken() . '&value=1">';
519 print img_picto($langs->trans("Disabled"), 'switch_off');
520 }
521 print '</a>';
522}
523print '</td>';
524print '</tr>';
525
526// Allow online signing
527print '<tr class="oddeven">';
528print '<td width="80%">'.$langs->trans("AllowOnlineSign").'</td>';
529print '<td>&nbsp;</td>';
530print '<td class="center">';
531if ($conf->use_javascript_ajax) {
532 print ajax_constantonoff('FICHINTER_ALLOW_ONLINE_SIGN');
533} else {
534 if (getDolGlobalString('FICHINTER_ALLOW_ONLINE_SIGN')) {
535 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=0">';
536 print img_picto($langs->trans("Activated"), 'switch_on');
537 } else {
538 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_ONLINE_SIGN&token=' . newToken() . '&value=1">';
539 print img_picto($langs->trans("Disabled"), 'switch_off');
540 }
541 print '</a>';
542}
543print '</td>';
544print '</tr>';
545
546// Allow external download
547print '<tr class="oddeven">';
548print '<td width="80%">'.$langs->trans("AllowExternalDownload").'</td>';
549print '<td>&nbsp;</td>';
550print '<td class="center">';
551if ($conf->use_javascript_ajax) {
552 print ajax_constantonoff('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD');
553} else {
554 if (getDolGlobalString('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD')) {
555 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=0">';
556 print img_picto($langs->trans("Activated"), 'switch_on');
557 } else {
558 print '<a class="reposition" href="' . $_SERVER['PHP_SELF'] . '?action=set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD&token=' . newToken() . '&value=1">';
559 print img_picto($langs->trans("Disabled"), 'switch_off');
560 }
561 print '</a>';
562}
563print '</td>';
564print '</tr>';
565
566
567print '</table>';
568print '</div>';
569
570print '<br>';
571
572// End of page
573llxFooter();
574$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.
if(! $sortfield) if(! $sortorder) $module
Definition list.php:193
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:
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.
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:540
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.