dolibarr 21.0.0-beta
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2014-2024 Alexandre Spangaro <alexandre@inovea-conseil.com>
3 * Copyright (C) 2015-2024 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2015 Juanjo Menent <jmenent@2byte.es>
5 * Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
27// Load Dolibarr environment
28require '../main.inc.php';
29require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
30
39// Load translation files required by the page
40$langs->loadLangs(array("banks", "bills", "compta", "loan"));
41
42$search_all = trim(GETPOST('search_all', 'alphanohtml'));
43
44$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
45$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
46$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions?
47$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
48$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
49$toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
50$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)).basename(__FILE__, '.php')); // To manage different context of search
51$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
52$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
53$mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
54
55$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
56$sortfield = GETPOST('sortfield', 'aZ09comma');
57$sortorder = GETPOST('sortorder', 'aZ09comma');
58$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
59if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
60 // If $page is not defined, or '' or -1 or if we click on clear filters
61 $page = 0;
62}
63$offset = $limit * $page;
64$pageprev = $page - 1;
65$pagenext = $page + 1;
66
67// Initialize a technical objects
68$object = new Loan($db);
69$extrafields = new ExtraFields($db);
70$diroutputmassaction = $conf->loan->dir_output.'/temp/massgeneration/'.$user->id;
71$hookmanager->initHooks(array($contextpage));
72
73// Fetch optionals attributes and labels
74$extrafields->fetch_name_optionals_label($object->table_element);
75//$extrafields->fetch_name_optionals_label($object->table_element_line);
76
77$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
78
79// Default sort order (if not yet defined by previous GETPOST)
80if (!$sortfield) {
81 $sortfield = "l.rowid";
82}
83if (!$sortorder) {
84 $sortorder = "DESC";
85}
86
87// Definition of array of fields for columns
88$arrayfields = array();
89foreach ($object->fields as $key => $val) {
90 // If $val['visible']==0, then we never show the field
91 if (!empty($val['visible'])) {
92 $visible = (int) dol_eval((string) $val['visible'], 1);
93 $arrayfields['t.'.$key] = array(
94 'label'=>$val['label'],
95 'checked'=>(($visible < 0) ? 0 : 1),
96 'enabled'=>(abs($visible) != 3 && (bool) dol_eval($val['enabled'], 1)),
97 'position'=>$val['position'],
98 'help'=> isset($val['help']) ? $val['help'] : ''
99 );
100 }
101}
102// Extra fields
103include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
104
105$object->fields = dol_sort_array($object->fields, 'position');
106//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
107$arrayfields = dol_sort_array($arrayfields, 'position');
108
109$search_ref = GETPOST('search_ref', 'alpha');
110$search_label = GETPOST('search_label', 'alpha');
111$search_amount = GETPOST('search_amount', 'alpha');
112
113$permissiontoadd = $user->hasRight('loan', 'write');
114
115// Security check
116$socid = GETPOSTINT('socid');
117if ($user->socid) {
118 $socid = $user->socid;
119}
120$result = restrictedArea($user, 'loan', '', '', '');
121
122
123/*
124 * Actions
125 */
126
127if (GETPOST('cancel', 'alpha')) {
128 $action = 'list';
129 $massaction = '';
130}
131if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
132 $massaction = '';
133}
134
135$parameters = array();
136$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
137if ($reshook < 0) {
138 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
139}
140
141if (empty($reshook)) {
142 // Purge search criteria
143 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
144 $search_ref = "";
145 $search_label = "";
146 $search_amount = "";
147 }
148}
149
150
151/*
152 * View
153 */
154$form = new Form($db);
155$now = dol_now();
156
157$title = $langs->trans('Loans');
158$help_url = "EN:Module_Loan|FR:Module_Emprunt";
159
160// Build and execute select
161// --------------------------------------------------------------------
162$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.paid,";
163$sql .= " SUM(pl.amount_capital) as alreadypaid";
164
165$sqlfields = $sql; // $sql fields to remove for count total
166
167$sql .= " FROM ".MAIN_DB_PREFIX."loan as l";
168$linktopl = " LEFT JOIN ".MAIN_DB_PREFIX."payment_loan AS pl ON l.rowid = pl.fk_loan";
169$sql .= $linktopl;
170
171$sql .= " WHERE l.entity = ".$conf->entity;
172if ($search_amount) {
173 $sql .= natural_search("l.capital", $search_amount, 1);
174}
175if ($search_ref) {
176 $sql .= " AND l.rowid = ".((int) $search_ref);
177}
178if ($search_label) {
179 $sql .= natural_search("l.label", $search_label);
180}
181$sql .= " GROUP BY l.rowid, l.label, l.capital, l.paid, l.datestart, l.dateend";
182
183// Count total nb of records
184$nbtotalofrecords = '';
185if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
186 /* The fast and low memory method to get and count full list converts the sql into a sql count */
187 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
188 $sqlforcount = preg_replace('/'.preg_quote($linktopl, '/').'/', '', $sqlforcount);
189 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
190 $resql = $db->query($sqlforcount);
191 if ($resql) {
192 $objforcount = $db->fetch_object($resql);
193 $nbtotalofrecords = $objforcount->nbtotalofrecords;
194 } else {
195 dol_print_error($db);
196 }
197
198 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
199 $page = 0;
200 $offset = 0;
201 }
202 $db->free($resql);
203}
204
205// Complete request and execute it with limit
206$sql .= $db->order($sortfield, $sortorder);
207if ($limit) {
208 $sql .= $db->plimit($limit + 1, $offset);
209}
210
211$resql = $db->query($sql);
212if (!$resql) {
213 dol_print_error($db);
214 exit;
215}
216
217$num = $db->num_rows($resql);
218
219
220
221// Direct jump if only one record found
222if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
223 $obj = $db->fetch_object($resql);
224 $id = $obj->rowid;
225 header("Location: ".dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.((int) $id));
226 exit;
227}
228
229
230// Output page
231// --------------------------------------------------------------------
232
233llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-loan page-list');
234
235$arrayofselected = is_array($toselect) ? $toselect : array();
236
237$param = '';
238if (!empty($mode)) {
239 $param .= '&mode='.urlencode($mode);
240}
241if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
242 $param .= '&contextpage='.urlencode($contextpage);
243}
244if ($limit > 0 && $limit != $conf->liste_limit) {
245 $param .= '&limit='.((int) $limit);
246}
247if ($optioncss != '') {
248 $param .= '&optioncss='.urlencode($optioncss);
249}
250if ($search_ref) {
251 $param .= "&search_ref=".urlencode($search_ref);
252}
253if ($search_label) {
254 $param .= "&search_label=".urlencode($search_label);
255}
256if ($search_amount) {
257 $param .= "&search_amount=".urlencode($search_amount);
258}
259// Add $param from extra fields
260include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
261// Add $param from hooks
262$parameters = array('param' => &$param);
263$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
264$param .= $hookmanager->resPrint;
265
266// List of mass actions available
267$arrayofmassactions = array();
268if (!empty($permissiontodelete)) {
269 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
270}
271if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
272 $arrayofmassactions = array();
273}
274$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
275
276
277$url = DOL_URL_ROOT.'/loan/card.php?action=create';
278if (!empty($socid)) {
279 $url .= '&socid='.$socid;
280}
281$newcardbutton = '';
282$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'));
283$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'));
284$newcardbutton .= dolGetButtonTitleSeparator();
285$newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
286
287$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
288
289print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
290if ($optioncss != '') {
291 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
292}
293print '<input type="hidden" name="token" value="'.newToken().'">';
294print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
295print '<input type="hidden" name="action" value="list">';
296print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
297print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
298print '<input type="hidden" name="page" value="'.$page.'">';
299print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
300print '<input type="hidden" name="page_y" value="">';
301print '<input type="hidden" name="mode" value="'.$mode.'">';
302
303$newcardbutton = '';
304$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'));
305$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'));
306$newcardbutton .= dolGetButtonTitleSeparator();
307$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/loan/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
308
309print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'money-bill-alt', 0, $newcardbutton, '', $limit, 0, 0, 1);
310
311$moreforfilter = '';
312
313$parameters = array();
314$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
315if (empty($reshook)) {
316 $moreforfilter .= $hookmanager->resPrint;
317} else {
318 $moreforfilter = $hookmanager->resPrint;
319}
320
321if (!empty($moreforfilter)) {
322 print '<div class="liste_titre liste_titre_bydiv centpercent">';
323 print $moreforfilter;
324 print '</div>';
325}
326
327$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
328$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields with user setup
329$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
330$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
331
332print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
333print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
334
335// Fields title search
336// --------------------------------------------------------------------
337print '<tr class="liste_titre_filter">';
338// Action column
339if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
340 print '<td class="liste_titre center maxwidthsearch">';
341 $searchpicto = $form->showFilterButtons('left');
342 print $searchpicto;
343 print '</td>';
344}
345
346// Filter: Ref
347print '<td class="liste_titre"><input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'"></td>';
348
349// Filter: Label
350print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
351
352// Filter: Amount
353print '<td class="liste_titre right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
354
355// No filter: Date start
356print '<td class="liste_titre">&nbsp;</td>';
357
358// No filter: Date end
359print '<td class="liste_titre">&nbsp;</td>';
360
361// No filter: Status
362print '<td class="liste_titre"></td>';
363
364// Action column
365if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
366 print '<td class="liste_titre center maxwidthsearch">';
367 $searchpicto = $form->showFilterButtons();
368 print $searchpicto;
369 print '</td>';
370}
371print '</tr>'."\n";
372
373$totalarray = array();
374$totalarray['nbfield'] = 0;
375
376// Fields title label
377// --------------------------------------------------------------------
378print '<tr class="liste_titre">';
379// Action column
380if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
381 print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
382 $totalarray['nbfield']++;
383}
384print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "l.rowid", "", $param, "", $sortfield, $sortorder);
385$totalarray['nbfield']++;
386print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, '', $sortfield, $sortorder, 'left ');
387$totalarray['nbfield']++;
388print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, '', $sortfield, $sortorder, 'right ');
389$totalarray['nbfield']++;
390print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
391$totalarray['nbfield']++;
392print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
393$totalarray['nbfield']++;
394print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'center ');
395$totalarray['nbfield']++;
396if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
397 print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
398 $totalarray['nbfield']++;
399}
400print "</tr>\n";
401
402
403// Loop on record
404// --------------------------------------------------------------------
405$i = 0;
406$savnbfield = $totalarray['nbfield'];
407$totalarray = array();
408$totalarray['nbfield'] = 0;
409$imaxinloop = ($limit ? min($num, $limit) : $num);
410while ($i < $imaxinloop) {
411 $obj = $db->fetch_object($resql);
412 if (empty($obj)) {
413 break; // Should not happen
414 }
415
416 $object->id = $obj->rowid;
417 $object->ref = $obj->rowid;
418 $object->label = $obj->label;
419 $object->paid = $obj->paid;
420 $object->datestart= $db->jdate($obj->datestart);
421 $object->dateend = $db->jdate($obj->dateend);
422
423 if ($mode == 'kanban') {
424 if ($i == 0) {
425 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
426 print '<div class="box-flex-container kanban">';
427 }
428 // Output Kanban
429 $object->capital = $obj->capital;
430 $object->totalpaid = $obj->paid;
431
432 // Output Kanban
433 $selected = -1;
434 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
435 $selected = 0;
436 if (in_array($object->id, $arrayofselected)) {
437 $selected = 1;
438 }
439 }
440 print $object->getKanbanView('', array('selected' => $selected));
441 if ($i == ($imaxinloop - 1)) {
442 print '</div>';
443 print '</td></tr>';
444 }
445 } else {
446 // Show line of result
447 $j = 0;
448 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
449
450 // Action column
451 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
452 print '<td></td>';
453 }
454
455 // Ref
456 print '<td>'.$object->getNomUrl(1).'</td>';
457
458 // Label
459 print '<td>'.dol_trunc($obj->label, 42).'</td>';
460
461 // Capital
462 print '<td class="right maxwidth100"><span class="amount">'.price($obj->capital).'</span></td>';
463
464 // Date start
465 print '<td class="center width100">'.dol_print_date($db->jdate($obj->datestart), 'day').'</td>';
466
467 // Date end
468 print '<td class="center width100">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
469
470 print '<td class="center nowrap">';
471 print $object->LibStatut($obj->paid, 5, $obj->alreadypaid);
472 print '</td>';
473
474 // Action column
475 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
476 print '<td></td>';
477 }
478
479 print '</tr>'."\n";
480 }
481 $i++;
482}
483
484// If no record found
485if ($num == 0) {
486 $colspan = 7;
487 //foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
488 print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
489}
490
491$db->free($resql);
492
493$parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
494$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
495print $hookmanager->resPrint;
496
497print '</table>'."\n";
498print '</div>'."\n";
499
500print '</form>'."\n";
501
502// End of page
503llxFooter();
504$db->close();
$id
Definition account.php:48
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:66
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 standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Loan.
llxFooter()
Footer empty.
Definition document.php:107
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)
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.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
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...
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show 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_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
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.