dolibarr 21.0.0-alpha
fichinter.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6 * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
7 * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
8 * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
9 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
10 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
11 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
12 *
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU General Public License for more details.
22 *
23 * You should have received a copy of the GNU General Public License
24 * along with this program. If not, see <https://www.gnu.org/licenses/>.
25 */
26
33// Load Dolibarr environment
34require '../main.inc.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
37require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
38require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
39
40// Load translation files required by the page
41$langs->loadLangs(array('admin', 'errors', 'interventions', 'other'));
42
43if (!$user->admin) {
45}
46
47$action = GETPOST('action', 'aZ09');
48$value = GETPOST('value', 'alpha');
49$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
50
51$label = GETPOST('label', 'alpha');
52$scandir = GETPOST('scan_dir', 'alpha');
53$type = 'ficheinter';
54
55
56/*
57 * Actions
58 */
59
60include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
61
62if ($action == 'updateMask') {
63 $maskconst = GETPOST('maskconst', 'aZ09');
64 $maskvalue = GETPOST('maskvalue', 'alpha');
65 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 '@phan-var-force ModeleNumRefFicheinter $module';
299
300 if ($module->isEnabled()) {
301 // Show modules according to features level
302 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
303 continue;
304 }
305 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
306 continue;
307 }
308
309
310 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
311 print $module->info($langs);
312 print '</td>';
313
314 // Show example of numbering model
315 print '<td class="nowrap">';
316 $tmp = $module->getExample();
317 if (preg_match('/^Error/', $tmp)) {
318 $langs->load("errors");
319 print '<div class="error">'.$langs->trans($tmp).'</div>';
320 } elseif ($tmp == 'NotConfigured') {
321 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
322 } else {
323 print $tmp;
324 }
325 print '</td>'."\n";
326
327 print '<td class="center">';
328 if ($conf->global->FICHEINTER_ADDON == $classname) {
329 print img_picto($langs->trans("Activated"), 'switch_on');
330 } else {
331 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>';
332 }
333 print '</td>';
334
335 $ficheinter = new Fichinter($db);
336 $ficheinter->initAsSpecimen();
337
338 // Info
339 $htmltooltip = '';
340 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
341 $nextval = $module->getNextValue($mysoc, $ficheinter);
342 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
343 $htmltooltip .= ''.$langs->trans("NextValue").': ';
344 if ($nextval) {
345 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
346 $nextval = $langs->trans($nextval);
347 }
348 $htmltooltip .= $nextval.'<br>';
349 } else {
350 $htmltooltip .= $langs->trans($module->error).'<br>';
351 }
352 }
353 print '<td class="center">';
354 print $form->textwithpicto('', $htmltooltip, 1, 0);
355 print '</td>';
356
357 print '</tr>';
358 }
359 }
360 }
361 closedir($handle);
362 }
363 }
364}
365
366print '</table>';
367print '</div>';
368
369print '<br>';
370
371
372/*
373 * Documents models for Interventions
374 */
375
376print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', '');
377
378// Defini tableau def des modeles
379$type = 'ficheinter';
380$def = array();
381$sql = "SELECT nom";
382$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
383$sql .= " WHERE type = '".$db->escape($type)."'";
384$sql .= " AND entity = ".$conf->entity;
385$resql = $db->query($sql);
386if ($resql) {
387 $i = 0;
388 $num_rows = $db->num_rows($resql);
389 while ($i < $num_rows) {
390 $array = $db->fetch_array($resql);
391 if (is_array($array)) {
392 array_push($def, $array[0]);
393 }
394 $i++;
395 }
396} else {
397 dol_print_error($db);
398}
399
400
401print '<div class="div-table-responsive-no-min">';
402print '<table class="noborder centpercent">';
403print '<tr class="liste_titre">';
404print '<td>'.$langs->trans("Name").'</td>';
405print '<td>'.$langs->trans("Description").'</td>';
406print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
407print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
408print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
409print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
410print "</tr>\n";
411
412clearstatcache();
413
414foreach ($dirmodels as $reldir) {
415 $realpath = $reldir."core/modules/fichinter/doc";
416 $dir = dol_buildpath($realpath);
417
418 if (is_dir($dir)) {
419 $handle = opendir($dir);
420 if (is_resource($handle)) {
421 $filelist = array();
422 while (($file = readdir($handle)) !== false) {
423 $filelist[] = $file;
424 }
425 closedir($handle);
426 arsort($filelist);
427
428 foreach ($filelist as $file) {
429 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
430 if (file_exists($dir.'/'.$file)) {
431 $name = substr($file, 4, dol_strlen($file) - 16);
432 $classname = substr($file, 0, dol_strlen($file) - 12);
433
434 require_once $dir.'/'.$file;
435 $module = new $classname($db);
436
437 '@phan-var-force ModelePDFFicheinter $module';
438
439 $modulequalified = 1;
440 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
441 $modulequalified = 0;
442 }
443 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
444 $modulequalified = 0;
445 }
446
447 if ($modulequalified) {
448 print '<tr class="oddeven"><td width="100">';
449 print(empty($module->name) ? $name : $module->name);
450 print "</td><td>\n";
451 if (method_exists($module, 'info')) {
452 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
453 } else {
454 print $module->description;
455 }
456 print '</td>';
457
458 // Active
459 if (in_array($name, $def)) {
460 print "<td align=\"center\">\n";
461 print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
462 print img_picto($langs->trans("Enabled"), 'switch_on');
463 print '</a>';
464 print "</td>";
465 } else {
466 print "<td align=\"center\">\n";
467 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>';
468 print "</td>";
469 }
470
471 // Default
472 print "<td align=\"center\">";
473 if ($conf->global->FICHEINTER_ADDON_PDF == "$name") {
474 print img_picto($langs->trans("Default"), 'on');
475 } else {
476 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>';
477 }
478 print '</td>';
479
480 // Info
481 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
482 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
483 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
484 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
485
486 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
487 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
488 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
489 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
490 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
491 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
492 print '<td class="center">';
493 print $form->textwithpicto('', $htmltooltip, -1, 0);
494 print '</td>';
495
496 // Preview
497 print '<td class="center">';
498 if ($module->type == 'pdf') {
499 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
500 } else {
501 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
502 }
503 print '</td>';
504
505 print '</tr>';
506 }
507 }
508 }
509 }
510 }
511 }
512}
513
514print '</table>';
515print '</div>';
516print "<br>";
517
518/*
519 * Other options
520 */
521
522print load_fiche_titre($langs->trans("OtherOptions"), '', '');
523
524print '<div class="div-table-responsive-no-min">';
525print '<table class="noborder centpercent">';
526print '<tr class="liste_titre">';
527print '<td>'.$langs->trans("Parameter").'</td>';
528print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
529print "<td>&nbsp;</td>\n";
530print "</tr>\n";
531
532$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
533$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
534$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
535foreach ($substitutionarray as $key => $val) {
536 $htmltext .= $key.'<br>';
537}
538$htmltext .= '</i>';
539
540print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
541print '<input type="hidden" name="token" value="'.newToken().'">';
542print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
543print '<tr class="oddeven"><td colspan="2">';
544print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
545$variablename = 'FICHINTER_FREE_TEXT';
546if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
547 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
548} else {
549 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
550 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
551 print $doleditor->Create();
552}
553print '</td><td class="right">';
554print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
555print "</td></tr>\n";
556print '</form>';
557
558//Use draft Watermark
559print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
560print '<input type="hidden" name="token" value="'.newToken().'">';
561print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
562print '<tr class="oddeven"><td>';
563print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
564print '</td><td>';
565print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
566print '</td><td class="right">';
567print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
568print "</td></tr>\n";
569print '</form>';
570// print products on fichinter
571print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
572print '<input type="hidden" name="token" value="'.newToken().'">';
573print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
574print '<tr class="oddeven"><td>';
575print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
576print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
577if (getDolGlobalString("FICHINTER_PRINT_PRODUCTS")) {
578 print 'checked ';
579}
580print '/>';
581print '</td><td class="right">';
582print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
583print "</td></tr>\n";
584print '</form>';
585// Use services duration
586print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
587print '<input type="hidden" name="token" value="'.newToken().'">';
588print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
589print '<tr class="oddeven">';
590print '<td>';
591print $langs->trans("UseServicesDurationOnFichinter");
592print '</td>';
593print '<td class="center">';
594print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"'.(getDolGlobalString("FICHINTER_USE_SERVICE_DURATION") ? ' checked' : '').'>';
595print '</td>';
596print '<td class="right">';
597print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
598print '</td>';
599print '</tr>';
600print '</form>';
601// Use duration
602print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
603print '<input type="hidden" name="token" value="'.newToken().'">';
604print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
605print '<tr class="oddeven">';
606print '<td>';
607print $langs->trans("UseDurationOnFichinter");
608print '</td>';
609print '<td class="center">';
610print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"'.(getDolGlobalString("FICHINTER_WITHOUT_DURATION") ? ' checked' : '').'>';
611print '</td>';
612print '<td class="right">';
613print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
614print '</td>';
615print '</tr>';
616print '</form>';
617// use date without hour
618print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
619print '<input type="hidden" name="token" value="'.newToken().'">';
620print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
621print '<tr class="oddeven">';
622print '<td>';
623print $langs->trans("UseDateWithoutHourOnFichinter");
624print '</td>';
625print '<td class="center">';
626print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"'.(getDolGlobalString("FICHINTER_DATE_WITHOUT_HOUR") ? ' checked' : '').'>';
627print '</td>';
628print '<td class="right">';
629print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
630print '</td>';
631print '</tr>';
632print '</form>';
633// Allow online signing
634print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
635print '<input type="hidden" name="token" value="'.newToken().'">';
636print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_ONLINE_SIGN">';
637print '<tr class="oddeven">';
638print '<td>';
639print $langs->trans("AllowOnlineSign");
640print '</td>';
641print '<td class="center">';
642print '<input type="checkbox" name="FICHINTER_ALLOW_ONLINE_SIGN"'.(getDolGlobalString("FICHINTER_ALLOW_ONLINE_SIGN") ? ' checked' : '').'>';
643print '</td>';
644print '<td class="right">';
645print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
646print '</td>';
647print '</tr>';
648print '</form>';
649// Allow external download
650print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
651print '<input type="hidden" name="token" value="'.newToken().'">';
652print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD">';
653print '<tr class="oddeven">';
654print '<td>';
655print $langs->trans("AllowExternalDownload");
656print '</td>';
657print '<td class="center">';
658print '<input type="checkbox" name="FICHINTER_ALLOW_EXTERNAL_DOWNLOAD"'.(getDolGlobalString("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") ? ' checked' : '').'>';
659print '</td>';
660print '<td class="right">';
661print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
662print '</td>';
663print '</tr>';
664print '</form>';
665
666
667print '</table>';
668print '</div>';
669
670print '<br>';
671
672// End of page
673llxFooter();
674$db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
dolibarr_set_const($db, $name, $value, $type='chaine', $visible=0, $note='', $entity=1)
Insert a parameter (key,value) into database (delete old key then insert it again).
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
delDocumentModel($name, $type)
Delete document model used by doc generator.
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:70
Class to manage a WYSIWYG editor.
Class to manage interventions.
Class to manage generation of HTML components Only common components must be here.
llxFooter()
Footer empty.
Definition document.php:107
fichinter_admin_prepare_head()
Return array head with list of tabs to view object information.
load_fiche_titre($title, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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 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:769
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:142
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.