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