dolibarr 21.0.0-beta
fichinter.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2003-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2004 Sebastien Di Cintio <sdicintio@ressource-toi.org>
5 * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be>
6 * Copyright (C) 2005-2014 Regis Houssin <regis.houssin@inodbox.com>
7 * Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr>
8 * Copyright (C) 2011-2013 Juanjo Menent <jmenent@2byte.es>
9 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
10 * Copyright (C) 2024 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
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 ($conf->global->FICHEINTER_ADDON_PDF == "$value") {
133 dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity);
134 }
135 }
136} elseif ($action == 'setdoc') {
137 // Set default model
138 if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
139 // La constante qui a ete lue en avant du nouveau set
140 // on passe donc par une variable pour avoir un affichage coherent
141 $conf->global->FICHEINTER_ADDON_PDF = $value;
142 }
143
144 // On active le modele
145 $ret = delDocumentModel($value, $type);
146 if ($ret > 0) {
147 $ret = addDocumentModel($value, $type, $label, $scandir);
148 }
149} elseif ($action == 'setmod') {
150 // TODO Verify if the chosen numbering module can be activated
151 // by calling method canBeActivated
152
153 dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
154} elseif ($action == 'set_FICHINTER_FREE_TEXT') {
155 $freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
156 $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
157
158 if (!($res > 0)) {
159 $error++;
160 }
161
162 if (!$error) {
163 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
164 } else {
165 setEventMessages($langs->trans("Error"), null, 'errors');
166 }
167} elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') {
168 $draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
169 $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
170
171 if (!($res > 0)) {
172 $error++;
173 }
174
175 if (!$error) {
176 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
177 } else {
178 setEventMessages($langs->trans("Error"), null, 'errors');
179 }
180} elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') {
181 $val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha');
182 $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($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_USE_SERVICE_DURATION') {
194 $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
195 $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_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_WITHOUT_DURATION') {
207 $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
208 $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($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_DATE_WITHOUT_HOUR') {
220 $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
221 $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($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_ONLINE_SIGN") {
233 $val = GETPOST('FICHINTER_ALLOW_ONLINE_SIGN', 'alpha');
234 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", ($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} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") {
246 $val = GETPOST('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD', 'alpha');
247 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
248
249 if (!($res > 0)) {
250 $error++;
251 }
252
253 if (!$error) {
254 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
255 } else {
256 setEventMessages($langs->trans("Error"), null, 'errors');
257 }
258}
259
260
261
262/*
263 * View
264 */
265
266$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
267
268llxHeader('', '', '', '', 0, 0, '', '', '', 'mod-admin page-fichinter');
269
270$form = new Form($db);
271
272$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
273print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup');
274
275
277
278print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
279
280// Interventions numbering model
281
282print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
283
284print '<div class="div-table-responsive-no-min">';
285print '<table class="noborder centpercent">';
286print '<tr class="liste_titre">';
287print '<td width="100">'.$langs->trans("Name").'</td>';
288print '<td>'.$langs->trans("Description").'</td>';
289print '<td>'.$langs->trans("Example").'</td>';
290print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
291print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
292print "</tr>\n";
293
294clearstatcache();
295
296foreach ($dirmodels as $reldir) {
297 $dir = dol_buildpath($reldir."core/modules/fichinter/");
298
299 if (is_dir($dir)) {
300 $handle = opendir($dir);
301 if (is_resource($handle)) {
302 while (($file = readdir($handle)) !== false) {
303 if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) {
304 $file = $reg[1];
305 $classname = substr($file, 4);
306
307 require_once $dir.$file.'.php';
308
309 $module = new $file();
310
311 '@phan-var-force ModeleNumRefFicheinter $module';
312
313 if ($module->isEnabled()) {
314 // Show modules according to features level
315 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
316 continue;
317 }
318 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
319 continue;
320 }
321
322
323 print '<tr class="oddeven"><td>'.$module->getName($langs)."</td><td>\n";
324 print $module->info($langs);
325 print '</td>';
326
327 // Show example of numbering model
328 print '<td class="nowrap">';
329 $tmp = $module->getExample();
330 if (preg_match('/^Error/', $tmp)) {
331 $langs->load("errors");
332 print '<div class="error">'.$langs->trans($tmp).'</div>';
333 } elseif ($tmp == 'NotConfigured') {
334 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
335 } else {
336 print $tmp;
337 }
338 print '</td>'."\n";
339
340 print '<td class="center">';
341 if ($conf->global->FICHEINTER_ADDON == $classname) {
342 print img_picto($langs->trans("Activated"), 'switch_on');
343 } else {
344 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>';
345 }
346 print '</td>';
347
348 $ficheinter = new Fichinter($db);
349 $ficheinter->initAsSpecimen();
350
351 // Info
352 $htmltooltip = '';
353 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
354 $nextval = $module->getNextValue($mysoc, $ficheinter);
355 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
356 $htmltooltip .= ''.$langs->trans("NextValue").': ';
357 if ($nextval) {
358 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
359 $nextval = $langs->trans($nextval);
360 }
361 $htmltooltip .= $nextval.'<br>';
362 } else {
363 $htmltooltip .= $langs->trans($module->error).'<br>';
364 }
365 }
366 print '<td class="center">';
367 print $form->textwithpicto('', $htmltooltip, 1, 0);
368 print '</td>';
369
370 print '</tr>';
371 }
372 }
373 }
374 closedir($handle);
375 }
376 }
377}
378
379print '</table>';
380print '</div>';
381
382print '<br>';
383
384
385/*
386 * Documents models for Interventions
387 */
388
389print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', '');
390
391// Defini tableau def des modeles
392$type = 'ficheinter';
393$def = array();
394$sql = "SELECT nom";
395$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
396$sql .= " WHERE type = '".$db->escape($type)."'";
397$sql .= " AND entity = ".$conf->entity;
398$resql = $db->query($sql);
399if ($resql) {
400 $i = 0;
401 $num_rows = $db->num_rows($resql);
402 while ($i < $num_rows) {
403 $array = $db->fetch_array($resql);
404 if (is_array($array)) {
405 array_push($def, $array[0]);
406 }
407 $i++;
408 }
409} else {
410 dol_print_error($db);
411}
412
413
414print '<div class="div-table-responsive-no-min">';
415print '<table class="noborder centpercent">';
416print '<tr class="liste_titre">';
417print '<td>'.$langs->trans("Name").'</td>';
418print '<td>'.$langs->trans("Description").'</td>';
419print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
420print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
421print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
422print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
423print "</tr>\n";
424
425clearstatcache();
426
427foreach ($dirmodels as $reldir) {
428 $realpath = $reldir."core/modules/fichinter/doc";
429 $dir = dol_buildpath($realpath);
430
431 if (is_dir($dir)) {
432 $handle = opendir($dir);
433 if (is_resource($handle)) {
434 $filelist = array();
435 while (($file = readdir($handle)) !== false) {
436 $filelist[] = $file;
437 }
438 closedir($handle);
439 arsort($filelist);
440
441 foreach ($filelist as $file) {
442 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
443 if (file_exists($dir.'/'.$file)) {
444 $name = substr($file, 4, dol_strlen($file) - 16);
445 $classname = substr($file, 0, dol_strlen($file) - 12);
446
447 require_once $dir.'/'.$file;
448 $module = new $classname($db);
449
450 '@phan-var-force ModelePDFFicheinter $module';
451
452 $modulequalified = 1;
453 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
454 $modulequalified = 0;
455 }
456 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
457 $modulequalified = 0;
458 }
459
460 if ($modulequalified) {
461 print '<tr class="oddeven"><td width="100">';
462 print(empty($module->name) ? $name : $module->name);
463 print "</td><td>\n";
464 if (method_exists($module, 'info')) {
465 print $module->info($langs); // @phan-suppress-current-line PhanUndeclaredMethod
466 } else {
467 print $module->description;
468 }
469 print '</td>';
470
471 // Active
472 if (in_array($name, $def)) {
473 print "<td align=\"center\">\n";
474 print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
475 print img_picto($langs->trans("Enabled"), 'switch_on');
476 print '</a>';
477 print "</td>";
478 } else {
479 print "<td align=\"center\">\n";
480 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>';
481 print "</td>";
482 }
483
484 // Default
485 print "<td align=\"center\">";
486 if ($conf->global->FICHEINTER_ADDON_PDF == "$name") {
487 print img_picto($langs->trans("Default"), 'on');
488 } else {
489 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>';
490 }
491 print '</td>';
492
493 // Info
494 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
495 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
496 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
497 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
498
499 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
500 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
501 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
502 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
503 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
504 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
505 print '<td class="center">';
506 print $form->textwithpicto('', $htmltooltip, -1, 0);
507 print '</td>';
508
509 // Preview
510 print '<td class="center">';
511 if ($module->type == 'pdf') {
512 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
513 } else {
514 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
515 }
516 print '</td>';
517
518 print '</tr>';
519 }
520 }
521 }
522 }
523 }
524 }
525}
526
527print '</table>';
528print '</div>';
529print "<br>";
530
531/*
532 * Other options
533 */
534
535print load_fiche_titre($langs->trans("OtherOptions"), '', '');
536
537print '<div class="div-table-responsive-no-min">';
538print '<table class="noborder centpercent">';
539print '<tr class="liste_titre">';
540print '<td>'.$langs->trans("Parameter").'</td>';
541print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
542print "<td>&nbsp;</td>\n";
543print "</tr>\n";
544
545$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
546$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
547$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
548foreach ($substitutionarray as $key => $val) {
549 $htmltext .= $key.'<br>';
550}
551$htmltext .= '</i>';
552
553print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
554print '<input type="hidden" name="token" value="'.newToken().'">';
555print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
556print '<tr class="oddeven"><td colspan="2">';
557print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
558$variablename = 'FICHINTER_FREE_TEXT';
559if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
560 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
561} else {
562 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
563 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
564 print $doleditor->Create();
565}
566print '</td><td class="right">';
567print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
568print "</td></tr>\n";
569print '</form>';
570
571//Use draft Watermark
572print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
573print '<input type="hidden" name="token" value="'.newToken().'">';
574print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
575print '<tr class="oddeven"><td>';
576print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
577print '</td><td>';
578print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
579print '</td><td class="right">';
580print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
581print "</td></tr>\n";
582print '</form>';
583// print products on fichinter
584print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
585print '<input type="hidden" name="token" value="'.newToken().'">';
586print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
587print '<tr class="oddeven"><td>';
588print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
589print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
590if (getDolGlobalString("FICHINTER_PRINT_PRODUCTS")) {
591 print 'checked ';
592}
593print '/>';
594print '</td><td class="right">';
595print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
596print "</td></tr>\n";
597print '</form>';
598// Use services duration
599print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
600print '<input type="hidden" name="token" value="'.newToken().'">';
601print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
602print '<tr class="oddeven">';
603print '<td>';
604print $langs->trans("UseServicesDurationOnFichinter");
605print '</td>';
606print '<td class="center">';
607print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"'.(getDolGlobalString("FICHINTER_USE_SERVICE_DURATION") ? ' checked' : '').'>';
608print '</td>';
609print '<td class="right">';
610print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
611print '</td>';
612print '</tr>';
613print '</form>';
614// Use duration
615print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
616print '<input type="hidden" name="token" value="'.newToken().'">';
617print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
618print '<tr class="oddeven">';
619print '<td>';
620print $langs->trans("UseDurationOnFichinter");
621print '</td>';
622print '<td class="center">';
623print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"'.(getDolGlobalString("FICHINTER_WITHOUT_DURATION") ? ' checked' : '').'>';
624print '</td>';
625print '<td class="right">';
626print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
627print '</td>';
628print '</tr>';
629print '</form>';
630// use date without hour
631print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
632print '<input type="hidden" name="token" value="'.newToken().'">';
633print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
634print '<tr class="oddeven">';
635print '<td>';
636print $langs->trans("UseDateWithoutHourOnFichinter");
637print '</td>';
638print '<td class="center">';
639print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"'.(getDolGlobalString("FICHINTER_DATE_WITHOUT_HOUR") ? ' checked' : '').'>';
640print '</td>';
641print '<td class="right">';
642print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
643print '</td>';
644print '</tr>';
645print '</form>';
646// Allow online signing
647print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
648print '<input type="hidden" name="token" value="'.newToken().'">';
649print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_ONLINE_SIGN">';
650print '<tr class="oddeven">';
651print '<td>';
652print $langs->trans("AllowOnlineSign");
653print '</td>';
654print '<td class="center">';
655print '<input type="checkbox" name="FICHINTER_ALLOW_ONLINE_SIGN"'.(getDolGlobalString("FICHINTER_ALLOW_ONLINE_SIGN") ? ' checked' : '').'>';
656print '</td>';
657print '<td class="right">';
658print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
659print '</td>';
660print '</tr>';
661print '</form>';
662// Allow external download
663print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
664print '<input type="hidden" name="token" value="'.newToken().'">';
665print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD">';
666print '<tr class="oddeven">';
667print '<td>';
668print $langs->trans("AllowExternalDownload");
669print '</td>';
670print '<td class="center">';
671print '<input type="checkbox" name="FICHINTER_ALLOW_EXTERNAL_DOWNLOAD"'.(getDolGlobalString("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") ? ' checked' : '').'>';
672print '</td>';
673print '<td class="right">';
674print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
675print '</td>';
676print '</tr>';
677print '</form>';
678
679
680print '</table>';
681print '</div>';
682
683print '<br>';
684
685// End of page
686llxFooter();
687$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:71
Class to manage a WYSIWYG editor.
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)
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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'.
yn($yesno, $format=1, $color=0)
Return yes or no in current language.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
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:765
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:152
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.