dolibarr  17.0.4
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  *
9  * This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program. If not, see <https://www.gnu.org/licenses/>.
21  */
22 
29 // Load Dolibarr environment
30 require '../main.inc.php';
31 require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
32 require_once DOL_DOCUMENT_ROOT.'/core/lib/agenda.lib.php';
33 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
34 require_once DOL_DOCUMENT_ROOT.'/core/class/defaultvalues.class.php';
35 
36 if (!$user->admin) {
38 }
39 
40 // Load translation files required by the page
41 $langs->loadLangs(array('admin', 'other', 'agenda', 'users'));
42 
43 $action = GETPOST('action', 'aZ09');
44 $value = GETPOST('value', 'alpha');
45 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
46 
47 $param = GETPOST('param', 'alpha');
48 $cancel = GETPOST('cancel', 'alpha');
49 $scandir = GETPOST('scan_dir', 'alpha');
50 $type = 'action';
51 
52 
53 /*
54  * Actions
55  */
56 
57 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
58 
59 $reg = array();
60 if (preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) {
61  $code = $reg[1];
62  $value = (GETPOST($code, 'alpha') ? GETPOST($code, 'alpha') : 1);
63  if (dolibarr_set_const($db, $code, $value, 'chaine', 0, '', $conf->entity) > 0) {
64  Header("Location: ".$_SERVER["PHP_SELF"]);
65  exit;
66  } else {
67  dol_print_error($db);
68  }
69 }
70 
71 if (preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) {
72  $code = $reg[1];
73  if (dolibarr_del_const($db, $code, $conf->entity) > 0) {
74  Header("Location: ".$_SERVER["PHP_SELF"]);
75  exit;
76  } else {
77  dol_print_error($db);
78  }
79 }
80 if ($action == 'set') {
81  $getDefaultFilter = GETPOST('AGENDA_DEFAULT_FILTER_TYPE');
82  $defaultfilter = (is_array($getDefaultFilter)) ? implode(',', $getDefaultFilter) : $getDefaultFilter;
83  dolibarr_set_const($db, 'AGENDA_USE_EVENT_TYPE_DEFAULT', GETPOST('AGENDA_USE_EVENT_TYPE_DEFAULT'), 'chaine', 0, '', $conf->entity);
84  dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_TYPE', $defaultfilter, 'chaine', 0, '', $conf->entity);
85  dolibarr_set_const($db, 'AGENDA_DEFAULT_FILTER_STATUS', GETPOST('AGENDA_DEFAULT_FILTER_STATUS'), 'chaine', 0, '', $conf->entity);
86  dolibarr_set_const($db, 'AGENDA_DEFAULT_VIEW', GETPOST('AGENDA_DEFAULT_VIEW'), 'chaine', 0, '', $conf->entity);
87 
88  $defaultValues = new DefaultValues($db);
89  $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));
90  if (!is_array($result) && $result < 0) {
91  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
92  } elseif (count($result) > 0) {
93  foreach ($result as $defval) {
94  $defaultValues->id = $defval->id;
95  $resultDel = $defaultValues->delete($user);
96  if ($resultDel < 0) {
97  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
98  }
99  }
100  }
101  $defaultValues->type = 'createform';
102  $defaultValues->entity = $conf->entity;
103  $defaultValues->user_id = 0;
104  $defaultValues->page = 'comm/action/card.php';
105  $defaultValues->param = 'complete';
106  $defaultValues->value = GETPOST('AGENDA_EVENT_DEFAULT_STATUS');
107  $resultCreat = $defaultValues->create($user);
108  if ($resultCreat < 0) {
109  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
110  } else {
111  setEventMessages($langs->trans("RecordSaved"), null, 'mesgs');
112  }
113 } elseif ($action == 'specimen') { // For orders
114  $modele = GETPOST('module', 'alpha');
115 
116  $commande = new CommandeFournisseur($db);
117  $commande->initAsSpecimen();
118  $commande->thirdparty = $specimenthirdparty;
119 
120  // Search template files
121  $file = ''; $classname = ''; $filefound = 0;
122  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
123  foreach ($dirmodels as $reldir) {
124  $file = dol_buildpath($reldir."core/modules/action/doc/pdf_".$modele.".modules.php", 0);
125  if (file_exists($file)) {
126  $filefound = 1;
127  $classname = "pdf_".$modele;
128  break;
129  }
130  }
131 
132  if ($filefound) {
133  require_once $file;
134 
135  $module = new $classname($db, $commande);
136 
137  if ($module->write_file($commande, $langs) > 0) {
138  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=action&file=SPECIMEN.pdf");
139  return;
140  } else {
141  setEventMessages($module->error, $module->errors, 'errors');
142  dol_syslog($module->error, LOG_ERR);
143  }
144  } else {
145  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
146  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
147  }
148 } elseif ($action == 'setmodel') {
149  // Activate a model
150  //print "sssd".$value;
151  $ret = addDocumentModel($value, $type, $label, $scandir);
152 } elseif ($action == 'del') {
153  $ret = delDocumentModel($value, $type);
154  if ($ret > 0) {
155  if ($conf->global->ACTION_EVENT_ADDON_PDF == "$value") {
156  dolibarr_del_const($db, 'ACTION_EVENT_ADDON_PDF', $conf->entity);
157  }
158  }
159 } elseif ($action == 'setdoc') {
160  // Set default model
161  if (dolibarr_set_const($db, "ACTION_EVENT_ADDON_PDF", $value, 'chaine', 0, '', $conf->entity)) {
162  // La constante qui a ete lue en avant du nouveau set
163  // on passe donc par une variable pour avoir un affichage coherent
164  $conf->global->ACTION_EVENT_ADDON_PDF = $value;
165  }
166 
167  // On active le modele
168  $ret = delDocumentModel($value, $type);
169  if ($ret > 0) {
170  $ret = addDocumentModel($value, $type, $label, $scandir);
171  }
172 }
173 
174 
180 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
181 
182 $wikihelp = 'EN:Module_Agenda_En|FR:Module_Agenda|ES:Módulo_Agenda';
183 llxHeader('', $langs->trans("AgendaSetup"), $wikihelp);
184 
185 $linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
186 print load_fiche_titre($langs->trans("AgendaSetup"), $linkback, 'title_setup');
187 
188 
189 
190 $head = agenda_prepare_head();
191 
192 print dol_get_fiche_head($head, 'other', $langs->trans("Agenda"), -1, 'action');
193 
194 
195 /*
196  * Documents models for supplier orders
197  */
198 
199 
200 // Define array def of models
201 $def = array();
202 
203 $sql = "SELECT nom";
204 $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
205 $sql .= " WHERE type = 'action'";
206 $sql .= " AND entity = ".$conf->entity;
207 
208 $resql = $db->query($sql);
209 if ($resql) {
210  $i = 0;
211  $num_rows = $db->num_rows($resql);
212  while ($i < $num_rows) {
213  $array = $db->fetch_array($resql);
214  array_push($def, $array[0]);
215  $i++;
216  }
217 } else {
218  dol_print_error($db);
219 }
220 
221 if ($conf->global->MAIN_FEATURES_LEVEL >= 2) {
222  print load_fiche_titre($langs->trans("AgendaModelModule"), '', '');
223 
224  print '<table class="noborder centpercent">'."\n";
225  print '<tr class="liste_titre">'."\n";
226  print '<td width="100">'.$langs->trans("Name").'</td>'."\n";
227  print '<td>'.$langs->trans("Description").'</td>'."\n";
228  print '<td class="center" width="60">'.$langs->trans("Status").'</td>'."\n";
229  print '<td class="center" width="60">'.$langs->trans("Default").'</td>'."\n";
230  print '<td class="center" width="40">'.$langs->trans("ShortInfo").'</td>';
231  print '<td class="center" width="40">'.$langs->trans("Preview").'</td>';
232  print '</tr>'."\n";
233 
234  clearstatcache();
235 
236  foreach ($dirmodels as $reldir) {
237  $dir = dol_buildpath($reldir."core/modules/action/doc");
238 
239  if (is_dir($dir)) {
240  $handle = opendir($dir);
241  if (is_resource($handle)) {
242  while (($file = readdir($handle)) !== false) {
243  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
244  $name = substr($file, 4, dol_strlen($file) - 16);
245  $classname = substr($file, 0, dol_strlen($file) - 12);
246 
247  require_once $dir.'/'.$file;
248  $module = new $classname($db, new ActionComm($db));
249 
250  print '<tr class="oddeven">'."\n";
251  print "<td>";
252  print (empty($module->name) ? $name : $module->name);
253  print "</td>\n";
254  print "<td>\n";
255  require_once $dir.'/'.$file;
256  $module = new $classname($db, $specimenthirdparty);
257  if (method_exists($module, 'info')) {
258  print $module->info($langs);
259  } else {
260  print $module->description;
261  }
262  print "</td>\n";
263 
264  // Active
265  if (in_array($name, $def)) {
266  print '<td class="center">'."\n";
267  if ($conf->global->ACTION_EVENT_ADDON_PDF != "$name") {
268  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.$name.'&scan_dir='.$module->scandir.'&label='.urlencode($module->name).'&type=action">';
269  print img_picto($langs->trans("Enabled"), 'switch_on');
270  print '</a>';
271  } else {
272  print img_picto($langs->trans("Enabled"), 'switch_on');
273  }
274  print "</td>";
275  } else {
276  print '<td class="center">'."\n";
277  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>';
278  print "</td>";
279  }
280 
281  // Default
282  print '<td class="center">';
283  if ($conf->global->ACTION_EVENT_ADDON_PDF == "$name") {
284  print img_picto($langs->trans("Default"), 'on');
285  } else {
286  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>';
287  }
288  print '</td>';
289 
290  // Info
291  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
292  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
293  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
294  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
295  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
296  print '<td class="center">';
297  print $form->textwithpicto('', $htmltooltip, 1, 0);
298  print '</td>';
299  print '<td class="center">';
300  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&amp;module='.$name.'">'.img_object($langs->trans("Preview"), 'pdf').'</a>';
301  print '</td>';
302 
303  print "</tr>\n";
304  }
305  }
306  closedir($handle);
307  }
308  }
309  }
310  print '</table><br>';
311 }
312 
313 print '<form action="'.$_SERVER["PHP_SELF"].'" name="agenda">';
314 print '<input type="hidden" name="token" value="'.newToken().'">';
315 print '<input type="hidden" name="action" value="set">';
316 
317 print '<table class="noborder allwidth">'."\n";
318 print '<tr class="liste_titre">'."\n";
319 print '<td>'.$langs->trans("Parameters").'</td>'."\n";
320 print '<td class="center">&nbsp;</td>'."\n";
321 print '<td class="right">'.$langs->trans("Value").'</td>'."\n";
322 print '</tr>'."\n";
323 
324 // AGENDA_DEFAULT_VIEW
325 print '<tr class="oddeven">'."\n";
326 $htmltext = $langs->trans("ThisValueCanOverwrittenOnUserLevel", $langs->transnoentitiesnoconv("UserGUISetup"));
327 print '<td>'.$form->textwithpicto($langs->trans("AGENDA_DEFAULT_VIEW"), $htmltext).'</td>'."\n";
328 print '<td class="center">&nbsp;</td>'."\n";
329 print '<td class="right">'."\n";
330 $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"));
331 print $form->selectarray('AGENDA_DEFAULT_VIEW', $tmplist, getDolGlobalString('AGENDA_DEFAULT_VIEW'));
332 print '</td></tr>'."\n";
333 
334 // Manual or automatic
335 
336 print '<tr class="oddeven">'."\n";
337 print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE").'</td>'."\n";
338 print '<td class="center">&nbsp;</td>'."\n";
339 print '<td class="right">'."\n";
340 //print ajax_constantonoff('AGENDA_USE_EVENT_TYPE'); Do not use ajax here, we need to reload page to change other combo list
341 if (empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
342  print '<a href="'.$_SERVER['PHP_SELF'].'?action=set_AGENDA_USE_EVENT_TYPE&token='.newToken().'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
343 } else {
344  print '<a href="'.$_SERVER['PHP_SELF'].'?action=del_AGENDA_USE_EVENT_TYPE&token='.newToken().'">'.img_picto($langs->trans("Enabled"), 'switch_on').'</a>';
345 }
346 print '</td></tr>'."\n";
347 
348 if (!empty($conf->global->AGENDA_USE_EVENT_TYPE)) {
349  print '<!-- AGENDA_USE_EVENT_TYPE_DEFAULT -->';
350  print '<tr class="oddeven">'."\n";
351  print '<td>'.$langs->trans("AGENDA_USE_EVENT_TYPE_DEFAULT").'</td>'."\n";
352  print '<td class="center">&nbsp;</td>'."\n";
353  print '<td class="right nowrap">'."\n";
354  $formactions->select_type_actions($conf->global->AGENDA_USE_EVENT_TYPE_DEFAULT, "AGENDA_USE_EVENT_TYPE_DEFAULT", 'systemauto', 0, 1);
355  print '</td></tr>'."\n";
356 }
357 
358 // AGENDA_EVENT_DEFAULT_STATUS
359 print '<tr class="oddeven">'."\n";
360 print '<td>'.$langs->trans("AGENDA_EVENT_DEFAULT_STATUS").'</td>'."\n";
361 print '<td class="center">&nbsp;</td>'."\n";
362 print '<td class="right nowrap">'."\n";
363 $defval = 'na';
364 $defaultValues = new DefaultValues($db);
365 $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));
366 if (!is_array($result) && $result < 0) {
367  setEventMessages($defaultValues->error, $defaultValues->errors, 'errors');
368 } elseif (count($result) > 0) {
369  $defval = reset($result)->value;
370 }
371 $formactions->form_select_status_action('agenda', $defval, 1, "AGENDA_EVENT_DEFAULT_STATUS", 0, 1, 'maxwidth200 onrightofpage');
372 print '</td></tr>'."\n";
373 
374 // AGENDA_DEFAULT_FILTER_TYPE
375 print '<tr class="oddeven">'."\n";
376 print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_TYPE").'</td>'."\n";
377 print '<td class="center">&nbsp;</td>'."\n";
378 print '<td class="right nowrap">'."\n";
379 $multiselect = 0;
380 if (!empty($conf->global->MAIN_ENABLE_MULTISELECT_TYPE)) {
381  // We use an option here because it adds bugs when used on agenda page "peruser" and "list"
382  $multiselect = (!empty($conf->global->AGENDA_USE_EVENT_TYPE));
383 }
384 $formactions->select_type_actions($conf->global->AGENDA_DEFAULT_FILTER_TYPE, "AGENDA_DEFAULT_FILTER_TYPE", '', (empty($conf->global->AGENDA_USE_EVENT_TYPE) ? 1 : -1), 1, $multiselect);
385 print '</td></tr>'."\n";
386 
387 // AGENDA_DEFAULT_FILTER_STATUS
388 // TODO Remove to use the default generic feature
389 print '<tr class="oddeven">'."\n";
390 print '<td>'.$langs->trans("AGENDA_DEFAULT_FILTER_STATUS").'</td>'."\n";
391 print '<td class="center">&nbsp;</td>'."\n";
392 print '<td class="right">'."\n";
393 $formactions->form_select_status_action('agenda', getDolGlobalString('AGENDA_DEFAULT_FILTER_STATUS'), 1, 'AGENDA_DEFAULT_FILTER_STATUS', 1, 2, 'minwidth100');
394 print '</td></tr>'."\n";
395 
396 print '</table>';
397 
398 print dol_get_fiche_end();
399 
400 print $form->buttonsSaveCancel("Save", '');
401 
402 print '</form>';
403 
404 print "<br>";
405 
406 // End of page
407 llxFooter();
408 $db->close();
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1888
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:632
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:556
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1919
agenda_prepare_head()
Prepare array with list of tabs.
Definition: agenda.lib.php:364
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('facture') &&!empty($user->rights->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') &&!empty($user->rights->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)) $resql
Social contributions to pay.
Definition: index.php:745
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.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
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.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
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)
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.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) 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.