dolibarr 19.0.4
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 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 3 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program. If not, see <https://www.gnu.org/licenses/>.
23 */
24
31// Load Dolibarr environment
32require '../main.inc.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
35require_once DOL_DOCUMENT_ROOT.'/core/lib/fichinter.lib.php';
36require_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php';
37
38// Load translation files required by the page
39$langs->loadLangs(array('admin', 'errors', 'interventions', 'other'));
40
41if (!$user->admin) {
43}
44
45$action = GETPOST('action', 'aZ09');
46$value = GETPOST('value', 'alpha');
47$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
48
49$label = GETPOST('label', 'alpha');
50$scandir = GETPOST('scan_dir', 'alpha');
51$type = 'ficheinter';
52
53
54/*
55 * Actions
56 */
57
58include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
59
60if ($action == 'updateMask') {
61 $maskconst = GETPOST('maskconst', 'aZ09');
62 $maskvalue = GETPOST('maskvalue', 'alpha');
63 if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
64 $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
65 }
66
67 if (!($res > 0)) {
68 $error++;
69 }
70
71 if (!$error) {
72 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
73 } else {
74 setEventMessages($langs->trans("Error"), null, 'errors');
75 }
76} elseif ($action == 'specimen') { // For fiche inter
77 $modele = GETPOST('module', 'alpha');
78
79 $inter = new Fichinter($db);
80 $inter->initAsSpecimen();
81
82 // Search template files
83 $file = '';
84 $classname = '';
85 $filefound = 0;
86 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
87 foreach ($dirmodels as $reldir) {
88 $file = dol_buildpath($reldir."core/modules/fichinter/doc/pdf_".$modele.".modules.php", 0);
89 if (file_exists($file)) {
90 $filefound = 1;
91 $classname = "pdf_".$modele;
92 break;
93 }
94 }
95
96 if ($filefound) {
97 require_once $file;
98
99 $module = new $classname($db);
100
101 if ($module->write_file($inter, $langs) > 0) {
102 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=ficheinter&file=SPECIMEN.pdf");
103 return;
104 } else {
105 setEventMessages($module->error, $module->errors, 'errors');
106 dol_syslog($module->error, LOG_ERR);
107 }
108 } else {
109 setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
110 dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
111 }
112} elseif ($action == 'set') {
113 // Activate a model
114 $ret = addDocumentModel($value, $type, $label, $scandir);
115} elseif ($action == 'del') {
116 $ret = delDocumentModel($value, $type);
117 if ($ret > 0) {
118 if ($conf->global->FICHEINTER_ADDON_PDF == "$value") {
119 dolibarr_del_const($db, 'FICHEINTER_ADDON_PDF', $conf->entity);
120 }
121 }
122} elseif ($action == 'setdoc') {
123 // Set default model
124 if (dolibarr_set_const($db, "FICHEINTER_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
125 // La constante qui a ete lue en avant du nouveau set
126 // on passe donc par une variable pour avoir un affichage coherent
127 $conf->global->FICHEINTER_ADDON_PDF = $value;
128 }
129
130 // On active le modele
131 $ret = delDocumentModel($value, $type);
132 if ($ret > 0) {
133 $ret = addDocumentModel($value, $type, $label, $scandir);
134 }
135} elseif ($action == 'setmod') {
136 // TODO Verifier si module numerotation choisi peut etre active
137 // par appel methode canBeActivated
138
139 dolibarr_set_const($db, "FICHEINTER_ADDON", $value, 'chaine', 0, '', $conf->entity);
140} elseif ($action == 'set_FICHINTER_FREE_TEXT') {
141 $freetext = GETPOST('FICHINTER_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
142 $res = dolibarr_set_const($db, "FICHINTER_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
143
144 if (!($res > 0)) {
145 $error++;
146 }
147
148 if (!$error) {
149 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
150 } else {
151 setEventMessages($langs->trans("Error"), null, 'errors');
152 }
153} elseif ($action == 'set_FICHINTER_DRAFT_WATERMARK') {
154 $draft = GETPOST('FICHINTER_DRAFT_WATERMARK', 'alpha');
155 $res = dolibarr_set_const($db, "FICHINTER_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
156
157 if (!($res > 0)) {
158 $error++;
159 }
160
161 if (!$error) {
162 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
163 } else {
164 setEventMessages($langs->trans("Error"), null, 'errors');
165 }
166} elseif ($action == 'set_FICHINTER_PRINT_PRODUCTS') {
167 $val = GETPOST('FICHINTER_PRINT_PRODUCTS', 'alpha');
168 $res = dolibarr_set_const($db, "FICHINTER_PRINT_PRODUCTS", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
169
170 if (!($res > 0)) {
171 $error++;
172 }
173
174 if (!$error) {
175 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
176 } else {
177 setEventMessages($langs->trans("Error"), null, 'errors');
178 }
179} elseif ($action == 'set_FICHINTER_USE_SERVICE_DURATION') {
180 $val = GETPOST('FICHINTER_USE_SERVICE_DURATION', 'alpha');
181 $res = dolibarr_set_const($db, "FICHINTER_USE_SERVICE_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
182
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, 'errors');
191 }
192} elseif ($action == 'set_FICHINTER_WITHOUT_DURATION') {
193 $val = GETPOST('FICHINTER_WITHOUT_DURATION', 'alpha');
194 $res = dolibarr_set_const($db, "FICHINTER_WITHOUT_DURATION", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
195
196 if (!($res > 0)) {
197 $error++;
198 }
199
200 if (!$error) {
201 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
202 } else {
203 setEventMessages($langs->trans("Error"), null, 'errors');
204 }
205} elseif ($action == 'set_FICHINTER_DATE_WITHOUT_HOUR') {
206 $val = GETPOST('FICHINTER_DATE_WITHOUT_HOUR', 'alpha');
207 $res = dolibarr_set_const($db, "FICHINTER_DATE_WITHOUT_HOUR", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
208
209 if (!($res > 0)) {
210 $error++;
211 }
212
213 if (!$error) {
214 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
215 } else {
216 setEventMessages($langs->trans("Error"), null, 'errors');
217 }
218} elseif ($action == "set_FICHINTER_ALLOW_ONLINE_SIGN") {
219 $val = GETPOST('FICHINTER_ALLOW_ONLINE_SIGN', 'alpha');
220 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_ONLINE_SIGN", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
221
222 if (!($res > 0)) {
223 $error++;
224 }
225
226 if (!$error) {
227 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
228 } else {
229 setEventMessages($langs->trans("Error"), null, 'errors');
230 }
231} elseif ($action == "set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") {
232 $val = GETPOST('FICHINTER_ALLOW_EXTERNAL_DOWNLOAD', 'alpha');
233 $res = dolibarr_set_const($db, "FICHINTER_ALLOW_EXTERNAL_DOWNLOAD", ($val == 'on' ? 1 : 0), 'bool', 0, '', $conf->entity);
234
235 if (!($res > 0)) {
236 $error++;
237 }
238
239 if (!$error) {
240 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
241 } else {
242 setEventMessages($langs->trans("Error"), null, 'errors');
243 }
244}
245
246
247
248/*
249 * View
250 */
251
252$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
253
254llxHeader();
255
256$form = new Form($db);
257
258$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
259print load_fiche_titre($langs->trans("InterventionsSetup"), $linkback, 'title_setup');
260
261
263
264print dol_get_fiche_head($head, 'ficheinter', $langs->trans("Interventions"), -1, 'intervention');
265
266// Interventions numbering model
267
268print load_fiche_titre($langs->trans("FicheinterNumberingModules"), '', '');
269
270print '<div class="div-table-responsive-no-min">';
271print '<table class="noborder centpercent">';
272print '<tr class="liste_titre">';
273print '<td width="100">'.$langs->trans("Name").'</td>';
274print '<td>'.$langs->trans("Description").'</td>';
275print '<td>'.$langs->trans("Example").'</td>';
276print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
277print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
278print "</tr>\n";
279
280clearstatcache();
281
282foreach ($dirmodels as $reldir) {
283 $dir = dol_buildpath($reldir."core/modules/fichinter/");
284
285 if (is_dir($dir)) {
286 $handle = opendir($dir);
287 if (is_resource($handle)) {
288 while (($file = readdir($handle)) !== false) {
289 if (preg_match('/^(mod_.*)\.php$/i', $file, $reg)) {
290 $file = $reg[1];
291 $classname = substr($file, 4);
292
293 require_once $dir.$file.'.php';
294
295 $module = new $file();
296
297 if ($module->isEnabled()) {
298 // Show modules according to features level
299 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
300 continue;
301 }
302 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
303 continue;
304 }
305
306
307 print '<tr class="oddeven"><td>'.$module->nom."</td><td>\n";
308 print $module->info($langs);
309 print '</td>';
310
311 // Show example of numbering model
312 print '<td class="nowrap">';
313 $tmp = $module->getExample();
314 if (preg_match('/^Error/', $tmp)) {
315 $langs->load("errors");
316 print '<div class="error">'.$langs->trans($tmp).'</div>';
317 } elseif ($tmp == 'NotConfigured') {
318 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
319 } else {
320 print $tmp;
321 }
322 print '</td>'."\n";
323
324 print '<td class="center">';
325 if ($conf->global->FICHEINTER_ADDON == $classname) {
326 print img_picto($langs->trans("Activated"), 'switch_on');
327 } else {
328 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>';
329 }
330 print '</td>';
331
332 $ficheinter = new Fichinter($db);
333 $ficheinter->initAsSpecimen();
334
335 // Info
336 $htmltooltip = '';
337 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
338 $nextval = $module->getNextValue($mysoc, $ficheinter);
339 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
340 $htmltooltip .= ''.$langs->trans("NextValue").': ';
341 if ($nextval) {
342 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
343 $nextval = $langs->trans($nextval);
344 }
345 $htmltooltip .= $nextval.'<br>';
346 } else {
347 $htmltooltip .= $langs->trans($module->error).'<br>';
348 }
349 }
350 print '<td class="center">';
351 print $form->textwithpicto('', $htmltooltip, 1, 0);
352 print '</td>';
353
354 print '</tr>';
355 }
356 }
357 }
358 closedir($handle);
359 }
360 }
361}
362
363print '</table>';
364print '</div>';
365
366print '<br>';
367
368
369/*
370 * Documents models for Interventions
371 */
372
373print load_fiche_titre($langs->trans("TemplatePDFInterventions"), '', '');
374
375// Defini tableau def des modeles
376$type = 'ficheinter';
377$def = array();
378$sql = "SELECT nom";
379$sql .= " FROM ".MAIN_DB_PREFIX."document_model";
380$sql .= " WHERE type = '".$db->escape($type)."'";
381$sql .= " AND entity = ".$conf->entity;
382$resql = $db->query($sql);
383if ($resql) {
384 $i = 0;
385 $num_rows = $db->num_rows($resql);
386 while ($i < $num_rows) {
387 $array = $db->fetch_array($resql);
388 array_push($def, $array[0]);
389 $i++;
390 }
391} else {
392 dol_print_error($db);
393}
394
395
396print '<div class="div-table-responsive-no-min">';
397print '<table class="noborder centpercent">';
398print '<tr class="liste_titre">';
399print '<td>'.$langs->trans("Name").'</td>';
400print '<td>'.$langs->trans("Description").'</td>';
401print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
402print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
403print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
404print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
405print "</tr>\n";
406
407clearstatcache();
408
409foreach ($dirmodels as $reldir) {
410 $realpath = $reldir."core/modules/fichinter/doc";
411 $dir = dol_buildpath($realpath);
412
413 if (is_dir($dir)) {
414 $handle = opendir($dir);
415 if (is_resource($handle)) {
416 while (($file = readdir($handle)) !== false) {
417 $filelist[] = $file;
418 }
419 closedir($handle);
420 arsort($filelist);
421
422 foreach ($filelist as $file) {
423 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
424 if (file_exists($dir.'/'.$file)) {
425 $name = substr($file, 4, dol_strlen($file) - 16);
426 $classname = substr($file, 0, dol_strlen($file) - 12);
427
428 require_once $dir.'/'.$file;
429 $module = new $classname($db);
430
431 $modulequalified = 1;
432 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
433 $modulequalified = 0;
434 }
435 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
436 $modulequalified = 0;
437 }
438
439 if ($modulequalified) {
440 print '<tr class="oddeven"><td width="100">';
441 print(empty($module->name) ? $name : $module->name);
442 print "</td><td>\n";
443 if (method_exists($module, 'info')) {
444 print $module->info($langs);
445 } else {
446 print $module->description;
447 }
448 print '</td>';
449
450 // Active
451 if (in_array($name, $def)) {
452 print "<td align=\"center\">\n";
453 print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'">';
454 print img_picto($langs->trans("Enabled"), 'switch_on');
455 print '</a>';
456 print "</td>";
457 } else {
458 print "<td align=\"center\">\n";
459 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>';
460 print "</td>";
461 }
462
463 // Default
464 print "<td align=\"center\">";
465 if ($conf->global->FICHEINTER_ADDON_PDF == "$name") {
466 print img_picto($langs->trans("Default"), 'on');
467 } else {
468 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>';
469 }
470 print '</td>';
471
472 // Info
473 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
474 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
475 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
476 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
477
478 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
479 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
480 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
481 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
482 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
483 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
484 print '<td class="center">';
485 print $form->textwithpicto('', $htmltooltip, -1, 0);
486 print '</td>';
487
488 // Preview
489 print '<td class="center">';
490 if ($module->type == 'pdf') {
491 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
492 } else {
493 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
494 }
495 print '</td>';
496
497 print '</tr>';
498 }
499 }
500 }
501 }
502 }
503 }
504}
505
506print '</table>';
507print '</div>';
508print "<br>";
509
510/*
511 * Other options
512 */
513
514print load_fiche_titre($langs->trans("OtherOptions"), '', '');
515
516print '<div class="div-table-responsive-no-min">';
517print '<table class="noborder centpercent">';
518print '<tr class="liste_titre">';
519print '<td>'.$langs->trans("Parameter").'</td>';
520print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
521print "<td>&nbsp;</td>\n";
522print "</tr>\n";
523
524$substitutionarray = pdf_getSubstitutionArray($langs, null, null, 2);
525$substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
526$htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
527foreach ($substitutionarray as $key => $val) {
528 $htmltext .= $key.'<br>';
529}
530$htmltext .= '</i>';
531
532print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
533print '<input type="hidden" name="token" value="'.newToken().'">';
534print '<input type="hidden" name="action" value="set_FICHINTER_FREE_TEXT">';
535print '<tr class="oddeven"><td colspan="2">';
536print $form->textwithpicto($langs->trans("FreeLegalTextOnInterventions"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'freetexttooltip').'<br>';
537$variablename = 'FICHINTER_FREE_TEXT';
538if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
539 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
540} else {
541 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
542 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
543 print $doleditor->Create();
544}
545print '</td><td class="right">';
546print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
547print "</td></tr>\n";
548print '</form>';
549
550//Use draft Watermark
551print "<form method=\"post\" action=\"".$_SERVER["PHP_SELF"]."\">";
552print '<input type="hidden" name="token" value="'.newToken().'">';
553print "<input type=\"hidden\" name=\"action\" value=\"set_FICHINTER_DRAFT_WATERMARK\">";
554print '<tr class="oddeven"><td>';
555print $form->textwithpicto($langs->trans("WatermarkOnDraftInterventionCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
556print '</td><td>';
557print '<input class="flat minwidth200" type="text" name="FICHINTER_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('FICHINTER_DRAFT_WATERMARK')).'">';
558print '</td><td class="right">';
559print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
560print "</td></tr>\n";
561print '</form>';
562// print products on fichinter
563print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
564print '<input type="hidden" name="token" value="'.newToken().'">';
565print '<input type="hidden" name="action" value="set_FICHINTER_PRINT_PRODUCTS">';
566print '<tr class="oddeven"><td>';
567print $langs->trans("PrintProductsOnFichinter").' ('.$langs->trans("PrintProductsOnFichinterDetails").')</td>';
568print '<td align="center"><input type="checkbox" name="FICHINTER_PRINT_PRODUCTS" ';
569if (getDolGlobalString("FICHINTER_PRINT_PRODUCTS")) {
570 print 'checked ';
571}
572print '/>';
573print '</td><td class="right">';
574print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
575print "</td></tr>\n";
576print '</form>';
577// Use services duration
578print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
579print '<input type="hidden" name="token" value="'.newToken().'">';
580print '<input type="hidden" name="action" value="set_FICHINTER_USE_SERVICE_DURATION">';
581print '<tr class="oddeven">';
582print '<td>';
583print $langs->trans("UseServicesDurationOnFichinter");
584print '</td>';
585print '<td class="center">';
586print '<input type="checkbox" name="FICHINTER_USE_SERVICE_DURATION"'.(getDolGlobalString("FICHINTER_USE_SERVICE_DURATION") ? ' checked' : '').'>';
587print '</td>';
588print '<td class="right">';
589print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
590print '</td>';
591print '</tr>';
592print '</form>';
593// Use duration
594print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
595print '<input type="hidden" name="token" value="'.newToken().'">';
596print '<input type="hidden" name="action" value="set_FICHINTER_WITHOUT_DURATION">';
597print '<tr class="oddeven">';
598print '<td>';
599print $langs->trans("UseDurationOnFichinter");
600print '</td>';
601print '<td class="center">';
602print '<input type="checkbox" name="FICHINTER_WITHOUT_DURATION"'.(getDolGlobalString("FICHINTER_WITHOUT_DURATION") ? ' checked' : '').'>';
603print '</td>';
604print '<td class="right">';
605print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
606print '</td>';
607print '</tr>';
608print '</form>';
609// use date without hour
610print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
611print '<input type="hidden" name="token" value="'.newToken().'">';
612print '<input type="hidden" name="action" value="set_FICHINTER_DATE_WITHOUT_HOUR">';
613print '<tr class="oddeven">';
614print '<td>';
615print $langs->trans("UseDateWithoutHourOnFichinter");
616print '</td>';
617print '<td class="center">';
618print '<input type="checkbox" name="FICHINTER_DATE_WITHOUT_HOUR"'.(getDolGlobalString("FICHINTER_DATE_WITHOUT_HOUR") ? ' checked' : '').'>';
619print '</td>';
620print '<td class="right">';
621print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
622print '</td>';
623print '</tr>';
624print '</form>';
625// Allow online signing
626print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
627print '<input type="hidden" name="token" value="'.newToken().'">';
628print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_ONLINE_SIGN">';
629print '<tr class="oddeven">';
630print '<td>';
631print $langs->trans("AllowOnlineSign");
632print '</td>';
633print '<td class="center">';
634print '<input type="checkbox" name="FICHINTER_ALLOW_ONLINE_SIGN"'.(getDolGlobalString("FICHINTER_ALLOW_ONLINE_SIGN") ? ' checked' : '').'>';
635print '</td>';
636print '<td class="right">';
637print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
638print '</td>';
639print '</tr>';
640print '</form>';
641// Allow external download
642print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
643print '<input type="hidden" name="token" value="'.newToken().'">';
644print '<input type="hidden" name="action" value="set_FICHINTER_ALLOW_EXTERNAL_DOWNLOAD">';
645print '<tr class="oddeven">';
646print '<td>';
647print $langs->trans("AllowExternalDownload");
648print '</td>';
649print '<td class="center">';
650print '<input type="checkbox" name="FICHINTER_ALLOW_EXTERNAL_DOWNLOAD"'.(getDolGlobalString("FICHINTER_ALLOW_EXTERNAL_DOWNLOAD") ? ' checked' : '').'>';
651print '</td>';
652print '<td class="right">';
653print '<input type="submit" class="button button-edit" value="'.$langs->trans("Modify").'">';
654print '</td>';
655print '</tr>';
656print '</form>';
657
658
659print '</table>';
660print '</div>';
661
662print '<br>';
663
664// End of page
665llxFooter();
666$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 informations.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
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_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
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:762
$conf db name
Only used if Module[ID]Name translation string is not found.
Definition repair.php:124
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.