dolibarr 19.0.3
holiday.php
1<?php
2/* Copyright (C) 2011-2019 Juanjo Menent <jmenent@2byte.es>
3 * Copyright (C) 2011-2018 Philippe Grand <philippe.grand@atoo-net.com>
4 * Copyright (C) 2018 Charlene Benke <charlie@patas-monkey.com>
5 * Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/lib/pdf.lib.php';
31require_once DOL_DOCUMENT_ROOT.'/holiday/class/holiday.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/holiday.lib.php';
33
34// Load translation files required by the page
35$langs->loadLangs(array("admin", "errors", "holiday"));
36
37if (!$user->admin) {
39}
40
41$action = GETPOST('action', 'aZ09');
42$value = GETPOST('value', 'alpha');
43$modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
44
45$label = GETPOST('label', 'alpha');
46$scandir = GETPOST('scan_dir', 'alpha');
47$type = 'contract';
48
49if (!getDolGlobalString('HOLIDAY_ADDON')) {
50 $conf->global->HOLIDAY_ADDON = 'mod_holiday_madonna';
51}
52
53
54/*
55 * Actions
56 */
57
58include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
59
60if ($action == 'updateMask') {
61 $maskconst = GETPOST('maskconstholiday', 'aZ09');
62 $maskvalue = GETPOST('maskholiday', '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 contract
77 $modele = GETPOST('module', 'alpha');
78
79 $holiday = new Holiday($db);
80 $holiday->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/holiday/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($holiday, $langs) > 0) {
102 header("Location: ".DOL_URL_ROOT."/document.php?modulepart=holiday&file=SPECIMEN.pdf");
103 return;
104 } else {
105 setEventMessages($obj->error, $obj->errors, 'errors');
106 dol_syslog($obj->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->HOLIDAY_ADDON_PDF == "$value") {
119 dolibarr_del_const($db, 'HOLIDAY_ADDON_PDF', $conf->entity);
120 }
121 }
122} elseif ($action == 'setdoc') {
123 // Set default model
124 if (dolibarr_set_const($db, "HOLIDAY_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->HOLIDAY_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, "HOLIDAY_ADDON", $value, 'chaine', 0, '', $conf->entity);
140} elseif ($action == 'set_other') {
141 $freetext = GETPOST('HOLIDAY_FREE_TEXT', 'restricthtml'); // No alpha here, we want exact string
142 $res1 = dolibarr_set_const($db, "HOLIDAY_FREE_TEXT", $freetext, 'chaine', 0, '', $conf->entity);
143
144 $draft = GETPOST('HOLIDAY_DRAFT_WATERMARK', 'alpha');
145 $res2 = dolibarr_set_const($db, "HOLIDAY_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
146
147 if (!($res1 > 0) || !($res2 > 0)) {
148 $error++;
149 }
150
151 if (!$error) {
152 setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
153 } else {
154 setEventMessages($langs->trans("Error"), null, 'errors');
155 }
156}
157
158
159/*
160 * View
161 */
162
163$dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
164
165llxHeader();
166
167$form = new Form($db);
168
169$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php">'.$langs->trans("BackToModuleList").'</a>';
170print load_fiche_titre($langs->trans("HolidaySetup"), $linkback, 'title_setup');
171
173
174print dol_get_fiche_head($head, 'holiday', $langs->trans("Holidays"), -1, 'holiday');
175
176/*
177 * Holiday Numbering model
178 */
179
180print load_fiche_titre($langs->trans("HolidaysNumberingModules"), '', '');
181
182print '<div class="div-table-responsive-no-min">';
183print '<table class="noborder centpercent">';
184print '<tr class="liste_titre">';
185print '<td width="100">'.$langs->trans("Name").'</td>';
186print '<td>'.$langs->trans("Description").'</td>';
187print '<td>'.$langs->trans("Example").'</td>';
188print '<td align="center" width="60">'.$langs->trans("Status").'</td>';
189print '<td align="center" width="16">'.$langs->trans("ShortInfo").'</td>';
190print "</tr>\n";
191
192clearstatcache();
193
194foreach ($dirmodels as $reldir) {
195 $dir = dol_buildpath($reldir."core/modules/holiday/");
196
197 if (is_dir($dir)) {
198 $handle = opendir($dir);
199 if (is_resource($handle)) {
200 while (($file = readdir($handle)) !== false) {
201 if (substr($file, 0, 12) == 'mod_holiday_' && substr($file, dol_strlen($file) - 3, 3) == 'php') {
202 $file = substr($file, 0, dol_strlen($file) - 4);
203
204 require_once $dir.$file.'.php';
205
206 $module = new $file($db);
207
208 // Show modules according to features level
209 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
210 continue;
211 }
212 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
213 continue;
214 }
215
216 if ($module->isEnabled()) {
217 print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
218 print $module->info($langs);
219 print '</td>';
220
221 // Show example of numbering model
222 print '<td class="nowrap">';
223 $tmp = $module->getExample();
224 if (preg_match('/^Error/', $tmp)) {
225 $langs->load("errors");
226 print '<div class="error">'.$langs->trans($tmp).'</div>';
227 } elseif ($tmp == 'NotConfigured') {
228 print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
229 } else {
230 print $tmp;
231 }
232 print '</td>'."\n";
233
234 print '<td class="center">';
235 if ($conf->global->HOLIDAY_ADDON == "$file") {
236 print img_picto($langs->trans("Activated"), 'switch_on');
237 } else {
238 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&value='.urlencode($file).'">';
239 print img_picto($langs->trans("Disabled"), 'switch_off');
240 print '</a>';
241 }
242 print '</td>';
243
244 $holiday = new Holiday($db);
245 $holiday->initAsSpecimen();
246
247 // Info
248 $htmltooltip = '';
249 $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
250 $nextval = $module->getNextValue($mysoc, $holiday);
251 if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
252 $htmltooltip .= ''.$langs->trans("NextValue").': ';
253 if ($nextval) {
254 if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
255 $nextval = $langs->trans($nextval);
256 }
257 $htmltooltip .= $nextval.'<br>';
258 } else {
259 $htmltooltip .= $langs->trans($module->error).'<br>';
260 }
261 }
262
263 print '<td class="center">';
264 print $form->textwithpicto('', $htmltooltip, 1, 0);
265 print '</td>';
266
267 print '</tr>';
268 }
269 }
270 }
271 closedir($handle);
272 }
273 }
274}
275
276print '</table>';
277print '</div>';
278
279print '<br>';
280
281
282/*
283 * Documents models for Holidays
284 */
285
286if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
287 print load_fiche_titre($langs->trans("TemplatePDFHolidays"), '', '');
288
289 // Defined model definition table
290 $def = array();
291 $sql = "SELECT nom";
292 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
293 $sql .= " WHERE type = '".$db->escape($type)."'";
294 $sql .= " AND entity = ".$conf->entity;
295 $resql = $db->query($sql);
296 if ($resql) {
297 $i = 0;
298 $num_rows = $db->num_rows($resql);
299 while ($i < $num_rows) {
300 $array = $db->fetch_array($resql);
301 array_push($def, $array[0]);
302 $i++;
303 }
304 } else {
305 dol_print_error($db);
306 }
307
308
309 print '<div class="div-table-responsive-no-min">';
310 print '<table class="noborder centpercent">';
311 print '<tr class="liste_titre">';
312 print '<td>'.$langs->trans("Name").'</td>';
313 print '<td>'.$langs->trans("Description").'</td>';
314 print '<td align="center" width="60">'.$langs->trans("Status")."</td>\n";
315 print '<td align="center" width="60">'.$langs->trans("Default")."</td>\n";
316 print '<td align="center" width="80">'.$langs->trans("ShortInfo").'</td>';
317 print '<td align="center" width="80">'.$langs->trans("Preview").'</td>';
318 print "</tr>\n";
319
320 clearstatcache();
321
322 foreach ($dirmodels as $reldir) {
323 foreach (array('', '/doc') as $valdir) {
324 $realpath = $reldir."core/modules/holiday".$valdir;
325 $dir = dol_buildpath($realpath);
326
327 if (is_dir($dir)) {
328 $handle = opendir($dir);
329 if (is_resource($handle)) {
330 while (($file = readdir($handle)) !== false) {
331 $filelist[] = $file;
332 }
333 closedir($handle);
334 arsort($filelist);
335
336 foreach ($filelist as $file) {
337 if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
338 if (file_exists($dir.'/'.$file)) {
339 $name = substr($file, 4, dol_strlen($file) - 16);
340 $classname = substr($file, 0, dol_strlen($file) - 12);
341
342 require_once $dir.'/'.$file;
343 $module = new $classname($db);
344
345 $modulequalified = 1;
346 if ($module->version == 'development' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 2) {
347 $modulequalified = 0;
348 }
349 if ($module->version == 'experimental' && getDolGlobalInt('MAIN_FEATURES_LEVEL') < 1) {
350 $modulequalified = 0;
351 }
352
353 if ($modulequalified) {
354 print '<tr class="oddeven"><td width="100">';
355 print(empty($module->name) ? $name : $module->name);
356 print "</td><td>\n";
357 if (method_exists($module, 'info')) {
358 print $module->info($langs);
359 } else {
360 print $module->description;
361 }
362 print '</td>';
363
364 // Active
365 if (in_array($name, $def)) {
366 print '<td class="center">'."\n";
367 print '<a class="reposition" href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
368 print img_picto($langs->trans("Enabled"), 'switch_on');
369 print '</a>';
370 print '</td>';
371 } else {
372 print '<td class="center">'."\n";
373 print '<a class="reposition" 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>';
374 print "</td>";
375 }
376
377 // Default
378 print '<td class="center">';
379 if ($conf->global->HOLIDAY_ADDON_PDF == $name) {
380 print img_picto($langs->trans("Default"), 'on');
381 } else {
382 print '<a class="reposition" 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>';
383 }
384 print '</td>';
385
386 // Info
387 $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
388 $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
389 if ($module->type == 'pdf') {
390 $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
391 }
392 $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
393
394 $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
395 $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
396 $htmltooltip .= '<br>'.$langs->trans("PaymentMode").': '.yn($module->option_modereg, 1, 1);
397 $htmltooltip .= '<br>'.$langs->trans("PaymentConditions").': '.yn($module->option_condreg, 1, 1);
398 $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
399 $htmltooltip .= '<br>'.$langs->trans("WatermarkOnDraftOrders").': '.yn($module->option_draft_watermark, 1, 1);
400
401
402 print '<td class="center">';
403 print $form->textwithpicto('', $htmltooltip, 1, 0);
404 print '</td>';
405
406 // Preview
407 print '<td class="center">';
408 if ($module->type == 'pdf') {
409 print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
410 } else {
411 print img_object($langs->trans("PreviewNotAvailable"), 'generic');
412 }
413 print '</td>';
414
415 print "</tr>\n";
416 }
417 }
418 }
419 }
420 }
421 }
422 }
423 }
424
425 print '</table>';
426 print '</div>';
427 print "<br>";
428}
429
430
431/*
432 * Other options
433 */
434
435print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
436print '<input type="hidden" name="token" value="'.newToken().'">';
437print '<input type="hidden" name="action" value="set_other">';
438
439print load_fiche_titre($langs->trans("OtherOptions"), '', '');
440
441print '<div class="div-table-responsive-no-min">';
442print '<table class="noborder centpercent">';
443print '<tr class="liste_titre">';
444print '<td>'.$langs->trans("Parameter").'</td>';
445print '<td align="center" width="60">'.$langs->trans("Value").'</td>';
446print "</tr>\n";
447
448//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY);
449//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY);
450//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY);
451//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY);
452
453if (!isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY)) {
454 $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY = 1;
455}
456if (!isset($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY)) {
457 $conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY = 1;
458}
459
460//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY);
461//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY);
462//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY);
463//var_dump($conf->global->MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY);
464
465
466// Set working days
467print '<tr class="oddeven">';
468print "<td>".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Monday"))."</td>";
469print '<td class="center">';
470if ($conf->use_javascript_ajax) {
471 print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY', array(), null, 0);
472} else {
473 if (getDolGlobalString('MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY')) {
474 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
475 } else {
476 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_MONDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
477 }
478}
479print "</td>";
480print "</tr>";
481
482// Set working days
483print '<tr class="oddeven">';
484print "<td>".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Friday"))."</td>";
485print '<td class="center">';
486if ($conf->use_javascript_ajax) {
487 print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY', array(), null, 0);
488} else {
489 if (getDolGlobalString('MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY')) {
490 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
491 } else {
492 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_FRIDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
493 }
494}
495print "</td>";
496print "</tr>";
497
498// Set working days
499print '<tr class="oddeven">';
500print "<td>".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Saturday"))."</td>";
501print '<td class="center">';
502if ($conf->use_javascript_ajax) {
503 print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY', array(), null, 0, 0, 0, 2, 0, 1);
504} else {
505 if (getDolGlobalString('MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY')) {
506 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
507 } else {
508 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SATURDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
509 }
510}
511print "</td>";
512print "</tr>";
513
514// Set working days
515print '<tr class="oddeven">';
516print "<td>".$langs->trans("XIsAUsualNonWorkingDay", $langs->transnoentitiesnoconv("Sunday"))."</td>";
517print '<td class="center">';
518if ($conf->use_javascript_ajax) {
519 print ajax_constantonoff('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY', array(), null, 0, 0, 0, 2, 0, 1);
520} else {
521 if (getDolGlobalString('MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY')) {
522 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY=1">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
523 } else {
524 print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_other&token='.newToken().'&MAIN_NON_WORKING_DAYS_INCLUDE_SUNDAY=0">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
525 }
526}
527print "</td>";
528print "</tr>";
529
530if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
531 $substitutionarray = pdf_getSubstitutionArray($langs, array('objectamount'), null, 2);
532 $substitutionarray['__(AnyTranslationKey)__'] = $langs->trans("Translation");
533 $htmltext = '<i>'.$langs->trans("AvailableVariables").':<br>';
534 foreach ($substitutionarray as $key => $val) {
535 $htmltext .= $key.'<br>';
536 }
537 $htmltext .= '</i>';
538
539 print '<tr class="oddeven"><td colspan="2">';
540 print $form->textwithpicto($langs->trans("FreeLegalTextOnHolidays"), $langs->trans("AddCRIfTooLong").'<br><br>'.$htmltext, 1, 'help', '', 0, 2, 'tooltiphelp');
541 print '<br>';
542 $variablename = 'HOLIDAY_FREE_TEXT';
543 if (!getDolGlobalString('PDF_ALLOW_HTML_FOR_FREE_TEXT')) {
544 print '<textarea name="'.$variablename.'" class="flat" cols="120">'.getDolGlobalString($variablename).'</textarea>';
545 } else {
546 include_once DOL_DOCUMENT_ROOT.'/core/class/doleditor.class.php';
547 $doleditor = new DolEditor($variablename, getDolGlobalString($variablename), '', 80, 'dolibarr_notes');
548 print $doleditor->Create();
549 }
550 print '</td></tr>'."\n";
551
552 //Use draft Watermark
553
554 print '<tr class="oddeven"><td>';
555 print $form->textwithpicto($langs->trans("WatermarkOnDraftHolidayCards"), $htmltext, 1, 'help', '', 0, 2, 'watermarktooltip').'<br>';
556 print '</td><td>';
557 print '<input class="flat minwidth200" type="text" name="HOLIDAY_DRAFT_WATERMARK" value="'.dol_escape_htmltag(getDolGlobalString('HOLIDAY_DRAFT_WATERMARK')).'">';
558 print '</td></tr>'."\n";
559}
560
561print '</table>';
562print '</div>';
563
564print $form->buttonsSaveCancel("Save", '');
565
566print '</form>';
567
568
569
570print dol_get_fiche_end();
571
572// End of page
573llxFooter();
574$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 generation of HTML components Only common components must be here.
Class of the module paid holiday.
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_get_fiche_end($notab=0)
Return tab footer of a card.
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.
holiday_admin_prepare_head()
Return array head with list of tabs to view object informations.
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.