dolibarr 21.0.3
orders_list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
7 * Copyright (C) 2024 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
30// Load Dolibarr environment
31require '../../main.inc.php';
32require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
33require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
34
44// Load translation files required by the page
45$langs->loadLangs(array('banks', 'categories', 'withdrawals'));
46
47$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
48$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
49$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
50$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
51$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
52$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search
53$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
54$optioncss = GETPOST('optioncss', 'alpha');
55$mode = GETPOST('mode', 'alpha');
56
57$type = GETPOST('type', 'aZ09');
58
59// Load variable for pagination
60$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
61$sortfield = GETPOST('sortfield', 'aZ09comma');
62$sortorder = GETPOST('sortorder', 'aZ09comma');
63$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
64if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
65 // If $page is not defined, or '' or -1 or if we click on clear filters
66 $page = 0;
67}
68$offset = $limit * $page;
69$pageprev = $page - 1;
70$pagenext = $page + 1;
71if (!$sortorder) {
72 $sortorder = "DESC";
73}
74if (!$sortfield) {
75 $sortfield = "p.datec";
76}
77
78// Get supervariables
79$statut = GETPOSTINT('statut');
80$search_ref = GETPOST('search_ref', 'alpha');
81$search_amount = GETPOST('search_amount', 'alpha');
82
83$bon = new BonPrelevement($db);
84$hookmanager->initHooks(array('withdrawalsreceiptslist'));
85
86$usercancreate = $user->hasRight('prelevement', 'bons', 'creer');
87$permissiontodelete = $user->hasRight('prelevement', 'creer');
88if ($type == 'bank-transfer') {
89 $usercancreate = $user->hasRight('paymentbybanktransfer', 'create');
90 $permissiontodelete = $user->hasRight('paymentbybanktransfer', 'create');
91}
92
93// Security check
94$socid = GETPOSTINT('socid');
95if ($user->socid) {
96 $socid = $user->socid;
97}
98if ($type == 'bank-transfer') {
99 $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
100} else {
101 $result = restrictedArea($user, 'prelevement', '', '', 'bons');
102}
103
104
105/*
106 * Actions
107 */
108$error = 0;
109
110if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
111 $search_ref = "";
112 $search_amount = "";
113}
114
115// Mass actions
116
117// Delete draft
118if (($massaction == "delete" || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) {
119 $TMsg = array();
120 $db->begin();
121 $objecttmp = new BonPrelevement($db);
122 $nbignored = 0;
123 $nbok = 0;
124 foreach ($toselect as $toselectid) {
125 $result = $objecttmp->fetch($toselectid);
126 if ($result > 0) {
127 if ($objecttmp->status != $objecttmp::STATUS_DRAFT || $objecttmp->credite > 0 || $objecttmp->date_creation != null) {
128 $langs->load("errors");
129 $nbignored++;
130 $TMsg[] = '<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
131 continue;
132 }
133 $result = $objecttmp->delete($user);
134 if ($result < 0) { // if delete returns is < 0, there is an error, we break and rollback later
135 setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
136 $error++;
137 break;
138 } else {
139 $nbok++;
140 }
141 } else {
142 setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
143 $error++;
144 break;
145 }
146 }
147 if (empty($error)) {
148 // Message for elements well deleted
149 if ($nbok > 1) {
150 setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
151 } elseif ($nbok > 0) {
152 setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
153 } else {
154 setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
155 }
156
157 // Message for elements which can't be deleted
158 if (!empty($TMsg)) {
159 sort($TMsg);
160 setEventMessages('', array_unique($TMsg), 'warnings');
161 }
162
163 $db->commit();
164 } else {
165 $db->rollback();
166 }
167 $massaction = '';
168}
169$objectclass = 'BonPrelevement';
170$objectlabel = 'BonPrelevement';
171if ($type == 'bank-transfer') {
172 $uploaddir = $conf->paymentbybanktransfer->dir_output;
173} else {
174 $uploaddir = $conf->prelevement->dir_output;
175}
176include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
177
178
179/*
180 * View
181 */
182
183$form = new Form($db);
184$directdebitorder = new BonPrelevement($db);
185
186$titlekey = "WithdrawalsReceipts";
187$title = $langs->trans("WithdrawalsReceipts");
188if ($type == 'bank-transfer') {
189 $titlekey = "BankTransferReceipts";
190 $title = $langs->trans("BankTransferReceipts");
191}
192$help_url = '';
193
194
195$sql = "SELECT p.rowid, p.ref, p.amount, p.statut, p.datec";
196
197$sqlfields = $sql; // $sql fields to remove for count total
198
199$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
200$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
201if ($type == 'bank-transfer') {
202 $sql .= " AND p.type = 'bank-transfer'";
203} else {
204 $sql .= " AND p.type = 'debit-order'";
205}
206if ($search_ref) {
207 $sql .= natural_search("p.ref", $search_ref);
208}
209if ($search_amount) {
210 $sql .= natural_search("p.amount", $search_amount, 1);
211}
212
213// Count total nb of records
214$nbtotalofrecords = '';
215if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
216 /* The fast and low memory method to get and count full list converts the sql into a sql count */
217 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
218 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
219 $resql = $db->query($sqlforcount);
220 if ($resql) {
221 $objforcount = $db->fetch_object($resql);
222 $nbtotalofrecords = $objforcount->nbtotalofrecords;
223 } else {
224 dol_print_error($db);
225 }
226
227 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
228 $page = 0;
229 $offset = 0;
230 }
231 $db->free($resql);
232}
233
234// Complete request and execute it with limit
235$sql .= $db->order($sortfield, $sortorder);
236if ($limit) {
237 $sql .= $db->plimit($limit + 1, $offset);
238}
239
240$resql = $db->query($sql);
241if (!$resql) {
242 dol_print_error($db);
243 exit;
244}
245
246$num = $db->num_rows($resql);
247
248// Output page
249// --------------------------------------------------------------------
250
251llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist');
252
253$arrayofselected = is_array($toselect) ? $toselect : array();
254$param = '';
255$param .= "&statut=".urlencode((string) ($statut));
256if ($type == 'bank-transfer') {
257 $param .= '&type=bank-transfer';
258}
259if (!empty($mode)) {
260 $param .= '&mode='.urlencode($mode);
261}
262if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
263 $param .= '&contextpage='.urlencode($contextpage);
264}
265if ($limit > 0 && $limit != $conf->liste_limit) {
266 $param .= '&limit='.((int) $limit);
267}
268if ($optioncss != '') {
269 $param .= '&optioncss='.urlencode($optioncss);
270}
271
272$arrayofmassactions = array(
273 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
274 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
275);
276if (!empty($permissiontodelete)) {
277 $arrayofmassactions['predeletedraft'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
278}
279$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
280
281print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
282print '<input type="hidden" name="token" value="'.newToken().'">';
283if ($optioncss != '') {
284 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
285}
286print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
287print '<input type="hidden" name="action" value="list">';
288print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
289print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
290print '<input type="hidden" name="page" value="'.$page.'">';
291print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
292print '<input type="hidden" name="page_y" value="">';
293print '<input type="hidden" name="mode" value="'.$mode.'">';
294
295if ($type != '') {
296 print '<input type="hidden" name="type" value="'.$type.'">';
297}
298
299$newcardbutton = '';
300$newcardbutton .= dolGetButtonTitle($langs->trans('ViewList'), '', 'fa fa-bars imgforviewmode', $_SERVER["PHP_SELF"].'?mode=common'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ((empty($mode) || $mode == 'common') ? 2 : 1), array('morecss' => 'reposition'));
301$newcardbutton .= dolGetButtonTitle($langs->trans('ViewKanban'), '', 'fa fa-th-list imgforviewmode', $_SERVER["PHP_SELF"].'?mode=kanban'.preg_replace('/(&|\?)*mode=[^&]+/', '', $param), '', ($mode == 'kanban' ? 2 : 1), array('morecss' => 'reposition'));
302if ($usercancreate) {
303 $newcardbutton .= dolGetButtonTitleSeparator();
304 $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type));
305}
306
307print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
308
309include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
310
311
312$moreforfilter = '';
313/*$moreforfilter.='<div class="divsearchfield">';
314 $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
315 $moreforfilter.= '</div>';*/
316
317$parameters = array();
318$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
319if (empty($reshook)) {
320 $moreforfilter .= $hookmanager->resPrint;
321} else {
322 $moreforfilter = $hookmanager->resPrint;
323}
324
325if (!empty($moreforfilter)) {
326 print '<div class="liste_titre liste_titre_bydiv centpercent">';
327 print $moreforfilter;
328 print '</div>';
329}
330
331$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
332$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
333$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
334$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
335
336print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
337print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
338
339// Fields title search
340// --------------------------------------------------------------------
341print '<tr class="liste_titre_filter">';
342// Action column
343if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
344 print '<td class="liste_titre center maxwidthsearch">';
345 $searchpicto = $form->showFilterButtons('left');
346 print $searchpicto;
347 print '</td>';
348}
349print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
350print '<td class="liste_titre">&nbsp;</td>';
351print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
352print '<td class="liste_titre">&nbsp;</td>';
353// Action column
354if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
355 print '<td class="liste_titre center maxwidthsearch">';
356 $searchpicto = $form->showFilterButtons();
357 print $searchpicto;
358 print '</td>';
359}
360print '</tr>'."\n";
361
362$totalarray = array();
363$totalarray['nbfield'] = 0;
364
365// Fields title label
366// --------------------------------------------------------------------
367print '<tr class="liste_titre">';
368// Action column
369if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
370 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
371 $totalarray['nbfield']++;
372}
373print_liste_field_titre($titlekey, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
374$totalarray['nbfield']++;
375print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
376$totalarray['nbfield']++;
377print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right ');
378$totalarray['nbfield']++;
379print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'right ');
380$totalarray['nbfield']++;
381// Action column
382if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
383 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
384 $totalarray['nbfield']++;
385}
386print '</tr>'."\n";
387
388// Loop on record
389// --------------------------------------------------------------------
390
391$i = 0;
392$savnbfield = $totalarray['nbfield'];
393$totalarray = array();
394$totalarray['nbfield'] = 0;
395
396$imaxinloop = ($limit ? min($num, $limit) : $num);
397while ($i < $imaxinloop) {
398 $obj = $db->fetch_object($resql);
399
400 $directdebitorder->id = $obj->rowid;
401 $directdebitorder->ref = $obj->ref;
402 $directdebitorder->date_echeance = $obj->datec;
403 $directdebitorder->total = $obj->amount;
404 $directdebitorder->statut = $obj->statut;
405
406 $object = $directdebitorder;
407
408 if ($mode == 'kanban') {
409 if ($i == 0) {
410 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
411 print '<div class="box-flex-container kanban">';
412 }
413 // Output Kanban
414 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
415 $selected = 0;
416 if (in_array($object->id, $arrayofselected)) {
417 $selected = 1;
418 }
419 }
420 print $directdebitorder->getKanbanView('', array('selected' => in_array($obj->id, $arrayofselected)));
421 if ($i == ($imaxinloop - 1)) {
422 print '</div>';
423 print '</td></tr>';
424 }
425 } else {
426 // Show line of result
427 $j = 0;
428 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
429
430 // Action column
431 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
432 print '<td class="nowrap center">';
433 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
434 $selected = 0;
435 if (in_array($object->id, $arrayofselected)) {
436 $selected = 1;
437 }
438 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
439 }
440 print '</td>';
441 if (!$i) {
442 $totalarray['nbfield']++;
443 }
444 }
445
446 print '<td>';
447 print $directdebitorder->getNomUrl(1);
448 print "</td>\n";
449
450 print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
451
452 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
453
454 print '<td class="right">';
455 print $bon->LibStatut($obj->statut, 5);
456 print '</td>';
457
458 // Action column
459 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
460 print '<td class="nowrap center">';
461 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
462 $selected = 0;
463 if (in_array($object->id, $arrayofselected)) {
464 $selected = 1;
465 }
466 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
467 }
468 print '</td>';
469 if (!$i) {
470 $totalarray['nbfield']++;
471 }
472 }
473
474 print '</tr>'."\n";
475 }
476 $i++;
477}
478
479if ($num == 0) {
480 print '<tr><td colspan="5"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
481}
482
483$db->free($resql);
484
485$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
486$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
487print $hookmanager->resPrint;
488
489print '</table>'."\n";
490print '</div>'."\n";
491
492print '</form>'."\n";
493
494
495// End of page
496llxFooter();
497$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:87
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:71
Class to manage withdrawal receipts.
Class to manage generation of HTML components Only common components must be here.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
natural_search($fields, $value, $mode=0, $nofirstand=0)
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
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 a Dolibarr global constant string value.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
Definition member.php:79
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.