dolibarr 25.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-2026 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 * Copyright (C) 2026 MDW <mdeweerd@users.noreply.github.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 3 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <https://www.gnu.org/licenses/>.
20 */
21
28// Load Dolibarr environment
29require '../main.inc.php';
37require_once DOL_DOCUMENT_ROOT.'/loan/class/loan.class.php';
38
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:int'); // 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((string) $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// Add hook to complete $arrayfield
105$parameters = array('arrayfields' => &$arrayfields);
106$reshook = $hookmanager->executeHooks('completeArrayFields', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
107
108$object->fields = dol_sort_array($object->fields, 'position');
109//$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
110$arrayfields = dol_sort_array($arrayfields, 'position');
111
112$search_ref = GETPOST('search_ref', 'alpha');
113$search_label = GETPOST('search_label', 'alpha');
114$search_amount = GETPOST('search_amount', 'alpha');
115
116$permissiontoadd = $user->hasRight('loan', 'write');
117
118// Security check
119$socid = GETPOSTINT('socid');
120if ($user->socid) {
121 $socid = $user->socid;
122}
123$result = restrictedArea($user, 'loan', '', '', '');
124
125
126/*
127 * Actions
128 */
129
130if (GETPOST('cancel', 'alpha')) {
131 $action = 'list';
132 $massaction = '';
133}
134if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
135 $massaction = '';
136}
137
138$parameters = array();
139$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
140if ($reshook < 0) {
141 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
142}
143
144if (empty($reshook)) {
145 // Purge search criteria
146 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
147 $search_ref = "";
148 $search_label = "";
149 $search_amount = "";
150 }
151}
152
153
154/*
155 * View
156 */
157$form = new Form($db);
158$now = dol_now();
159
160$title = $langs->trans('Loans');
161$help_url = "EN:Module_Loan|FR:Module_Emprunt";
162
163// Build and execute select
164// --------------------------------------------------------------------
165$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.paid,";
166$sql .= " SUM(pl.amount_capital) as alreadypaid";
167
168$sqlfields = $sql; // $sql fields to remove for count total
169
170$sql .= " FROM ".MAIN_DB_PREFIX."loan as l";
171$sql_linktopl = " LEFT JOIN ".MAIN_DB_PREFIX."payment_loan AS pl ON l.rowid = pl.fk_loan";
172$sql .= $sql_linktopl;
173
174$sql .= " WHERE l.entity = ".((int) $conf->entity);
175if ($search_amount) {
176 $sql .= natural_search("l.capital", $search_amount, 1);
177}
178if ($search_ref) {
179 $sql .= " AND l.rowid = ".((int) $search_ref);
180}
181if ($search_label) {
182 $sql .= natural_search("l.label", $search_label);
183}
184$sql .= " GROUP BY l.rowid, l.label, l.capital, l.paid, l.datestart, l.dateend";
185
186// Count total nb of records
187$nbtotalofrecords = '';
188if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
189 /* The fast and low memory method to get and count full list converts the sql into a sql count */
190 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
191 $sqlforcount = preg_replace('/'.preg_quote($sql_linktopl, '/').'/', '', $sqlforcount);
192 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
193 $resql = $db->query($sqlforcount);
194 if ($resql) {
195 $objforcount = $db->fetch_object($resql);
196 $nbtotalofrecords = $objforcount->nbtotalofrecords;
197 } else {
199 }
200
201 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
202 $page = 0;
203 $offset = 0;
204 }
205 $db->free($resql);
206}
207
208// Complete request and execute it with limit
209$sql .= $db->order($sortfield, $sortorder);
210if ($limit) {
211 $sql .= $db->plimit($limit + 1, $offset);
212}
213
214$resql = $db->query($sql);
215if (!$resql) {
217 exit;
218}
219
220$num = $db->num_rows($resql);
221
222
223
224// Direct jump if only one record found
225if ($num == 1 && getDolGlobalInt('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
226 $obj = $db->fetch_object($resql);
227 $id = $obj->rowid;
228 header("Location: ".dol_buildpath('/loan/card.php', 1).'?id='.((int) $id));
229 exit;
230}
231
232
233// Output page
234// --------------------------------------------------------------------
235
236llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist mod-loan page-list');
237
238$arrayofselected = is_array($toselect) ? $toselect : array();
239
240$param = '';
241if (!empty($mode)) {
242 $param .= '&mode='.urlencode($mode);
243}
244if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
245 $param .= '&contextpage='.urlencode($contextpage);
246}
247if ($limit > 0 && $limit != $conf->liste_limit) {
248 $param .= '&limit='.((int) $limit);
249}
250if ($optioncss != '') {
251 $param .= '&optioncss='.urlencode($optioncss);
252}
253if ($search_ref) {
254 $param .= "&search_ref=".urlencode($search_ref);
255}
256if ($search_label) {
257 $param .= "&search_label=".urlencode($search_label);
258}
259if ($search_amount) {
260 $param .= "&search_amount=".urlencode($search_amount);
261}
262// Add $param from extra fields
263include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
264// Add $param from hooks
265$parameters = array('param' => &$param);
266$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
267$param .= $hookmanager->resPrint;
268
269// List of mass actions available
270$arrayofmassactions = array();
271if (!empty($permissiontodelete)) {
272 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
273}
274if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
275 $arrayofmassactions = array();
276}
277$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
278
279
280$url = DOL_URL_ROOT.'/loan/card.php?action=create';
281if (!empty($socid)) {
282 $url .= '&socid='.$socid;
283}
284$newcardbutton = '';
285$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'));
286$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'));
287$newcardbutton .= dolGetButtonTitleSeparator();
288$newcardbutton .= dolGetButtonTitle($langs->trans('NewLoan'), '', 'fa fa-plus-circle', $url, '', $permissiontoadd);
289
290$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
291
292print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
293if ($optioncss != '') {
294 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
295}
296print '<input type="hidden" name="token" value="'.newToken().'">';
297print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
298print '<input type="hidden" name="action" value="list">';
299print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
300print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
301print '<input type="hidden" name="page" value="'.$page.'">';
302print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
303print '<input type="hidden" name="page_y" value="">';
304print '<input type="hidden" name="mode" value="'.$mode.'">';
305
306$newcardbutton = '';
307$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'));
308$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'));
309$newcardbutton .= dolGetButtonTitleSeparator();
310$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/loan/card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
311
312print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'money-bill-alt', 0, $newcardbutton, '', $limit, 0, 0, 1);
313
314$moreforfilter = '';
315
316$parameters = array();
317$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
318if (empty($reshook)) {
319 $moreforfilter .= $hookmanager->resPrint;
320} else {
321 $moreforfilter = $hookmanager->resPrint;
322}
323
324if (!empty($moreforfilter)) {
325 print '<div class="liste_titre liste_titre_bydiv centpercent">';
326 print $moreforfilter;
327 print '</div>';
328}
329
330$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
331$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
332$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
333$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
334
335print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
336print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
337
338// Fields title search
339// --------------------------------------------------------------------
340print '<tr class="liste_titre_filter">';
341// Action column
342if ($conf->main_checkbox_left_column) {
343 print '<td class="liste_titre center maxwidthsearch">';
344 $searchpicto = $form->showFilterButtons('left');
345 print $searchpicto;
346 print '</td>';
347}
348
349// Filter: Ref
350print '<td class="liste_titre"><input class="flat" size="4" type="text" name="search_ref" value="'.$search_ref.'"></td>';
351
352// Filter: Label
353print '<td class="liste_titre"><input class="flat" size="12" type="text" name="search_label" value="'.$search_label.'"></td>';
354
355// Filter: Amount
356print '<td class="liste_titre right" ><input class="flat" size="8" type="text" name="search_amount" value="'.$search_amount.'"></td>';
357
358// No filter: Date start
359print '<td class="liste_titre">&nbsp;</td>';
360
361// No filter: Date end
362print '<td class="liste_titre">&nbsp;</td>';
363
364// No filter: Status
365print '<td class="liste_titre"></td>';
366
367// Action column
368if (!$conf->main_checkbox_left_column) {
369 print '<td class="liste_titre center maxwidthsearch">';
370 $searchpicto = $form->showFilterButtons();
371 print $searchpicto;
372 print '</td>';
373}
374print '</tr>'."\n";
375
376$totalarray = array();
377$totalarray['nbfield'] = 0;
378
379// Fields title label
380// --------------------------------------------------------------------
381print '<tr class="liste_titre">';
382// Action column
383if ($conf->main_checkbox_left_column) {
384 print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
385 $totalarray['nbfield']++;
386}
387print_liste_field_titre("Ref", $_SERVER["PHP_SELF"], "l.rowid", "", $param, "", $sortfield, $sortorder);
388$totalarray['nbfield']++;
389print_liste_field_titre("Label", $_SERVER["PHP_SELF"], "l.label", "", $param, '', $sortfield, $sortorder, 'left ');
390$totalarray['nbfield']++;
391print_liste_field_titre("LoanCapital", $_SERVER["PHP_SELF"], "l.capital", "", $param, '', $sortfield, $sortorder, 'right ');
392$totalarray['nbfield']++;
393print_liste_field_titre("DateStart", $_SERVER["PHP_SELF"], "l.datestart", "", $param, '', $sortfield, $sortorder, 'center ');
394$totalarray['nbfield']++;
395print_liste_field_titre("DateEnd", $_SERVER["PHP_SELF"], "l.dateend", "", $param, '', $sortfield, $sortorder, 'center ');
396$totalarray['nbfield']++;
397print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "l.paid", "", $param, '', $sortfield, $sortorder, 'center ');
398$totalarray['nbfield']++;
399if (!$conf->main_checkbox_left_column) {
400 print_liste_field_titre('', $_SERVER["PHP_SELF"], "", '', '', '', $sortfield, $sortorder, 'maxwidthsearch ');
401 $totalarray['nbfield']++;
402}
403print "</tr>\n";
404
405
406// Loop on record
407// --------------------------------------------------------------------
408$i = 0;
409$savnbfield = $totalarray['nbfield'];
410$totalarray = array();
411$totalarray['nbfield'] = 0;
412$imaxinloop = ($limit ? min($num, $limit) : $num);
413while ($i < $imaxinloop) {
414 $obj = $db->fetch_object($resql);
415 if (empty($obj)) {
416 break; // Should not happen
417 }
418
419 $object->id = $obj->rowid;
420 $object->ref = $obj->rowid;
421 $object->label = $obj->label;
422 $object->paid = $obj->paid;
423 $object->datestart = $db->jdate($obj->datestart);
424 $object->dateend = $db->jdate($obj->dateend);
425
426 if ($mode == 'kanban') {
427 if ($i == 0) {
428 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
429 print '<div class="box-flex-container kanban">';
430 }
431 // Output Kanban
432 $object->capital = $obj->capital;
433 $object->totalpaid = $obj->paid;
434
435 // Output Kanban
436 $selected = -1;
437 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
438 $selected = 0;
439 if (in_array($object->id, $arrayofselected)) {
440 $selected = 1;
441 }
442 }
443 print $object->getKanbanView('', array('selected' => $selected));
444 if ($i == ($imaxinloop - 1)) {
445 print '</div>';
446 print '</td></tr>';
447 }
448 } else {
449 // Show line of result
450 $j = 0;
451 print '<tr data-rowid="'.$object->id.'" class="oddeven row-with-select">';
452
453 // Action column
454 if ($conf->main_checkbox_left_column) {
455 print '<td></td>';
456 }
457
458 // Ref
459 print '<td>'.$object->getNomUrl(1).'</td>';
460
461 // Label
462 print '<td>'.dol_trunc($obj->label, 42).'</td>';
463
464 // Capital
465 print '<td class="right maxwidth100"><span class="amount">'.price($obj->capital).'</span></td>';
466
467 // Date start
468 print '<td class="center width100">'.dol_print_date($db->jdate($obj->datestart), 'day').'</td>';
469
470 // Date end
471 print '<td class="center width100">'.dol_print_date($db->jdate($obj->dateend), 'day').'</td>';
472
473 print '<td class="center nowrap">';
474 print $object->LibStatut($obj->paid, 5, $obj->alreadypaid);
475 print '</td>';
476
477 // Action column
478 if (!$conf->main_checkbox_left_column) {
479 print '<td></td>';
480 }
481
482 print '</tr>'."\n";
483 }
484 $i++;
485}
486
487// If no record found
488if ($num == 0) {
489 $colspan = 7;
490 //foreach ($arrayfields as $key => $val) { if (!empty($val['checked'])) $colspan++; }
491 print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
492}
493
494$db->free($resql);
495
496$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
497$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
498print $hookmanager->resPrint;
499
500print '</table>'."\n";
501print '</div>'."\n";
502
503print '</form>'."\n";
504
505// End of page
506llxFooter();
507$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$totalarray
Definition list.php:501
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
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:73
Class to manage standard extra fields.
Class to manage generation of HTML components Only common components must be here.
Loan.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
dol_now($mode='gmt')
Return date for now.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
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.
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...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_liste_field_titre($name, $file="", $field="", $begin="", $param="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
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)
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.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
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.