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