dolibarr  19.0.0-dev
setup.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2022 Alice Adminson <aadminson@example.com>
4  *
5  * This program is free software: you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation, either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <https://www.gnu.org/licenses/>.
17  */
18 
25 // Load Dolibarr environment
26 require '../../main.inc.php';
27 
28 global $langs, $user;
29 
30 // Libraries
31 require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
32 require_once '../lib/bookcal.lib.php';
33 //require_once "../class/myclass.class.php";
34 
35 // Translations
36 $langs->loadLangs(array("admin", "agenda"));
37 
38 // Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
39 $hookmanager->initHooks(array('bookcalsetup', 'globalsetup'));
40 
41 // Access control
42 if (!$user->admin) {
44 }
45 
46 // Parameters
47 $action = GETPOST('action', 'aZ09');
48 $backtopage = GETPOST('backtopage', 'alpha');
49 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
50 
51 $value = GETPOST('value', 'alpha');
52 $label = GETPOST('label', 'alpha');
53 $scandir = GETPOST('scan_dir', 'alpha');
54 $type = 'myobject';
55 
56 
57 $error = 0;
58 $setupnotempty = 0;
59 
60 // Set this to 1 to use the factory to manage constants. Warning, the generated module will be compatible with version v15+ only
61 $useFormSetup = 1;
62 
63 if (!class_exists('FormSetup')) {
64  // For retrocompatibility Dolibarr < 16.0
65  if (floatval(DOL_VERSION) < 16.0 && !class_exists('FormSetup')) {
66  require_once __DIR__.'/../backport/v16/core/class/html.formsetup.class.php';
67  } else {
68  require_once DOL_DOCUMENT_ROOT.'/core/class/html.formsetup.class.php';
69  }
70 }
71 
72 $formSetup = new FormSetup($db);
73 
74 
75 // Hôte
76 $item = $formSetup->newItem('NO_PARAM_JUST_TEXT');
77 $item->fieldOverride = (empty($_SERVER['HTTPS']) ? 'http://' : 'https://') . $_SERVER['HTTP_HOST'];
78 $item->cssClass = 'minwidth500';
79 
80 // Setup conf BOOKCAL_MYPARAM1 as a simple string input
81 $item = $formSetup->newItem('BOOKCAL_MYPARAM1');
82 $item->defaultFieldValue = 'default value';
83 
84 // Setup conf BOOKCAL_MYPARAM1 as a simple textarea input but we replace the text of field title
85 $item = $formSetup->newItem('BOOKCAL_MYPARAM2');
86 $item->nameText = $item->getNameText().' more html text ';
87 
88 // Setup conf BOOKCAL_MYPARAM3
89 $item = $formSetup->newItem('BOOKCAL_MYPARAM3');
90 $item->setAsThirdpartyType();
91 
92 // Setup conf BOOKCAL_MYPARAM4 : exemple of quick define write style
93 $formSetup->newItem('BOOKCAL_MYPARAM4')->setAsYesNo();
94 
95 // Setup conf BOOKCAL_MYPARAM5
96 $formSetup->newItem('BOOKCAL_MYPARAM5')->setAsEmailTemplate('thirdparty');
97 
98 // Setup conf BOOKCAL_MYPARAM6
99 $formSetup->newItem('BOOKCAL_MYPARAM6')->setAsSecureKey()->enabled = 0; // disabled
100 
101 // Setup conf BOOKCAL_MYPARAM7
102 $formSetup->newItem('BOOKCAL_MYPARAM7')->setAsProduct();
103 
104 $formSetup->newItem('Title')->setAsTitle();
105 
106 // Setup conf BOOKCAL_MYPARAM8
107 $item = $formSetup->newItem('BOOKCAL_MYPARAM8');
108 $TField = array(
109  'test01' => $langs->trans('test01'),
110  'test02' => $langs->trans('test02'),
111  'test03' => $langs->trans('test03'),
112  'test04' => $langs->trans('test04'),
113  'test05' => $langs->trans('test05'),
114  'test06' => $langs->trans('test06'),
115 );
116 $item->setAsMultiSelect($TField);
117 $item->helpText = $langs->transnoentities('BOOKCAL_MYPARAM8');
118 
119 
120 // Setup conf BOOKCAL_MYPARAM9
121 $formSetup->newItem('BOOKCAL_MYPARAM9')->setAsSelect($TField);
122 
123 
124 // Setup conf BOOKCAL_MYPARAM10
125 $item = $formSetup->newItem('BOOKCAL_MYPARAM10');
126 $item->setAsColor();
127 $item->defaultFieldValue = '#FF0000';
128 $item->nameText = $item->getNameText().' more html text ';
129 $item->fieldInputOverride = '';
130 $item->helpText = $langs->transnoentities('AnHelpMessage');
131 //$item->fieldValue = '';
132 //$item->fieldAttr = array() ; // fields attribute only for compatible fields like input text
133 //$item->fieldOverride = false; // set this var to override field output will override $fieldInputOverride and $fieldOutputOverride too
134 //$item->fieldInputOverride = false; // set this var to override field input
135 //$item->fieldOutputOverride = false; // set this var to override field output
136 
137 
138 $setupnotempty =+ count($formSetup->items);
139 
140 
141 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
142 
143 
144 /*
145  * Actions
146  */
147 
148 // For retrocompatibility Dolibarr < 15.0
149 if ( versioncompare(explode('.', DOL_VERSION), array(15)) < 0 && $action == 'update' && !empty($user->admin)) {
150  $formSetup->saveConfFromPost();
151 }
152 
153 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
154 
155 if ($action == 'updateMask') {
156  $maskconst = GETPOST('maskconst', 'aZ09');
157  $maskvalue = GETPOST('maskvalue', 'alpha');
158 
159  if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
160  $res = dolibarr_set_const($db, $maskconst, $maskvalue, 'chaine', 0, '', $conf->entity);
161  if (!($res > 0)) {
162  $error++;
163  }
164  }
165 
166  if (!$error) {
167  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
168  } else {
169  setEventMessages($langs->trans("Error"), null, 'errors');
170  }
171 } elseif ($action == 'specimen') {
172  $modele = GETPOST('module', 'alpha');
173  $tmpobjectkey = GETPOST('object');
174 
175  $tmpobject = new $tmpobjectkey($db);
176  $tmpobject->initAsSpecimen();
177 
178  // Search template files
179  $file = ''; $classname = ''; $filefound = 0;
180  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
181  foreach ($dirmodels as $reldir) {
182  $file = dol_buildpath($reldir."core/modules/bookcal/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
183  if (file_exists($file)) {
184  $filefound = 1;
185  $classname = "pdf_".$modele."_".strtolower($tmpobjectkey);
186  break;
187  }
188  }
189 
190  if ($filefound) {
191  require_once $file;
192 
193  $module = new $classname($db);
194 
195  if ($module->write_file($tmpobject, $langs) > 0) {
196  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=bookcal-".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
197  return;
198  } else {
199  setEventMessages($module->error, null, 'errors');
200  dol_syslog($module->error, LOG_ERR);
201  }
202  } else {
203  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
204  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
205  }
206 } elseif ($action == 'setmod') {
207  // TODO Check if numbering module chosen can be activated by calling method canBeActivated
208  $tmpobjectkey = GETPOST('object');
209  if (!empty($tmpobjectkey)) {
210  $constforval = 'BOOKCAL_'.strtoupper($tmpobjectkey)."_ADDON";
211  dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
212  }
213 } elseif ($action == 'set') {
214  // Activate a model
215  $ret = addDocumentModel($value, $type, $label, $scandir);
216 } elseif ($action == 'del') {
217  $ret = delDocumentModel($value, $type);
218  if ($ret > 0) {
219  $tmpobjectkey = GETPOST('object');
220  if (!empty($tmpobjectkey)) {
221  $constforval = 'BOOKCAL_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
222  if ($conf->global->$constforval == "$value") {
223  dolibarr_del_const($db, $constforval, $conf->entity);
224  }
225  }
226  }
227 } elseif ($action == 'setdoc') {
228  // Set or unset default model
229  $tmpobjectkey = GETPOST('object');
230  if (!empty($tmpobjectkey)) {
231  $constforval = 'BOOKCAL_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
232  if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
233  // The constant that was read before the new set
234  // We therefore requires a variable to have a coherent view
235  $conf->global->$constforval = $value;
236  }
237 
238  // We disable/enable the document template (into llx_document_model table)
239  $ret = delDocumentModel($value, $type);
240  if ($ret > 0) {
241  $ret = addDocumentModel($value, $type, $label, $scandir);
242  }
243  }
244 } elseif ($action == 'unsetdoc') {
245  $tmpobjectkey = GETPOST('object');
246  if (!empty($tmpobjectkey)) {
247  $constforval = 'BOOKCAL_'.strtoupper($tmpobjectkey).'_ADDON_PDF';
248  dolibarr_del_const($db, $constforval, $conf->entity);
249  }
250 }
251 
252 
253 
254 /*
255  * View
256  */
257 
258 $form = new Form($db);
259 
260 $help_url = '';
261 $page_name = "BookCalSetup";
262 
263 llxHeader('', $langs->trans($page_name), $help_url);
264 
265 // Subheader
266 $linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
267 
268 print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
269 
270 // Configuration header
271 $head = bookcalAdminPrepareHead();
272 print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "fa-calendar-check");
273 
274 // Setup page goes here
275 echo '<span class="opacitymedium">'.$langs->trans("BookCalSetupPage").'</span><br><br>';
276 
277 
278 if ($action == 'edit') {
279  print $formSetup->generateOutput(true);
280  print '<br>';
281 } elseif (!empty($formSetup->items)) {
282  print $formSetup->generateOutput();
283  print '<div class="tabsAction">';
284  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
285  print '</div>';
286 } else {
287  print '<br>'.$langs->trans("NothingToSetup");
288 }
289 
290 
291 $moduledir = 'bookcal';
292 $myTmpObjects = array();
293 $myTmpObjects['MyObject'] = array('includerefgeneration'=>0, 'includedocgeneration'=>0);
294 
295 
296 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
297  if ($myTmpObjectKey == 'MyObject') {
298  continue;
299  }
300  if ($myTmpObjectArray['includerefgeneration']) {
301  /*
302  * Orders Numbering model
303  */
304  $setupnotempty++;
305 
306  print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
307 
308  print '<table class="noborder centpercent">';
309  print '<tr class="liste_titre">';
310  print '<td>'.$langs->trans("Name").'</td>';
311  print '<td>'.$langs->trans("Description").'</td>';
312  print '<td class="nowrap">'.$langs->trans("Example").'</td>';
313  print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
314  print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
315  print '</tr>'."\n";
316 
317  clearstatcache();
318 
319  foreach ($dirmodels as $reldir) {
320  $dir = dol_buildpath($reldir."core/modules/".$moduledir);
321 
322  if (is_dir($dir)) {
323  $handle = opendir($dir);
324  if (is_resource($handle)) {
325  while (($file = readdir($handle)) !== false) {
326  if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
327  $file = substr($file, 0, dol_strlen($file) - 4);
328 
329  require_once $dir.'/'.$file.'.php';
330 
331  $module = new $file($db);
332 
333  // Show modules according to features level
334  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
335  continue;
336  }
337  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
338  continue;
339  }
340 
341  if ($module->isEnabled()) {
342  dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
343 
344  print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
345  print $module->info();
346  print '</td>';
347 
348  // Show example of numbering model
349  print '<td class="nowrap">';
350  $tmp = $module->getExample();
351  if (preg_match('/^Error/', $tmp)) {
352  $langs->load("errors");
353  print '<div class="error">'.$langs->trans($tmp).'</div>';
354  } elseif ($tmp == 'NotConfigured') {
355  print $langs->trans($tmp);
356  } else {
357  print $tmp;
358  }
359  print '</td>'."\n";
360 
361  print '<td class="center">';
362  $constforvar = 'BOOKCAL_'.strtoupper($myTmpObjectKey).'_ADDON';
363  if (getDolGlobalString($constforvar) == $file) {
364  print img_picto($langs->trans("Activated"), 'switch_on');
365  } else {
366  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
367  print img_picto($langs->trans("Disabled"), 'switch_off');
368  print '</a>';
369  }
370  print '</td>';
371 
372  $mytmpinstance = new $myTmpObjectKey($db);
373  $mytmpinstance->initAsSpecimen();
374 
375  // Info
376  $htmltooltip = '';
377  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
378 
379  $nextval = $module->getNextValue($mytmpinstance);
380  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
381  $htmltooltip .= ''.$langs->trans("NextValue").': ';
382  if ($nextval) {
383  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
384  $nextval = $langs->trans($nextval);
385  }
386  $htmltooltip .= $nextval.'<br>';
387  } else {
388  $htmltooltip .= $langs->trans($module->error).'<br>';
389  }
390  }
391 
392  print '<td class="center">';
393  print $form->textwithpicto('', $htmltooltip, 1, 0);
394  print '</td>';
395 
396  print "</tr>\n";
397  }
398  }
399  }
400  closedir($handle);
401  }
402  }
403  }
404  print "</table><br>\n";
405  }
406 
407  if ($myTmpObjectArray['includedocgeneration']) {
408  /*
409  * Document templates generators
410  */
411  $setupnotempty++;
412  $type = strtolower($myTmpObjectKey);
413 
414  print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', '');
415 
416  // Load array def with activated templates
417  $def = array();
418  $sql = "SELECT nom";
419  $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
420  $sql .= " WHERE type = '".$db->escape($type)."'";
421  $sql .= " AND entity = ".$conf->entity;
422  $resql = $db->query($sql);
423  if ($resql) {
424  $i = 0;
425  $num_rows = $db->num_rows($resql);
426  while ($i < $num_rows) {
427  $array = $db->fetch_array($resql);
428  array_push($def, $array[0]);
429  $i++;
430  }
431  } else {
432  dol_print_error($db);
433  }
434 
435  print "<table class=\"noborder\" width=\"100%\">\n";
436  print "<tr class=\"liste_titre\">\n";
437  print '<td>'.$langs->trans("Name").'</td>';
438  print '<td>'.$langs->trans("Description").'</td>';
439  print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
440  print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
441  print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
442  print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
443  print "</tr>\n";
444 
445  clearstatcache();
446 
447  foreach ($dirmodels as $reldir) {
448  foreach (array('', '/doc') as $valdir) {
449  $realpath = $reldir."core/modules/".$moduledir.$valdir;
450  $dir = dol_buildpath($realpath);
451 
452  if (is_dir($dir)) {
453  $handle = opendir($dir);
454  if (is_resource($handle)) {
455  while (($file = readdir($handle)) !== false) {
456  $filelist[] = $file;
457  }
458  closedir($handle);
459  arsort($filelist);
460 
461  foreach ($filelist as $file) {
462  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
463  if (file_exists($dir.'/'.$file)) {
464  $name = substr($file, 4, dol_strlen($file) - 16);
465  $classname = substr($file, 0, dol_strlen($file) - 12);
466 
467  require_once $dir.'/'.$file;
468  $module = new $classname($db);
469 
470  $modulequalified = 1;
471  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
472  $modulequalified = 0;
473  }
474  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
475  $modulequalified = 0;
476  }
477 
478  if ($modulequalified) {
479  print '<tr class="oddeven"><td width="100">';
480  print (empty($module->name) ? $name : $module->name);
481  print "</td><td>\n";
482  if (method_exists($module, 'info')) {
483  print $module->info($langs);
484  } else {
485  print $module->description;
486  }
487  print '</td>';
488 
489  // Active
490  if (in_array($name, $def)) {
491  print '<td class="center">'."\n";
492  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
493  print img_picto($langs->trans("Enabled"), 'switch_on');
494  print '</a>';
495  print '</td>';
496  } else {
497  print '<td class="center">'."\n";
498  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>';
499  print "</td>";
500  }
501 
502  // Default
503  print '<td class="center">';
504  $constforvar = 'BOOKCAL_'.strtoupper($myTmpObjectKey).'_ADDON';
505  if (getDolGlobalString($constforvar) == $name) {
506  //print img_picto($langs->trans("Default"), 'on');
507  // Even if choice is the default value, we allow to disable it. Replace this with previous line if you need to disable unset
508  print '<a href="'.$_SERVER["PHP_SELF"].'?action=unsetdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&amp;type='.urlencode($type).'" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').'</a>';
509  } else {
510  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&object='.urlencode(strtolower($myTmpObjectKey)).'&value='.urlencode($name).'&scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
511  }
512  print '</td>';
513 
514  // Info
515  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
516  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
517  if ($module->type == 'pdf') {
518  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
519  }
520  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
521 
522  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
523  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
524  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
525 
526  print '<td class="center">';
527  print $form->textwithpicto('', $htmltooltip, 1, 0);
528  print '</td>';
529 
530  // Preview
531  print '<td class="center">';
532  if ($module->type == 'pdf') {
533  $newname = preg_replace('/_'.preg_quote(strtolower($myTmpObjectKey), '/').'/', '', $name);
534  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.urlencode($newname).'&object='.urlencode($myTmpObjectKey).'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
535  } else {
536  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
537  }
538  print '</td>';
539 
540  print "</tr>\n";
541  }
542  }
543  }
544  }
545  }
546  }
547  }
548  }
549 
550  print '</table>';
551  }
552 }
553 
554 if (empty($setupnotempty)) {
555  print '<br>'.$langs->trans("NothingToSetup");
556 }
557 
558 // Page end
559 print dol_get_fiche_end();
560 
561 llxFooter();
562 $db->close();
if(GETPOST('button_removefilter_x', 'alpha')||GETPOST('button_removefilter.x', 'alpha')||GETPOST('button_removefilter', 'alpha')) if(GETPOST('button_search_x', 'alpha')||GETPOST('button_search.x', 'alpha')||GETPOST('button_search', 'alpha')) if($action=="save" &&empty($cancel)) $help_url
View.
Definition: agenda.php:118
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1918
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).
Definition: admin.lib.php:638
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:562
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1949
versioncompare($versionarray1, $versionarray2)
Compare 2 versions (stored into 2 arrays).
Definition: admin.lib.php:67
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
bookcalAdminPrepareHead()
Prepare admin pages header.
Definition: bookcal.lib.php:29
Class to manage generation of HTML components Only common components must be here.
This class help you create setup render.
if(isModEnabled('facture') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') && $user->hasRight('don', 'lire')) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $sql
Social contributions to pay.
Definition: index.php:746
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
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.
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.