dolibarr  18.0.0-alpha
workstation.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2020 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
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 // Libraries
29 require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
30 require_once DOL_DOCUMENT_ROOT.'/workstation/lib/workstation.lib.php';
31 //require_once "../class/myclass.class.php";
32 
33 // Translations
34 $langs->loadLangs(array("admin", "workstation"));
35 
36 // Parameters
37 $action = GETPOST('action', 'aZ09');
38 $backtopage = GETPOST('backtopage', 'alpha');
39 $modulepart = GETPOST('modulepart', 'aZ09'); // Used by actions_setmoduleoptions.inc.php
40 
41 $value = GETPOST('value', 'alpha');
42 
43 /*$arrayofparameters = array(
44  'WORKSTATION_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1),
45  'WORKSTATION_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1)
46 );*/
47 
48 $error = 0;
49 $setupnotempty = 0;
50 
51 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
52 
53 // Access control
54 if (!$user->admin) {
56 }
57 
58 
59 /*
60  * Actions
61  */
62 
63 include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
64 
65 if ($action == 'updateMask') {
66  $maskconst = GETPOST('maskconstWorkstation', 'aZ09');
67  $maskorder = GETPOST('maskWorkstation', 'alpha');
68 
69  if ($maskconst && preg_match('/_MASK$/', $maskconst)) {
70  $res = dolibarr_set_const($db, $maskconst, $maskorder, 'chaine', 0, '', $conf->entity);
71  }
72 
73  if (!($res > 0)) {
74  $error++;
75  }
76 
77  if (!$error) {
78  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
79  } else {
80  setEventMessages($langs->trans("Error"), null, 'errors');
81  }
82 } elseif ($action == 'specimen') {
83  $modele = GETPOST('module', 'alpha');
84  $tmpobjectkey = GETPOST('object');
85 
86  $tmpobject = new $tmpobjectkey($db);
87  $tmpobject->initAsSpecimen();
88 
89  // Search template files
90  $file = ''; $classname = ''; $filefound = 0;
91  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
92  foreach ($dirmodels as $reldir) {
93  $file = dol_buildpath($reldir."core/modules/workstation/doc/pdf_".$modele."_".strtolower($tmpobjectkey).".modules.php", 0);
94  if (file_exists($file)) {
95  $filefound = 1;
96  $classname = "pdf_".$modele;
97  break;
98  }
99  }
100 
101  if ($filefound) {
102  require_once $file;
103 
104  $module = new $classname($db);
105 
106  if ($module->write_file($tmpobject, $langs) > 0) {
107  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
108  return;
109  } else {
110  setEventMessages($module->error, null, 'errors');
111  dol_syslog($module->error, LOG_ERR);
112  }
113  } else {
114  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
115  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
116  }
117 } elseif ($action == 'set') {
118  // Activate a model
119  $ret = addDocumentModel($value, $type, $label, $scandir);
120 } elseif ($action == 'del') {
121  $tmpobjectkey = GETPOST('object');
122 
123  $ret = delDocumentModel($value, $type);
124  if ($ret > 0) {
125  $constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
126  if ($conf->global->$constforval == "$value") {
127  dolibarr_del_const($db, $constforval, $conf->entity);
128  }
129  }
130 } elseif ($action == 'setdoc') {
131  // Set default model
132  $tmpobjectkey = GETPOST('object');
133  $constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
134  if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
135  // The constant that was read before the new set
136  // We therefore requires a variable to have a coherent view
137  $conf->global->$constforval = $value;
138  }
139 
140  // On active le modele
141  $ret = delDocumentModel($value, $type);
142  if ($ret > 0) {
143  $ret = addDocumentModel($value, $type, $label, $scandir);
144  }
145 } elseif ($action == 'setmod') {
146  // TODO Check if numbering module chosen can be activated
147  // by calling method canBeActivated
148  $tmpobjectkey = GETPOST('object');
149  $constforval = 'WORKSTATION_'.strtoupper($tmpobjectkey)."_ADDON";
150  dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
151 }
152 
153 
154 
155 /*
156  * View
157  */
158 
159 $form = new Form($db);
160 
161 $help_url = '';
162 $page_name = "WorkstationSetup";
163 
164 llxHeader('', $langs->trans($page_name), $help_url);
165 
166 // Subheader
167 $linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
168 
169 print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
170 
171 // Configuration header
173 print dol_get_fiche_head($head, 'settings', $langs->trans($page_name), -1, "workstation");
174 
175 // Setup page goes here
176 //echo '<span class="opacitymedium">'.$langs->trans("WorkstationSetupPage").'</span><br><br>';
177 
178 
179 if ($action == 'edit') {
180  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
181  print '<input type="hidden" name="token" value="'.newToken().'">';
182  print '<input type="hidden" name="action" value="update">';
183 
184  print '<table class="noborder centpercent">';
185  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
186 
187  foreach ($arrayofparameters as $key => $val) {
188  print '<tr class="oddeven"><td>';
189  $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
190  print $form->textwithpicto($langs->trans($key), $tooltiphelp);
191  print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
192  }
193  print '</table>';
194 
195  print '<br><div class="center">';
196  print '<input class="button button-save" type="submit" value="'.$langs->trans("Save").'">';
197  print '</div>';
198 
199  print '</form>';
200  print '<br>';
201 } else {
202  if (!empty($arrayofparameters)) {
203  print '<table class="noborder centpercent">';
204  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
205 
206  foreach ($arrayofparameters as $key => $val) {
207  $setupnotempty++;
208 
209  print '<tr class="oddeven"><td>';
210  $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
211  print $form->textwithpicto($langs->trans($key), $tooltiphelp);
212  print '</td><td>'.getDolGlobalString($key).'</td></tr>';
213  }
214 
215  print '</table>';
216 
217  print '<div class="tabsAction">';
218  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>';
219  print '</div>';
220  }/* else {
221  print '<br>'.$langs->trans("NothingToSetup");
222  }*/
223 }
224 
225 
226 $moduledir = 'workstation';
227 $myTmpObjects = array();
228 $myTmpObjects['workstation'] = array('includerefgeneration'=>1, 'includedocgeneration'=>0);
229 
230 
231 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
232  if ($myTmpObjectKey == 'MyObject') {
233  continue;
234  }
235  if ($myTmpObjectArray['includerefgeneration']) {
236  /*
237  * Orders Numbering model
238  */
239  $setupnotempty++;
240 
241  print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
242 
243  print '<table class="noborder centpercent">';
244  print '<tr class="liste_titre">';
245  print '<td>'.$langs->trans("Name").'</td>';
246  print '<td>'.$langs->trans("Description").'</td>';
247  print '<td class="nowrap">'.$langs->trans("Example").'</td>';
248  print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
249  print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
250  print '</tr>'."\n";
251 
252  clearstatcache();
253 
254  foreach ($dirmodels as $reldir) {
255  $dir = dol_buildpath($reldir."core/modules/".$moduledir);
256 
257  if (is_dir($dir)) {
258  $handle = opendir($dir);
259  if (is_resource($handle)) {
260  while (($file = readdir($handle)) !== false) {
261  if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
262  $file = substr($file, 0, dol_strlen($file) - 4);
263 
264  require_once $dir.'/'.$file.'.php';
265 
266  $module = new $file($db);
267 
268  // Show modules according to features level
269  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
270  continue;
271  }
272  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
273  continue;
274  }
275 
276  if ($module->isEnabled()) {
277  dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
278 
279  print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
280  print $module->info();
281  print '</td>';
282 
283  // Show example of numbering model
284  print '<td class="nowrap">';
285  $tmp = $module->getExample();
286  if (preg_match('/^Error/', $tmp)) {
287  $langs->load("errors");
288  print '<div class="error">'.$langs->trans($tmp).'</div>';
289  } elseif ($tmp == 'NotConfigured') {
290  print '<span class="opacitymedium">'.$langs->trans($tmp).'</span>';
291  } else {
292  print $tmp;
293  }
294  print '</td>'."\n";
295 
296  print '<td class="center">';
297  $constforvar = 'WORKSTATION_'.strtoupper($myTmpObjectKey).'_ADDON';
298  if (getDolGlobalString($constforvar) == $file) {
299  print img_picto($langs->trans("Activated"), 'switch_on');
300  } else {
301  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&token='.newToken().'&object='.strtolower($myTmpObjectKey).'&value='.urlencode($file).'">';
302  print img_picto($langs->trans("Disabled"), 'switch_off');
303  print '</a>';
304  }
305  print '</td>';
306 
307  $mytmpinstance = new $myTmpObjectKey($db);
308  $mytmpinstance->initAsSpecimen();
309 
310  // Info
311  $htmltooltip = '';
312  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
313 
314  $nextval = $module->getNextValue($mytmpinstance);
315  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
316  $htmltooltip .= ''.$langs->trans("NextValue").': ';
317  if ($nextval) {
318  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured') {
319  $nextval = $langs->trans($nextval);
320  }
321  $htmltooltip .= $nextval.'<br>';
322  } else {
323  $htmltooltip .= $langs->trans($module->error).'<br>';
324  }
325  }
326 
327  print '<td class="center">';
328  print $form->textwithpicto('', $htmltooltip, 1, 0);
329  print '</td>';
330 
331  print "</tr>\n";
332  }
333  }
334  }
335  closedir($handle);
336  }
337  }
338  }
339  print "</table><br>\n";
340  }
341 
342  if ($myTmpObjectArray['includedocgeneration']) {
343  /*
344  * Document templates generators
345  */
346  $setupnotempty++;
347  $type = strtolower($myTmpObjectKey);
348 
349  print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', '');
350 
351  // Load array def with activated templates
352  $def = array();
353  $sql = "SELECT nom";
354  $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
355  $sql .= " WHERE type = '".$db->escape($type)."'";
356  $sql .= " AND entity = ".$conf->entity;
357  $resql = $db->query($sql);
358  if ($resql) {
359  $i = 0;
360  $num_rows = $db->num_rows($resql);
361  while ($i < $num_rows) {
362  $array = $db->fetch_array($resql);
363  array_push($def, $array[0]);
364  $i++;
365  }
366  } else {
367  dol_print_error($db);
368  }
369 
370  print "<table class=\"noborder\" width=\"100%\">\n";
371  print "<tr class=\"liste_titre\">\n";
372  print '<td>'.$langs->trans("Name").'</td>';
373  print '<td>'.$langs->trans("Description").'</td>';
374  print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
375  print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
376  print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
377  print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
378  print "</tr>\n";
379 
380  clearstatcache();
381 
382  foreach ($dirmodels as $reldir) {
383  foreach (array('', '/doc') as $valdir) {
384  $realpath = $reldir."core/modules/".$moduledir.$valdir;
385  $dir = dol_buildpath($realpath);
386 
387  if (is_dir($dir)) {
388  $handle = opendir($dir);
389  if (is_resource($handle)) {
390  while (($file = readdir($handle)) !== false) {
391  $filelist[] = $file;
392  }
393  closedir($handle);
394  arsort($filelist);
395 
396  foreach ($filelist as $file) {
397  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
398  if (file_exists($dir.'/'.$file)) {
399  $name = substr($file, 4, dol_strlen($file) - 16);
400  $classname = substr($file, 0, dol_strlen($file) - 12);
401 
402  require_once $dir.'/'.$file;
403  $module = new $classname($db);
404 
405  $modulequalified = 1;
406  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) {
407  $modulequalified = 0;
408  }
409  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) {
410  $modulequalified = 0;
411  }
412 
413  if ($modulequalified) {
414  print '<tr class="oddeven"><td width="100">';
415  print (empty($module->name) ? $name : $module->name);
416  print "</td><td>\n";
417  if (method_exists($module, 'info')) {
418  print $module->info($langs);
419  } else {
420  print $module->description;
421  }
422  print '</td>';
423 
424  // Active
425  if (in_array($name, $def)) {
426  print '<td class="center">'."\n";
427  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&token='.newToken().'&value='.urlencode($name).'">';
428  print img_picto($langs->trans("Enabled"), 'switch_on');
429  print '</a>';
430  print '</td>';
431  } else {
432  print '<td class="center">'."\n";
433  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>';
434  print "</td>";
435  }
436 
437  // Default
438  print '<td class="center">';
439  $constforvar = 'WORKSTATION_'.strtoupper($myTmpObjectKey).'_ADDON';
440  if (getDolGlobalString($constforvar) == $name) {
441  print img_picto($langs->trans("Default"), 'on');
442  } else {
443  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&amp;token='.newToken().'&amp;value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
444  }
445  print '</td>';
446 
447  // Info
448  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
449  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
450  if ($module->type == 'pdf') {
451  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
452  }
453  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
454 
455  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
456  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
457  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
458 
459  print '<td class="center">';
460  print $form->textwithpicto('', $htmltooltip, 1, 0);
461  print '</td>';
462 
463  // Preview
464  print '<td class="center">';
465  if ($module->type == 'pdf') {
466  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'generic').'</a>';
467  } else {
468  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
469  }
470  print '</td>';
471 
472  print "</tr>\n";
473  }
474  }
475  }
476  }
477  }
478  }
479  }
480  }
481 
482  print '</table>';
483  }
484 }
485 
486 /*if (empty($setupnotempty)) {
487  print '<br>'.$langs->trans("NothingToSetup");
488 }*/
489 
490 // Page end
491 print dol_get_fiche_end();
492 
493 llxFooter();
494 $db->close();
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6699
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:70
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:557
$sql
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)) $sql
Social contributions to pay.
Definition: index.php:745
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5363
GETPOST
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Definition: functions.lib.php:530
dol_print_error
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
Definition: functions.lib.php:4994
dol_include_once
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname='')
Make an include_once using default root and alternate root if it fails.
Definition: functions.lib.php:1043
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1072
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:143
$help_url
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
img_picto
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
Definition: functions.lib.php:4025
llxHeader
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
delDocumentModel
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1929
workstationAdminPrepareHead
workstationAdminPrepareHead()
Prepare admin pages header.
Definition: workstation.lib.php:29
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1639
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1873
getDolGlobalString
if(!function_exists('utf8_encode')) if(!function_exists('utf8_decode')) getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
Definition: functions.lib.php:82
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3888
newToken
newToken()
Return the value of token currently saved into session with name 'newtoken'.
Definition: functions.lib.php:11317
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2069
dolibarr_set_const
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:633
addDocumentModel
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1898
Form
Class to manage generation of HTML components Only common components must be here.
Definition: html.form.class.php:52
img_object
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
Definition: functions.lib.php:4361
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8509
accessforbidden
accessforbidden($message='', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program.
Definition: security.lib.php:1106