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