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