dolibarr  16.0.5
stocktransfer.php
1 <?php
2 /* Copyright (C) 2004-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2021 Gauthier VERDOL <gauthier.verdol@atm-consulting.fr>
4  * Copyright (C) 2021 SuperAdmin
5  *
6  * This program is free software: you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation, either version 3 of the License, or
9  * (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <https://www.gnu.org/licenses/>.
18  */
19 
26 // Load Dolibarr environment
27 $res = 0;
28 // Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
29 if (!$res && !empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res = @include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
30 // Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
31 $tmp = empty($_SERVER['SCRIPT_FILENAME']) ? '' : $_SERVER['SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
32 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
33 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1))."/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1))."/main.inc.php";
34 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";
35 // Try main.inc.php using relative path
36 if (!$res && file_exists("../main.inc.php")) $res = @include "../main.inc.php";
37 if (!$res && file_exists("../../main.inc.php")) $res = @include "../../main.inc.php";
38 if (!$res && file_exists("../../../main.inc.php")) $res = @include "../../../main.inc.php";
39 if (!$res) die("Include of main fails");
40 
41 global $langs, $user;
42 
43 // Libraries
44 require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
45 require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/class/stocktransfer.class.php';
46 require_once DOL_DOCUMENT_ROOT.'/product/stock/stocktransfer/lib/stocktransfer.lib.php';
47 
48 // Translations
49 $langs->loadLangs(array("admin", "stocks"));
50 
51 // Access control
52 if (!$user->admin) accessforbidden();
53 
54 // Parameters
55 $action = GETPOST('action', 'alpha');
56 $backtopage = GETPOST('backtopage', 'alpha');
57 
58 $value = GETPOST('value', 'alpha');
59 
60 $arrayofparameters = array(
61  'STOCKTRANSFER_MYPARAM1'=>array('css'=>'minwidth200', 'enabled'=>1),
62  'STOCKTRANSFER_MYPARAM2'=>array('css'=>'minwidth500', 'enabled'=>1)
63 );
64 
65 $error = 0;
66 $setupnotempty = 0;
67 
68 
69 /*
70  * Actions
71  */
72 
73 if ((float) DOL_VERSION >= 6) {
74  include DOL_DOCUMENT_ROOT.'/core/actions_setmoduleoptions.inc.php';
75 }
76 
77 if ($action == 'updateMask') {
78  $maskconststocktransfer = GETPOST('maskconststocktransfer', 'alpha');
79  $maskstocktransfer = GETPOST('maskStockTransfer', 'alpha');
80 
81  if ($maskconststocktransfer) {
82  $res = dolibarr_set_const($db, $maskconststocktransfer, $maskstocktransfer, 'chaine', 0, '', $conf->entity);
83  if ($res <= 0) $error++;
84  }
85 
86  if (!$error) {
87  setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
88  } else {
89  setEventMessages($langs->trans("Error"), null, 'errors');
90  }
91 } elseif ($action == 'specimen') {
92  $modele = GETPOST('module', 'alpha');
93  $tmpobjectkey = 'StockTransfer';
94 
95  $tmpobject = new $tmpobjectkey($db);
96  $tmpobject->initAsSpecimen();
97 
98  // Search template files
99  $file = ''; $classname = ''; $filefound = 0;
100  $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
101  foreach ($dirmodels as $reldir) {
102  $file = dol_buildpath($reldir."core/modules/stocktransfer/doc/pdf_".$modele.".modules.php", 0);
103  if (file_exists($file)) {
104  $filefound = 1;
105  $classname = "pdf_".$modele;
106  break;
107  }
108  }
109 
110  if ($filefound) {
111  require_once $file;
112 
113  $module = new $classname($db);
114 
115  if ($module->write_file($tmpobject, $langs) > 0) {
116  header("Location: ".DOL_URL_ROOT."/document.php?modulepart=".strtolower($tmpobjectkey)."&file=SPECIMEN.pdf");
117  return;
118  } else {
119  setEventMessages($module->error, null, 'errors');
120  dol_syslog($module->error, LOG_ERR);
121  }
122  } else {
123  setEventMessages($langs->trans("ErrorModuleNotFound"), null, 'errors');
124  dol_syslog($langs->trans("ErrorModuleNotFound"), LOG_ERR);
125  }
126 } elseif ($action == 'set') { // Activate a model
127  $ret = addDocumentModel($value, 'stocktransfer', $label, $scandir);
128 } elseif ($action == 'del') {
129  $tmpobjectkey = 'StockTransfer';
130 
131  $ret = delDocumentModel($value, 'stocktransfer');
132  if ($ret > 0) {
133  $constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
134  if ($conf->global->$constforval == "$value") dolibarr_del_const($db, $constforval, $conf->entity);
135  }
136 } elseif ($action == 'setdoc') { // Set default model
137  $tmpobjectkey = 'StockTransfer';
138  $constforval = strtoupper($tmpobjectkey).'_ADDON_PDF';
139  if (dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity)) {
140  // The constant that was read before the new set
141  // We therefore requires a variable to have a coherent view
142  $conf->global->$constforval = $value;
143  }
144 
145  // On active le modele
146  $ret = delDocumentModel($value, 'stocktransfer');
147  if ($ret > 0) {
148  $ret = addDocumentModel($value, 'stocktransfer', $label, $scandir);
149  }
150 } elseif ($action == 'setmod') {
151  // TODO Check if numbering module chosen can be activated
152  // by calling method canBeActivated
153  $tmpobjectkey = 'StockTransfer';
154  $constforval = 'STOCKTRANSFER_'.strtoupper($tmpobjectkey)."_ADDON";
155  dolibarr_set_const($db, $constforval, $value, 'chaine', 0, '', $conf->entity);
156 }
157 
158 
159 
160 /*
161  * View
162  */
163 
164 $form = new Form($db);
165 
166 $dirmodels = array_merge(array('/'), (array) $conf->modules_parts['models']);
167 
168 $page_name = "StockTransferSetup";
169 llxHeader('', $langs->trans($page_name));
170 
171 // Subheader
172 $linkback = '<a href="'.($backtopage ? $backtopage : DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1').'">'.$langs->trans("BackToModuleList").'</a>';
173 
174 print load_fiche_titre($langs->trans($page_name), $linkback, 'stock');
175 
176 // Configuration header
178 print dol_get_fiche_head($head, 'settings', '', -1, "stocktransfer@stocktransfer");
179 
180 // Setup page goes here
181 print '<span class="opacitymedium">'.$langs->trans("StockTransferSetupPage").'</span>';
182 
183 
184 /*if ($action == 'edit')
185 {
186  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
187  print '<input type="hidden" name="token" value="'.newToken().'">';
188  print '<input type="hidden" name="action" value="update">';
189 
190  print '<table class="noborder centpercent">';
191  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
192 
193  foreach ($arrayofparameters as $key => $val)
194  {
195  print '<tr class="oddeven"><td>';
196  $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
197  print $form->textwithpicto($langs->trans($key), $tooltiphelp);
198  print '</td><td><input name="'.$key.'" class="flat '.(empty($val['css']) ? 'minwidth200' : $val['css']).'" value="'.getDolGlobalString($key).'"></td></tr>';
199  }
200  print '</table>';
201 
202  print '<br><div class="center">';
203  print '<input class="button" type="submit" value="'.$langs->trans("Save").'">';
204  print '</div>';
205 
206  print '</form>';
207  print '<br>';
208 } else {
209  if (!empty($arrayofparameters))
210  {
211  print '<table class="noborder centpercent">';
212  print '<tr class="liste_titre"><td class="titlefield">'.$langs->trans("Parameter").'</td><td>'.$langs->trans("Value").'</td></tr>';
213 
214  foreach ($arrayofparameters as $key => $val)
215  {
216  $setupnotempty++;
217 
218  print '<tr class="oddeven"><td>';
219  $tooltiphelp = (($langs->trans($key.'Tooltip') != $key.'Tooltip') ? $langs->trans($key.'Tooltip') : '');
220  print $form->textwithpicto($langs->trans($key), $tooltiphelp);
221  print '</td><td>'.getDolGlobalString($key).'</td></tr>';
222  }
223 
224  print '</table>';
225 
226  print '<div class="tabsAction">';
227  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=edit">'.$langs->trans("Modify").'</a>';
228  print '</div>';
229  }
230  else
231  {
232  print '<br>'.$langs->trans("NothingToSetup");
233  }
234 }*/
235 
236 
237 $moduledir = 'stocktransfer';
238 $myTmpObjects = array();
239 $myTmpObjects[$moduledir]=array('includerefgeneration'=>1, 'includedocgeneration'=>1);
240 
241 foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
242  if ($myTmpObjectKey == 'MyObject') continue;
243  if ($myTmpObjectArray['includerefgeneration']) {
244  /*
245  * Orders Numbering model
246  */
247  $setupnotempty++;
248 
249  print load_fiche_titre($langs->trans("NumberingModules", $myTmpObjectKey), '', '');
250 
251  print '<table class="noborder centpercent">';
252  print '<tr class="liste_titre">';
253  print '<td>'.$langs->trans("Name").'</td>';
254  print '<td>'.$langs->trans("Description").'</td>';
255  print '<td class="nowrap">'.$langs->trans("Example").'</td>';
256  print '<td class="center" width="60">'.$langs->trans("Status").'</td>';
257  print '<td class="center" width="16">'.$langs->trans("ShortInfo").'</td>';
258  print '</tr>'."\n";
259 
260  clearstatcache();
261 
262  foreach ($dirmodels as $reldir) {
263  $dir = dol_buildpath($reldir."core/modules/".$moduledir);
264 
265  if (is_dir($dir)) {
266  $handle = opendir($dir);
267  if (is_resource($handle)) {
268  while (($file = readdir($handle)) !== false) {
269  if (strpos($file, 'mod_'.strtolower($myTmpObjectKey).'_') === 0 && substr($file, dol_strlen($file) - 3, 3) == 'php') {
270  $file = substr($file, 0, dol_strlen($file) - 4);
271 
272  require_once $dir.'/'.$file.'.php';
273 
274  $module = new $file($db);
275 
276  // Show modules according to features level
277  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) continue;
278  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) continue;
279 
280  if ($module->isEnabled()) {
281  dol_include_once('/'.$moduledir.'/class/'.strtolower($myTmpObjectKey).'.class.php');
282 
283  print '<tr class="oddeven"><td>'.$module->name."</td><td>\n";
284  print $module->info();
285  print '</td>';
286 
287  // Show example of numbering model
288  print '<td class="nowrap">';
289  $tmp = $module->getExample();
290  if (preg_match('/^Error/', $tmp)) print '<div class="error">'.$langs->trans($tmp).'</div>';
291  elseif ($tmp == 'NotConfigured') print $langs->trans($tmp);
292  else print $tmp;
293  print '</td>'."\n";
294 
295  print '<td class="center">';
296  $constforvar = 'STOCKTRANSFER_'.strtoupper($myTmpObjectKey).'_ADDON';
297  if ($conf->global->$constforvar == $file) {
298  print img_picto($langs->trans("Activated"), 'switch_on');
299  } else {
300  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setmod&object='.strtolower($myTmpObjectKey).'&value='.$file.'">';
301  print img_picto($langs->trans("Disabled"), 'switch_off');
302  print '</a>';
303  }
304  print '</td>';
305 
306  $mytmpinstance = new $myTmpObjectKey($db);
307  $mytmpinstance->initAsSpecimen();
308 
309  // Info
310  $htmltooltip = '';
311  $htmltooltip .= ''.$langs->trans("Version").': <b>'.$module->getVersion().'</b><br>';
312 
313  $nextval = $module->getNextValue($mytmpinstance);
314  if ("$nextval" != $langs->trans("NotAvailable")) { // Keep " on nextval
315  $htmltooltip .= ''.$langs->trans("NextValue").': ';
316  if ($nextval) {
317  if (preg_match('/^Error/', $nextval) || $nextval == 'NotConfigured')
318  $nextval = $langs->trans($nextval);
319  $htmltooltip .= $nextval.'<br>';
320  } else {
321  $htmltooltip .= $langs->trans($module->error).'<br>';
322  }
323  }
324 
325  print '<td class="center">';
326  print $form->textwithpicto('', $htmltooltip, 1, 0);
327  print '</td>';
328 
329  print "</tr>\n";
330  }
331  }
332  }
333  closedir($handle);
334  }
335  }
336  }
337  print "</table><br>\n";
338  }
339 
340  if ($myTmpObjectArray['includedocgeneration']) {
341  /*
342  * Document templates generators
343  */
344  $setupnotempty++;
345  $type = strtolower($myTmpObjectKey);
346 
347  print load_fiche_titre($langs->trans("DocumentModules", $myTmpObjectKey), '', '');
348 
349  // Load array def with activated templates
350  $def = array();
351  $sql = "SELECT nom";
352  $sql .= " FROM ".MAIN_DB_PREFIX."document_model";
353  $sql .= " WHERE type = '".$db->escape($type)."'";
354  $sql .= " AND entity = ".$conf->entity;
355  $resql = $db->query($sql);
356  if ($resql) {
357  $i = 0;
358  $num_rows = $db->num_rows($resql);
359  while ($i < $num_rows) {
360  $array = $db->fetch_array($resql);
361  array_push($def, $array[0]);
362  $i++;
363  }
364  } else {
365  dol_print_error($db);
366  }
367 
368  print "<table class=\"noborder\" width=\"100%\">\n";
369  print "<tr class=\"liste_titre\">\n";
370  print '<td>'.$langs->trans("Name").'</td>';
371  print '<td>'.$langs->trans("Description").'</td>';
372  print '<td class="center" width="60">'.$langs->trans("Status")."</td>\n";
373  print '<td class="center" width="60">'.$langs->trans("Default")."</td>\n";
374  print '<td class="center" width="38">'.$langs->trans("ShortInfo").'</td>';
375  print '<td class="center" width="38">'.$langs->trans("Preview").'</td>';
376  print "</tr>\n";
377 
378  clearstatcache();
379 
380  foreach ($dirmodels as $reldir) {
381  foreach (array('', '/doc') as $valdir) {
382  $realpath = $reldir."core/modules/".$moduledir.$valdir;
383  $dir = dol_buildpath($realpath);
384 
385  if (is_dir($dir)) {
386  $handle = opendir($dir);
387  if (is_resource($handle)) {
388  while (($file = readdir($handle)) !== false) {
389  $filelist[] = $file;
390  }
391  closedir($handle);
392  arsort($filelist);
393 
394  foreach ($filelist as $file) {
395  if (preg_match('/\.modules\.php$/i', $file) && preg_match('/^(pdf_|doc_)/', $file)) {
396  if (file_exists($dir.'/'.$file)) {
397  $name = substr($file, 4, dol_strlen($file) - 16);
398  $classname = substr($file, 0, dol_strlen($file) - 12);
399 
400  require_once $dir.'/'.$file;
401  $module = new $classname($db);
402 
403  $modulequalified = 1;
404  if ($module->version == 'development' && $conf->global->MAIN_FEATURES_LEVEL < 2) $modulequalified = 0;
405  if ($module->version == 'experimental' && $conf->global->MAIN_FEATURES_LEVEL < 1) $modulequalified = 0;
406 
407  if ($modulequalified) {
408  print '<tr class="oddeven"><td width="100">';
409  print (empty($module->name) ? $name : $module->name);
410  print "</td><td>\n";
411  if (method_exists($module, 'info')) print $module->info($langs);
412  else print $module->description;
413  print '</td>';
414 
415  // Active
416  if (in_array($name, $def)) {
417  print '<td class="center">'."\n";
418  print '<a href="'.$_SERVER["PHP_SELF"].'?action=del&value='.$name.'">';
419  print img_picto($langs->trans("Enabled"), 'switch_on');
420  print '</a>';
421  print '</td>';
422  } else {
423  print '<td class="center">'."\n";
424  print '<a href="'.$_SERVER["PHP_SELF"].'?action=set&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').'</a>';
425  print "</td>";
426  }
427 
428  // Default
429  print '<td class="center">';
430  $constforvar = strtoupper($myTmpObjectKey).'_ADDON_PDF';
431  if ($conf->global->$constforvar == $name) {
432  print img_picto($langs->trans("Default"), 'on');
433  } else {
434  print '<a href="'.$_SERVER["PHP_SELF"].'?action=setdoc&object='.$myTmpObjectKey.'&value='.$name.'&amp;scan_dir='.$module->scandir.'&amp;label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').'</a>';
435  }
436  print '</td>';
437 
438  // Info
439  $htmltooltip = ''.$langs->trans("Name").': '.$module->name;
440  $htmltooltip .= '<br>'.$langs->trans("Type").': '.($module->type ? $module->type : $langs->trans("Unknown"));
441  if ($module->type == 'pdf') {
442  $htmltooltip .= '<br>'.$langs->trans("Width").'/'.$langs->trans("Height").': '.$module->page_largeur.'/'.$module->page_hauteur;
443  }
444  $htmltooltip .= '<br>'.$langs->trans("Path").': '.preg_replace('/^\//', '', $realpath).'/'.$file;
445 
446  $htmltooltip .= '<br><br><u>'.$langs->trans("FeaturesSupported").':</u>';
447  $htmltooltip .= '<br>'.$langs->trans("Logo").': '.yn($module->option_logo, 1, 1);
448  $htmltooltip .= '<br>'.$langs->trans("MultiLanguage").': '.yn($module->option_multilang, 1, 1);
449 
450  print '<td class="center">';
451  print $form->textwithpicto('', $htmltooltip, 1, 0);
452  print '</td>';
453 
454  // Preview
455  print '<td class="center">';
456  if ($module->type == 'pdf') {
457  print '<a href="'.$_SERVER["PHP_SELF"].'?action=specimen&module='.$name.'&object='.$myTmpObjectKey.'">'.img_object($langs->trans("Preview"), 'generic').'</a>';
458  } else {
459  print img_object($langs->trans("PreviewNotAvailable"), 'generic');
460  }
461  print '</td>';
462 
463  print "</tr>\n";
464  }
465  }
466  }
467  }
468  }
469  }
470  }
471  }
472 
473  print '</table>';
474  }
475 }
476 
477 if (empty($setupnotempty)) {
478  print '<br>'.$langs->trans("NothingToSetup");
479 }
480 
481 // Page end
482 print dol_get_fiche_end();
483 
484 llxFooter();
485 $db->close();
stocktransferAdminPrepareHead
stocktransferAdminPrepareHead()
Prepare admin pages header.
Definition: stocktransfer.lib.php:30
yn
yn($yesno, $case=1, $color=0)
Return yes or no in current language.
Definition: functions.lib.php:6491
llxFooter
llxFooter()
Empty footer.
Definition: wrapper.php:73
dolibarr_del_const
dolibarr_del_const($db, $name, $entity=1)
Delete a constant.
Definition: admin.lib.php:552
load_fiche_titre
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
Definition: functions.lib.php:5204
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:484
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:4844
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:1033
dol_buildpath
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
Definition: functions.lib.php:1062
else
if(!GETPOST('transkey', 'alphanohtml') &&!GETPOST('transphrase', 'alphanohtml')) else
View.
Definition: notice.php:53
$form
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
Definition: card.php:142
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:3880
delDocumentModel
delDocumentModel($name, $type)
Delete document model used by doc generator.
Definition: admin.lib.php:1894
dol_syslog
dol_syslog($message, $level=LOG_INFO, $ident=0, $suffixinfilename='', $restricttologhandler='', $logcontext=null)
Write log message into outputs.
Definition: functions.lib.php:1603
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:1822
dol_strlen
dol_strlen($string, $stringencoding='UTF-8')
Make a strlen call.
Definition: functions.lib.php:3747
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
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:627
addDocumentModel
addDocumentModel($name, $type, $label='', $description='')
Add document model used by doc generator.
Definition: admin.lib.php:1863
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:4211
$resql
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire)||(isModEnabled('supplier_invoice') && $user->rights->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->rights->commande->lire &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
Definition: index.php:742
setEventMessages
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
Definition: functions.lib.php:8137
accessforbidden
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 ...
Definition: security.lib.php:933
llxHeader
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
Definition: wrapper.php:59
if
if(!defined( 'CSRFCHECK_WITH_TOKEN'))
Definition: journals_list.php:25