dolibarr 25.0.0-alpha
orders_list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2005-2017 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2010-2012 Juanjo Menent <jmenent@2byte.es>
6 * Copyright (C) 2024-2026 Alexandre Spangaro <alexandre@inovea-conseil.com>
7 * Copyright (C) 2024-2026 Frédéric France <frederic.france@free.fr>
8 * Copyright (C) 2024 MDW <mdeweerd@users.noreply.github.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 3 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 *
20 * You should have received a copy of the GNU General Public License
21 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22 */
23
30// Load Dolibarr environment
31require '../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
41require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
42
43// Load translation files required by the page
44$langs->loadLangs(array('banks', 'categories', 'withdrawals'));
45
46$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
47$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
48$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
49$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
50$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
51$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlist'; // To manage different context of search
52$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
53$optioncss = GETPOST('optioncss', 'alpha');
54$mode = GETPOST('mode', 'alpha');
55
56// Get supervariables
57$search_ref = GETPOST('search_ref', 'alpha');
58$search_amount = GETPOST('search_amount', 'alpha');
59$search_status = GETPOSTISARRAY('search_status') ? GETPOST('search_status', 'array:int') : (GETPOSTISSET('search_status') ? GETPOST('search_status', 'array:intcomma') : array());
60$type = GETPOST('type', 'aZ09');
61
62// Load variable for pagination
63$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
64$sortfield = GETPOST('sortfield', 'aZ09comma');
65$sortorder = GETPOST('sortorder', 'aZ09comma');
66$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
67if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
68 // If $page is not defined, or '' or -1 or if we click on clear filters
69 $page = 0;
70}
71$offset = $limit * $page;
72$pageprev = $page - 1;
73$pagenext = $page + 1;
74if (!$sortorder) {
75 $sortorder = "DESC";
76}
77if (!$sortfield) {
78 $sortfield = "p.datec";
79}
80
82$hookmanager->initHooks(array('withdrawalsreceiptslist'));
83
84$usercancreate = $user->hasRight('prelevement', 'bons', 'creer');
85$permissiontodelete = $user->hasRight('prelevement', 'creer');
86if ($type == 'bank-transfer') {
87 $usercancreate = $user->hasRight('paymentbybanktransfer', 'create');
88 $permissiontodelete = $user->hasRight('paymentbybanktransfer', 'create');
89}
90
91// Security check
92$socid = GETPOSTINT('socid');
93if ($user->socid) {
94 $socid = $user->socid;
95}
96if ($type == 'bank-transfer') {
97 $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
98} else {
99 $result = restrictedArea($user, 'prelevement', '', '', 'bons');
100}
101
102// Definition of array of fields for columns from ->fields
103$tableprefix = 't';
104$arrayfields = array();
105foreach ($object->fields as $key => $val) {
106 // If $val['visible']==0, then we never show the field
107 if (!empty($val['visible'])) {
108 $visible = (int) dol_eval((string) $val['visible'], 1);
109 $arrayfields[$tableprefix.'.'.$key] = array(
110 'label' => $val['label'],
111 'checked' => (($visible < 0) ? '0' : '1'),
112 'enabled' => (string) (int) (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
113 'position' => $val['position'],
114 'help' => isset($val['help']) ? $val['help'] : ''
115 );
116 }
117}
118
119// Extra fields
120include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
121// Add hook to complete $arrayfield
122$parameters = array('arrayfields' => &$arrayfields);
123$reshook = $hookmanager->executeHooks('completeArrayFields', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
124
125
126/*
127 * Actions
128 */
129$error = 0;
130
131if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
132 $search_ref = "";
133 $search_amount = "";
134 $search_status = array();
135}
136
137// Mass actions
138
139// Delete draft
140if (($massaction == "delete" || ($action == 'delete' && $confirm == 'yes')) && $permissiontodelete) {
141 $TMsg = array();
142 $db->begin();
143 $objecttmp = new BonPrelevement($db);
144 $nbignored = 0;
145 $nbok = 0;
146 foreach ($toselect as $toselectid) {
147 $result = $objecttmp->fetch($toselectid);
148 if ($result > 0) {
149 if ($objecttmp->status != $objecttmp::STATUS_DRAFT || $objecttmp->credite > 0 || $objecttmp->date_creation != null) {
150 $langs->load("errors");
151 $nbignored++;
152 $TMsg[] = '<div class="error">'.$langs->trans('ErrorOnlyDraftStatusCanBeDeletedInMassAction', $objecttmp->ref).'</div><br>';
153 continue;
154 }
155 $result = $objecttmp->delete($user);
156 if ($result < 0) { // if delete returns is < 0, there is an error, we break and rollback later
157 setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
158 $error++;
159 break;
160 } else {
161 $nbok++;
162 }
163 } else {
164 setEventMessages($objecttmp->error, $objecttmp->errors, 'errors');
165 $error++;
166 break;
167 }
168 }
169 if (empty($error)) {
170 // Message for elements well deleted
171 if ($nbok > 1) {
172 setEventMessages($langs->trans("RecordsDeleted", $nbok), null, 'mesgs');
173 } elseif ($nbok > 0) {
174 setEventMessages($langs->trans("RecordDeleted", $nbok), null, 'mesgs');
175 } else {
176 setEventMessages($langs->trans("NoRecordDeleted"), null, 'mesgs');
177 }
178
179 // Message for elements which can't be deleted
180 if (!empty($TMsg)) {
181 sort($TMsg);
182 setEventMessages('', array_unique($TMsg), 'warnings');
183 }
184
185 $db->commit();
186 } else {
187 $db->rollback();
188 }
189 $massaction = '';
190}
191$objectclass = 'BonPrelevement';
192$objectlabel = 'BonPrelevement';
193if ($type == 'bank-transfer') {
194 $uploaddir = $conf->paymentbybanktransfer->dir_output;
195} else {
196 $uploaddir = $conf->prelevement->dir_output;
197}
198include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
199
200
201/*
202 * View
203 */
204
205$form = new Form($db);
206$directdebitorder = new BonPrelevement($db);
207
208$titlekey = "WithdrawalsReceipts";
209$title = $langs->trans("WithdrawalsReceipts");
210if ($type == 'bank-transfer') {
211 $titlekey = "BankTransferReceipts";
212 $title = $langs->trans("BankTransferReceipts");
213}
214$help_url = '';
215
216
217$sql = "SELECT p.rowid, p.ref, p.amount, p.statut as status, p.date_trans, p.method_trans, p.date_credit, p.fk_bank_account, p.datec, p.tms as datem";
218
219$sqlfields = $sql; // $sql fields to remove for count total
220
221$sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
222$sql .= " WHERE p.entity IN (".getEntity('invoice').")";
223if ($type == 'bank-transfer') {
224 $sql .= " AND p.type = 'bank-transfer'";
225} else {
226 $sql .= " AND p.type = 'debit-order'";
227}
228if ($search_ref) {
229 $sql .= natural_search("p.ref", $search_ref);
230}
231if ($search_amount) {
232 $sql .= natural_search("p.amount", $search_amount, 1);
233}
234if (is_array($search_status)) {
235 if (!empty($search_status)) {
236 $sql .= natural_search("p.statut", implode(',', $search_status), 2);
237 }
238} elseif ((string) $search_status != '' && (string) $search_status != '-1') {
239 $sql .= natural_search("p.statut", $search_status, 1);
240}
241
242// Count total nb of records
243$nbtotalofrecords = '';
244if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
245 /* The fast and low memory method to get and count full list converts the sql into a sql count */
246 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
247 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
248 $resql = $db->query($sqlforcount);
249 if ($resql) {
250 $objforcount = $db->fetch_object($resql);
251 $nbtotalofrecords = $objforcount->nbtotalofrecords;
252 } else {
254 }
255
256 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
257 $page = 0;
258 $offset = 0;
259 }
260 $db->free($resql);
261}
262
263// Complete request and execute it with limit
264$sql .= $db->order($sortfield, $sortorder);
265if ($limit) {
266 $sql .= $db->plimit($limit + 1, $offset);
267}
268
269$resql = $db->query($sql);
270if (!$resql) {
272 exit;
273}
274
275$num = $db->num_rows($resql);
276
277// Output page
278// --------------------------------------------------------------------
279
280llxHeader('', $title, $help_url, '', 0, 0, '', '', '', 'bodyforlist');
281
282$arrayofselected = is_array($toselect) ? $toselect : array();
283$query = [];
284if ($type == 'bank-transfer') {
285 $query += ['type' => 'bank-transfer'];
286}
287if (!empty($mode)) {
288 $query += ['mode' => $mode];
289}
290if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
291 $query += ['contextpage' => $contextpage];
292}
293if ($limit > 0 && $limit != $conf->liste_limit) {
294 $query += ['limit' => (int) $limit];
295}
296if ($optioncss != '') {
297 $query += ['optioncss' => $optioncss];
298}
299if ($search_amount) {
300 $query += ['search_amount' => $search_amount];
301}
302if (is_array($search_status)) {
303 if (!empty($search_status)) {
304 $query += ['search_status' => implode(',', $search_status)];
305 }
306} elseif ((string) $search_status != '' && (string) $search_status != '-1') {
307 $query += ['search_status' => (int) $search_status];
308}
309
310$arrayofmassactions = array(
311 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
312 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
313);
314if (!empty($permissiontodelete)) {
315 $arrayofmassactions['predeletedraft'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
316}
317$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
318
319print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
320print '<input type="hidden" name="token" value="'.newToken().'">';
321if ($optioncss != '') {
322 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
323}
324print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
325print '<input type="hidden" name="action" value="list">';
326print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
327print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
328print '<input type="hidden" name="page" value="'.$page.'">';
329print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
330print '<input type="hidden" name="page_y" value="">';
331print '<input type="hidden" name="mode" value="'.$mode.'">';
332
333if ($type != '') {
334 print '<input type="hidden" name="type" value="'.$type.'">';
335}
336$param = http_build_query($query);
337
338$newcardbutton = '';
339$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'));
340$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'));
341$newcardbutton .= dolGetButtonTitle($langs->trans('Statistics'), '', 'fa fa-chart-bar imgforviewmode', dolBuildUrl(DOL_URL_ROOT.'/compta/prelevement/stats.php', $query), '', ($mode == 'statistics' ? 2 : 1), array('morecss' => 'reposition'));
342if ($usercancreate) {
343 $newcardbutton .= dolGetButtonTitleSeparator();
344 $newcardbutton .= dolGetButtonTitle($langs->trans('NewStandingOrder'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/compta/prelevement/create.php?type='.urlencode($type));
345}
346
347print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
348
349include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
350
351
352$moreforfilter = '';
353/*$moreforfilter.='<div class="divsearchfield">';
354 $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
355 $moreforfilter.= '</div>';*/
356
357$parameters = array();
358$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
359if (empty($reshook)) {
360 $moreforfilter .= $hookmanager->resPrint;
361} else {
362 $moreforfilter = $hookmanager->resPrint;
363}
364
365if (!empty($moreforfilter)) {
366 print '<div class="liste_titre liste_titre_bydiv centpercent">';
367 print $moreforfilter;
368 print '</div>';
369}
370
371$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
372$htmlofselectarray = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields with user setup
373$selectedfields = ($mode != 'kanban' ? $htmlofselectarray : '');
374$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
375
376print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
377print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
378
379// Fields title search
380// --------------------------------------------------------------------
381print '<tr class="liste_titre_filter">';
382// Action column
383if ($conf->main_checkbox_left_column) {
384 print '<td class="liste_titre center maxwidthsearch">';
385 $searchpicto = $form->showFilterButtons('left');
386 print $searchpicto;
387 print '</td>';
388}
389print '<td class="liste_titre"><input type="text" class="flat maxwidth100" name="search_ref" value="'.dol_escape_htmltag($search_ref).'"></td>';
390print '<td class="liste_titre">&nbsp;</td>';
391print '<td class="liste_titre">&nbsp;</td>';
392print '<td class="liste_titre">&nbsp;</td>';
393print '<td class="liste_titre right"><input type="text" class="flat maxwidth100" name="search_amount" value="'.dol_escape_htmltag($search_amount).'"></td>';
394print '<td class="liste_titre">&nbsp;</td>';
395print '<td class="liste_titre center minwidth75imp parentonrightofpage">';
396$arrayofstatus = array(
397 BonPrelevement::STATUS_DRAFT => $langs->trans('StatusWaiting'),
398 BonPrelevement::STATUS_TRANSFERED => $langs->trans('StatusTrans'),
399 BonPrelevement::STATUS_CREDITED => $langs->trans('Closed'),
400 BonPrelevement::STATUS_CANCELED => $langs->trans('Canceled')
401);
402print $form->multiselectarray('search_status', $arrayofstatus, $search_status, 0, 0, 'search_status width200 right onrightofpage', 0, 0, '');
403print '</td>';
404// Action column
405if (!$conf->main_checkbox_left_column) {
406 print '<td class="liste_titre center maxwidthsearch">';
407 $searchpicto = $form->showFilterButtons();
408 print $searchpicto;
409 print '</td>';
410}
411print '</tr>'."\n";
412
413$totalarray = array();
414$totalarray['nbfield'] = 0;
415
416// Fields title label
417// --------------------------------------------------------------------
418print '<tr class="liste_titre">';
419// Action column
420if ($conf->main_checkbox_left_column) {
421 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
422 $totalarray['nbfield']++;
423}
424print_liste_field_titre($titlekey, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
425$totalarray['nbfield']++;
426print_liste_field_titre("DateCreation", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
427$totalarray['nbfield']++;
428print_liste_field_titre("TransData", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
429$totalarray['nbfield']++;
430print_liste_field_titre("CreditDate", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
431$totalarray['nbfield']++;
432print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "p.amount", "", $param, '', $sortfield, $sortorder, 'right ');
433$totalarray['nbfield']++;
434print_liste_field_titre("BankAccount", $_SERVER["PHP_SELF"], "p.fk_bank_account", "", $param, '', $sortfield, $sortorder);
435$totalarray['nbfield']++;
436print_liste_field_titre("Status", $_SERVER["PHP_SELF"], "", "", $param, '', $sortfield, $sortorder, 'center ');
437$totalarray['nbfield']++;
438// Action column
439if (!$conf->main_checkbox_left_column) {
440 print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
441 $totalarray['nbfield']++;
442}
443print '</tr>'."\n";
444
445// Loop on record
446// --------------------------------------------------------------------
447
448$i = 0;
449$savnbfield = $totalarray['nbfield'];
450$totalarray = array();
451$totalarray['nbfield'] = 0;
452
453$imaxinloop = ($limit ? min($num, $limit) : $num);
454while ($i < $imaxinloop) {
455 $obj = $db->fetch_object($resql);
456
457 $directdebitorder->id = $obj->rowid;
458 $directdebitorder->ref = $obj->ref;
459 $directdebitorder->date_creation = $db->jdate($obj->datec);
460 $directdebitorder->date_trans = $db->jdate($obj->date_trans);
461 $directdebitorder->date_credit = $db->jdate($obj->date_credit);
462 $directdebitorder->amount = $obj->amount;
463 $directdebitorder->status = $obj->status;
464
465 $object = $directdebitorder;
466
467 if ($mode == 'kanban') {
468 if ($i == 0) {
469 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
470 print '<div class="box-flex-container kanban">';
471 }
472 // Output Kanban
473 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
474 $selected = 0;
475 if (in_array($object->id, $arrayofselected)) {
476 $selected = 1;
477 }
478 }
479 print $directdebitorder->getKanbanView('', array('selected' => in_array($obj->id, $arrayofselected)));
480 if ($i == ($imaxinloop - 1)) {
481 print '</div>';
482 print '</td></tr>';
483 }
484 } else {
485 // Show line of result
486 print '<tr data-rowid="'.$object->id.'" class="oddeven row-with-select">';
487
488 // Action column
489 if ($conf->main_checkbox_left_column) {
490 print '<td class="nowrap center">';
491 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
492 $selected = 0;
493 if (in_array($object->id, $arrayofselected)) {
494 $selected = 1;
495 }
496 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
497 }
498 print '</td>';
499 if (!$i) {
500 $totalarray['nbfield']++;
501 }
502 }
503
504 print '<td>';
505 print $directdebitorder->getNomUrl(1);
506 print "</td>\n";
507 if (!$i) {
508 $totalarray['nbfield']++;
509 }
510
511 print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
512 if (!$i) {
513 $totalarray['nbfield']++;
514 }
515
516 print '<td class="center">'.dol_print_date($db->jdate($obj->date_trans), 'day')."</td>\n";
517 if (!$i) {
518 $totalarray['nbfield']++;
519 }
520
521 print '<td class="center">'.dol_print_date($db->jdate($obj->date_credit), 'day')."</td>\n";
522 if (!$i) {
523 $totalarray['nbfield']++;
524 }
525
526 print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
527 if (!$i) {
528 $totalarray['nbfield']++;
529 }
530
531 print '<td>';
532 if ($obj->fk_bank_account > 0) {
533 // TODO Use a cache here
534 $bankaccount = new Account($db);
535 $bankaccount->fetch($obj->fk_bank_account);
536 print $bankaccount->getNomUrl(1);
537 }
538 print "</td>";
539 if (!$i) {
540 $totalarray['nbfield']++;
541 }
542
543 print '<td class="center">';
544 print $object->LibStatut($obj->status, 5);
545 print '</td>';
546 if (!$i) {
547 $totalarray['nbfield']++;
548 }
549
550 // Action column
551 if (!$conf->main_checkbox_left_column) {
552 print '<td class="nowrap center">';
553 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
554 $selected = 0;
555 if (in_array($object->id, $arrayofselected)) {
556 $selected = 1;
557 }
558 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
559 }
560 print '</td>';
561 if (!$i) {
562 $totalarray['nbfield']++;
563 }
564 }
565
566 print '</tr>'."\n";
567 }
568 $i++;
569}
570
571if ($num == 0) {
572 print '<tr><td colspan="'.$savnbfield.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
573}
574
575$db->free($resql);
576
577$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
578$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
579print $hookmanager->resPrint;
580
581print '</table>'."\n";
582print '</div>'."\n";
583
584print '</form>'."\n";
585
586
587// End of page
588llxFooter();
589$db->close();
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 bank accounts.
Class to manage withdrawal receipts.
Class to manage generation of HTML components Only common components must be here.
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.
dolBuildUrl($url, $params=[], $addtoken=false, $anchor='')
Return path of url.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
GETPOSTISARRAY($paramname, $method=0)
Return true if the parameter $paramname is submit from a POST OR GET as an array.
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.
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.
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.
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
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.