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