dolibarr  20.0.0-alpha
agenda_other.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2008-2016 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2011 Regis Houssin <regis.houssin@inodbox.com>
4  * Copyright (C) 2011-2017 Juanjo Menent <jmenent@2byte.es>
5  * Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
6  * Copyright (C) 2016 Charlie Benke <charlie@patas-monkey.com>
7  * Copyright (C) 2017 Open-DSI <support@open-dsi.fr>
8  * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
9  * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
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
32 require '../main.inc.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
35 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
36 require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';
37 
38 if (!$user->admin) {
40 }
41 
42 // Load translation files required by the page
43 $langs->loadLangs(array('admin', 'other', 'agenda', 'users'));
44 
45 $action = GETPOST('action', 'aZ09');
46 $value = GETPOST('value', 'alpha');
47 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
48 
49 $param = GETPOST('param', 'alpha');
50 $cancel = GETPOST('cancel', 'alpha');
51 $scandir = GETPOST('scan_dir', 'alpha');
52 $type = 'action';
53 
54 
55 /*
56  * Actions
57  */
58 
59 $error = 0;
60 $errors = array();
61 
62 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
63 
64 $reg = array();
65 if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
66  $code = $reg[1];
67  $value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
68  if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) {
69  header("Location: ".$_SERVER["PHP_SELF"]);
70  exit;
71  } else {
72  dol_print_error($db);
73  }
74 }
75 
76 if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
77  $code = $reg[1];
78  if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
79  header("Location: ".$_SERVER["PHP_SELF"]);
80  exit;
81  } else {
82  dol_print_error($db);
83  }
84 }
85 if ($action == 'set') {
86  $getDefaultFilter = GETPOST('AGENDA_DEFAULT_FILTER_TYPE');
87  $defaultfilter = (is_array($getDefaultFilter)) ? implode(',', $getDefaultFilter) : $getDefaultFilter;
88  dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity);
89  dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity);
90  dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
91  dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
92 
93  $defaultValues = new DefaultValues($db);
94  $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity));
95  if (!is_array($result) && $result < 0) {
96  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
97  } elseif (count($result) > 0) {
98  foreach ($result as $defval) {
99  $defaultValues->id = $defval->id;
100  $resultDel = $defaultValues->delete($user);
101  if ($resultDel < 0) {
102  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
103  }
104  }
105  }
106  $defaultValues->type = 'createform';
107  $defaultValues->entity = $conf->entity;
108  $defaultValues->user_id = 0;
109  $defaultValues->page = 'comm/action/card.php';
110  $defaultValues->param = 'complete';
111  $defaultValues->value = GETPOST('AGENDA_EVENT_DEFAULT_STATUS');
112  $resultCreat = $defaultValues->create($user);
113  if ($resultCreat < 0) {
114  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
115  } else {
116  setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
117  }
118 } elseif ($action == 'specimen') { // For orders
119  $modele = GETPOST('module', 'alpha');
120 
121  $commande = new CommandeFournisseur($db);
122  $commande->initAsSpecimen();
123  $commande->thirdparty = $specimenthirdparty;
124 
125  // Search template files
126  $file = '';
127  $classname = '';
128  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
129  foreach ($dirmodels as $reldir) {
130  $file = dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0);
131  if (file_exists($file)) {
132  $classname = "pdf_".$modele;
133  break;
134  }
135  }
136 
137  if ($classname !== '') {
138  require_once $file;
139 
140  $module = new $classname($db, $commande);
141  '@phan-var-force pdf_standard_actions $module';
142 
143  if ($module->write_file($commande, $langs) > 0) {
144  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
145  return;
146  } else {
147  setEventMessages($module->error, $module->errors, 'errors');
148  dol_syslog($module->error, LOG_ERR);
149  }
150  } else {
151  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
152  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
153  }
154 } elseif ($action == 'setmodel') {
155  // Activate a model
156  //print "sssd".$value;
157  $ret = addDocumentModel($value, $type, $label, $scandir);
158 } elseif ($action == 'del') {
159  $ret = delDocumentModel($value, $type);
160  if ($ret > 0) {
161  if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") {
162  dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF', $conf->entity);
163  }
164  }
165 } elseif ($action == 'setdoc') {
166  // Set default model
167  if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
168  // La constante qui a ete lue en avant du nouveau set
169  // on passe donc par une variable pour avoir un affichage coherent
170  $conf->global->ACTION_EVENT_ADDON_PDF = $value;
171  }
172 
173  // On active le modele
174  $ret = delDocumentModel($value, $type);
175  if ($ret > 0) {
176  $ret = addDocumentModel($value, $type, $label, $scandir);
177  }
178 }
179 
180 
186 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
187 
188 $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda|DE:Modul_Terminplanung';
189 llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
190 
191 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
192 print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
193 
194 
195 
196 $head = agenda_prepare_head();
197 
198 print dol_get_fiche_head($head, 'other', $langs->trans("Agenda"), -1, 'action');
199 
200 
201 /*
202  * Miscellaneous
203  */
204 
205 // Define array def of models
206 $def = array();
207 
208 $sql = "SELECT nom";
209 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
210 $sql .= " WHERE type = 'action'";
211 $sql .= " AND entity = ".$conf->entity;
212 
213 $resql = $db->query($sql);
214 if ($resql) {
215  $i = 0;
216  $num_rows = $db->num_rows($resql);
217  while ($i < $num_rows) {
218  $array = $db->fetch_array($resql);
219  if (is_array($array)) {
220  array_push($def, $array[0]);
221  }
222  $i++;
223  }
224 } else {
225  dol_print_error($db);
226 }
227 
228 if (getDolGlobalInt('MAIN_FEATURES_LEVEL') >= 2) {
229  print load_fiche_titre($langs->trans("AgendaModelModule"), '', '');
230 
231  print '<table class="noborder centpercent">'."\n";
232  print '<tr class="liste_titre">'."\n";
233  print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
234  print '<td>'.$langs->trans("Description").'</td>'."\n";
235  print '<td class="center" width="60">'.$langs->trans("Status").'</td>'."\n";
236  print '<td class="center" width="60">'.$langs->trans("Default").'</td>'."\n";
237  print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
238  print '<td class="center" width="40">'.$langs->trans("Preview").'</td>';
239  print '</tr>'."\n";
240 
241  clearstatcache();
242 
243  foreach ($dirmodels as $reldir) {
244  $dir = dol_buildpath($reldir."core/modules/action/doc");
245 
246  if (is_dir($dir)) {
247  $handle = opendir($dir);
248  if (is_resource($handle)) {
249  while (($file = readdir($handle)) !== false) {
250  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
251  $name = substr($file, 4, dol_strlen($file) - 16);
252  $classname = substr($file, 0, dol_strlen($file) - 12);
253 
254  require_once $dir.'/'.$file;
255  $module = new $classname($db, new ActionComm($db));
256 
257  print '<tr class="oddeven">'."\n";
258  print "<td>";
259  print(empty($module->name) ? $name : $module->name);
260  print "</td>\n";
261  print "<td>\n";
262  require_once $dir.'/'.$file;
263  $module = new $classname($db, $specimenthirdparty);
264  if (method_exists($module, 'info')) {
265  print $module->info($langs);
266  } else {
267  print $module->description;
268  }
269  print "</td>\n";
270 
271  // Active
272  if (in_array($name, $def)) {
273  print '<td class="center">'."\n";
274  if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") {
275  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
276  print img_picto($langs->trans("Enabled"), 'switch_on');
277  print '</a>';
278  } else {
279  print img_picto($langs->trans("Enabled"), 'switch_on');
280  }
281  print "</td>";
282  } else {
283  print '<td class="center">'."\n";
284  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmodel&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
285  print "</td>";
286  }
287 
288  // Default
289  print '<td class="center">';
290  if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name") {
291  print img_picto($langs->trans("Default"), 'on');
292  } else {
293  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&token='.newToken().'&value='.urlencode($name).'&amp;scan_dir='.urlencode($module->scandir).'&label='.urlencode($module->name).'&amp;type=action"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
294  }
295  print '</td>';
296 
297  // Info
298  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
299  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
300  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
301  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
302  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
303  print '<td class="center">';
304  print $form->textwithpicto('', $htmltooltip, 1, 0);
305  print '</td>';
306  print '<td class="center">';
307  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
308  print '</td>';
309 
310  print "</tr>\n";
311  }
312  }
313  closedir($handle);
314  }
315  }
316  }
317  print '</table><br>';
318 
319  print load_fiche_titre($langs->trans('MiscellaneousOptions'), '', '');
320 }
321 
322 
323 print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
324 print '<input type="hidden" name="token" value="'.newToken().'">';
325 print '<input type="hidden" name="action" value="set">';
326 
327 print '<table class="noborder allwidth">'."\n";
328 print '<tr class="liste_titre">'."\n";
329 print '<td>'.$langs->trans("Parameters").'</td>'."\n";
330 print '<td class="center">&nbsp;</td>'."\n";
331 print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
332 print '</tr>'."\n";
333 
334 // AGENDA_DEFAULT_VIEW
335 print '<tr class="oddeven">'."\n";
336 $htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
337 print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n";
338 print '<td class="center">&nbsp;</td>'."\n";
339 print '<td class="right">'."\n";
340 $tmplist = array('' => '&nbsp;', 'show_list' => $langs->trans("ViewList"), 'show_month' => $langs->trans("ViewCal"), 'show_week' => $langs->trans("ViewWeek"), 'show_day' => $langs->trans("ViewDay"), 'show_peruser' => $langs->trans("ViewPerUser"));
341 print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, getDolGlobalString('AGENDA_DEFAULT_VIEW'));
342 print '</td></tr>'."\n";
343 
344 // Manual or automatic
345 
346 print '<tr class="oddeven">'."\n";
347 print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n";
348 print '<td class="center">&nbsp;</td>'."\n";
349 print '<td class="right">'."\n";
350 //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list
351 if (!getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
352  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_USE_EVENT_TYPE&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
353 } else {
354  print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_USE_EVENT_TYPE&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
355 }
356 print '</td></tr>'."\n";
357 
358 if (getDolGlobalString('AGENDA_USE_EVENT_TYPE')) {
359  print '<!-- AGENDA_USE_EVENT_TYPE_DEFAULT -->';
360  print '<tr class="oddeven">'."\n";
361  print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
362  print '<td class="center">&nbsp;</td>'."\n";
363  print '<td class="right nowrap">'."\n";
364  $formactions->select_type_actions(getDolGlobalString('AGENDA_USE_EVENT_TYPE_DEFAULT'), "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
365  print '</td></tr>'."\n";
366 }
367 
368 // AGENDA_EVENT_DEFAULT_STATUS
369 print '<tr class="oddeven">'."\n";
370 print '<td>'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'</td>'."\n";
371 print '<td class="center">&nbsp;</td>'."\n";
372 print '<td class="right nowrap">'."\n";
373 $defval = 'na';
374 $defaultValues = new DefaultValues($db);
375 $result = $defaultValues->fetchAll('', '', 0, 0, array('t.page' => 'comm/action/card.php', 't.param' => 'complete', 't.user_id' => '0', 't.type' => 'createform', 't.entity' => $conf->entity));
376 if (!is_array($result) && $result < 0) {
377  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
378 } elseif (count($result) > 0) {
379  $defval = reset($result)->value;
380 }
381 $formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200 onrightofpage');
382 print '</td></tr>'."\n";
383 
384 // AGENDA_DEFAULT_FILTER_TYPE
385 print '<tr class="oddeven">'."\n";
386 print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
387 print '<td class="center">&nbsp;</td>'."\n";
388 print '<td class="right nowrap">'."\n";
389 $multiselect = 0;
390 if (getDolGlobalString('MAIN_ENABLE_MULTISELECT_TYPE')) {
391  // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
392  $multiselect = (getDolGlobalString('AGENDA_USE_EVENT_TYPE'));
393 }
394 $formactions->select_type_actions(getDolGlobalString('AGENDA_DEFAULT_FILTER_TYPE'), "AGENDA_DEFAULT_FILTER_TYPE", '', (getDolGlobalString('AGENDA_USE_EVENT_TYPE') ? -1 : 1), 1, $multiselect);
395 print '</td></tr>'."\n";
396 
397 // AGENDA_DEFAULT_FILTER_STATUS
398 // TODO Remove to use the default generic feature
399 print '<tr class="oddeven">'."\n";
400 print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").'</td>'."\n";
401 print '<td class="center">&nbsp;</td>'."\n";
402 print '<td class="right">'."\n";
403 $formactions->form_select_status_action('agenda', getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS'), 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100');
404 print '</td></tr>'."\n";
405 
406 print '</table>';
407 
408 print $form->buttonsSaveCancel("Save", '');
409 
410 print '</form>';
411 
412 
413 print dol_get_fiche_end();
414 
415 // End of page
416 llxFooter();
417 $db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1939
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:655
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:579
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1970
agenda_prepare_head()
Prepare array with list of tabs.
Definition: agenda.lib.php:395
if(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif($action=='specimen') elseif($action=='setmodel') elseif($action=='del') elseif($action=='setdoc') $formactions
View.
if(GETPOSTISSET('MAIN_AGENDA_XCAL_EXPORTKEY')) if(GETPOSTISSET('MAIN_AGENDA_EXPORT_PAST_DELAY')) if(GETPOSTISSET('MAIN_AGENDA_EXPORT_CACHE')) if(GETPOSTISSET('AGENDA_EXPORT_FIX_TZ')) if($actionsave) if(!isset($conf->global->MAIN_AGENDA_EXPORT_PAST_DELAY)) $wikihelp
View.
Definition: agenda_xcal.php:90
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 agenda events (actions)
Class to manage predefined suppliers products.
Class for MyObject.
Class to manage building of HTML components.
if(isModEnabled('invoice') && $user->hasRight('facture', 'lire')) if((isModEnabled('fournisseur') &&!getDolGlobalString('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') && $user->hasRight('tax', 'charges', 'lire')) if(isModEnabled('invoice') &&isModEnabled('order') && $user->hasRight("commande", "lire") &&!getDolGlobalString('WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER')) $sql
Social contributions to pay.
Definition: index.php:744
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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_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.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return 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.