dolibarr 19.0.3
list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2006 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3 * Copyright (C) 2007-2016 Laurent Destailleur <eldy@users.sourceforge.net>
4 * Copyright (C) 2009-2012 Regis Houssin <regis.houssin@inodbox.com>
5 * Copyright (C) 2014 Alexandre Spangaro <aspangaro@open-dsi.fr>
6 * Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
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';
30require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
31require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
32require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
34
35// Load translation files required by the page
36$langs->loadLangs(array('banks', 'categories', 'bills'));
37
38// Security check
39if ($user->socid) {
40 $socid = $user->socid;
41}
42$result = restrictedArea($user, 'banque', '', '');
43
44$search_ref = GETPOST('search_ref', 'alpha');
45$search_date_startday = GETPOST('search_date_startday', 'int');
46$search_date_startmonth = GETPOST('search_date_startmonth', 'int');
47$search_date_startyear = GETPOST('search_date_startyear', 'int');
48$search_date_endday = GETPOST('search_date_endday', 'int');
49$search_date_endmonth = GETPOST('search_date_endmonth', 'int');
50$search_date_endyear = GETPOST('search_date_endyear', 'int');
51$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
52$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
53$search_account = GETPOST('search_account', 'int');
54$search_amount = GETPOST('search_amount', 'alpha');
55$mode = GETPOST('mode', 'alpha');
56
57$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
58$sortfield = GETPOST('sortfield', 'aZ09comma');
59$sortorder = GETPOST('sortorder', 'aZ09comma');
60$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
61if (empty($page) || $page == -1) {
62 $page = 0;
63} // If $page is not defined, or '' or -1
64$offset = $limit * $page;
65$pageprev = $page - 1;
66$pagenext = $page + 1;
67if (!$sortorder) {
68 $sortorder = "DESC";
69}
70if (!$sortfield) {
71 $sortfield = "bc.date_bordereau";
72}
73
74$optioncss = GETPOST('optioncss', 'alpha');
75$view = GETPOST("view", 'alpha');
76
77$form = new Form($db);
78$formother = new FormOther($db);
79$checkdepositstatic = new RemiseCheque($db);
80$accountstatic = new Account($db);
81
82// List of payment mode to support
83// Example: BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT = 'CHQ','TRA'
84$arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT', 'CHQ'));
85
86$arrayoflabels = array();
87foreach ($arrayofpaymentmodetomanage as $key => $val) {
88 $labelval = ($langs->trans("PaymentType".$val) != "PaymentType".$val ? $langs->trans("PaymentType".$val) : $val);
89 $arrayoflabels[$key] = $labelval;
90}
91
92$arrayfields = array(
93 'bc.ref' => array('label'=>"Ref", 'checked'=>1, 'position'=>10),
94 'bc.type' => array('label'=>"Type", 'checked'=>1, 'position'=>20),
95 'bc.date_bordereau' => array('label'=>"DateCreation", 'checked'=>1, 'position'=>30),
96 'ba.label' => array('label'=>"Account", 'checked'=>1, 'position'=>40),
97 'bc.nbcheque' => array('label'=>"NbOfCheques", 'checked'=>1, 'position'=>50),
98 'bc.amount' => array('label'=>"Amount", 'checked'=>1, 'position'=>60),
99 'bc.statut' => array('label'=>"Status", 'checked'=>1, 'position'=>70)
100);
101$arrayfields = dol_sort_array($arrayfields, 'position');
102
103// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
104$hookmanager->initHooks(array('chequelist'));
105$object = new RemiseCheque($db);
106
107/*
108 * Actions
109 */
110
111$parameters = array('socid'=>$socid);
112$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
113if ($reshook < 0) {
114 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
115}
116
117if (empty($reshook)) {
118 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
119
120 // All tests are required to be compatible with all browsers
121 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
122 $search_ref = '';
123 $search_amount = '';
124 $search_account = '';
125 $search_date_startday = '';
126 $search_date_startmonth = '';
127 $search_date_startyear = '';
128 $search_date_endday = '';
129 $search_date_endmonth = '';
130 $search_date_endyear = '';
131 $search_date_start = '';
132 $search_date_end = '';
133 }
134}
135
136
137
138/*
139 * View
140 */
141
142$form = new Form($db);
143
144llxHeader('', $langs->trans("ChequeDeposits"));
145
146$sql = "SELECT bc.rowid, bc.ref, bc.date_bordereau,";
147$sql .= " bc.nbcheque, bc.amount, bc.statut, bc.type,";
148$sql .= " ba.rowid as bid, ba.label";
149
150// Add fields from hooks
151$parameters = array();
152$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
153$sql .= $hookmanager->resPrint;
154
155$sqlfields = $sql; // $sql fields to remove for count total
156
157$sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc,";
158$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";
159$sql .= " WHERE bc.fk_bank_account = ba.rowid";
160$sql .= " AND bc.entity = ".((int) $conf->entity);
161
162// Search criteria
163if ($search_ref) {
164 $sql .= natural_search("bc.ref", $search_ref);
165}
166if ($search_account > 0) {
167 $sql .= " AND bc.fk_bank_account = ".((int) $search_account);
168}
169if ($search_amount) {
170 $sql .= natural_search("bc.amount", price2num($search_amount));
171}
172if ($search_date_start) {
173 $sql .= " AND bc.date_bordereau >= '" . $db->idate($search_date_start) . "'";
174}
175if ($search_date_end) {
176 $sql .= " AND bc.date_bordereau <= '" . $db->idate($search_date_end) . "'";
177}
178
179// Add where from hooks
180$parameters = array();
181$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
182$sql .= $hookmanager->resPrint;
183
184// Count total nb of records
185$nbtotalofrecords = '';
186if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
187 /* The fast and low memory method to get and count full list converts the sql into a sql count */
188 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
189 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
190 $resql = $db->query($sqlforcount);
191 if ($resql) {
192 $objforcount = $db->fetch_object($resql);
193 $nbtotalofrecords = $objforcount->nbtotalofrecords;
194 } else {
195 dol_print_error($db);
196 }
197
198 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
199 $page = 0;
200 $offset = 0;
201 }
202 $db->free($resql);
203}
204
205// Complete request and execute it with limit
206$sql .= $db->order($sortfield, $sortorder);
207if ($limit) {
208 $sql .= $db->plimit($limit + 1, $offset);
209}
210//print "$sql";
211
212$resql = $db->query($sql);
213if ($resql) {
214 $num = $db->num_rows($resql);
215 $i = 0;
216 $param = '';
217 if (!empty($mode)) {
218 $param .= '&mode='.urlencode($mode);
219 }
220 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
221 $param .= '&contextpage='.$contextpage;
222 }
223 if ($search_date_startday) {
224 $param .= '&search_date_startday='.urlencode($search_date_startday);
225 }
226 if ($search_date_startmonth) {
227 $param .= '&search_date_startmonth='.urlencode($search_date_startmonth);
228 }
229 if ($search_date_startyear) {
230 $param .= '&search_date_startyear='.urlencode($search_date_startyear);
231 }
232 if ($search_date_endday) {
233 $param .= '&search_date_endday='.urlencode($search_date_endday);
234 }
235 if ($search_date_endmonth) {
236 $param .= '&search_date_endmonth='.urlencode($search_date_endmonth);
237 }
238 if ($search_date_endyear) {
239 $param .= '&search_date_endyear='.urlencode($search_date_endyear);
240 }
241 if ($limit > 0 && $limit != $conf->liste_limit) {
242 $param .= '&limit='.$limit;
243 }
244 if ($search_amount != '') {
245 $param .= '&search_amount='.urlencode($search_amount);
246 }
247 if ($search_account > 0) {
248 $param .= '&search_account='.urlencode($search_account);
249 }
250
251 $url = DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new';
252 if (!empty($socid)) {
253 $url .= '&socid='.$socid;
254 }
255 $newcardbutton = '';
256 $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'));
257 $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'));
258 $newcardbutton .= dolGetButtonTitleSeparator();
259 $newcardbutton .= dolGetButtonTitle($langs->trans('NewCheckDeposit'), '', 'fa fa-plus-circle', $url, '', $user->hasRight('banque', 'cheque'));
260
261 print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
262 if ($optioncss != '') {
263 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
264 }
265 print '<input type="hidden" name="token" value="'.newToken().'">';
266 print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
267 print '<input type="hidden" name="view" value="'.dol_escape_htmltag($view).'">';
268 print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
269 print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
270 print '<input type="hidden" name="page" value="'.$page.'">';
271 print '<input type="hidden" name="mode" value="'.$mode.'">';
272
273
274 print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit);
275
276 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
277 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
278 $massactionbutton = '';
279 if ($massactionbutton) {
280 $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
281 }
282
283 $moreforfilter = '';
284 print '<div class="div-table-responsive">';
285 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">';
286
287 // Fields title search
288 // --------------------------------------------------------------------
289 print '<tr class="liste_titre_filter">';
290
291 // Action column
292 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
293 print '<td class="liste_titre center maxwidthsearch actioncolumn">';
294 $searchpicto = $form->showFilterButtons('left');
295 print $searchpicto;
296 print '</td>';
297 }
298
299 // Filter: Ref
300 if (!empty($arrayfields['bc.ref']['checked'])) {
301 print '<td class="liste_titre">';
302 print '<input class="flat" type="text" size="4" name="search_ref" value="' . $search_ref . '">';
303 print '</td>';
304 }
305
306 // Filter: Type
307 if (!empty($arrayfields['bc.type']['checked'])) {
308 print '<td class="liste_titre">';
309 print '</td>';
310 }
311
312 // Filter: Date
313 if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
314 print '<td class="liste_titre center">';
315 print '<div class="nowrapfordate">';
316 print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
317 print '</div>';
318 print '<div class="nowrapfordate">';
319 print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
320 print '</div>';
321 print '</td>';
322 }
323
324 // Filter: Bank account
325 if (!empty($arrayfields['ba.label']['checked'])) {
326 print '<td class="liste_titre">';
327 $form->select_comptes($search_account, 'search_account', 0, '', 1);
328 print '</td>';
329 }
330
331 // Filter: Number of cheques
332 if (!empty($arrayfields['bc.nbcheque']['checked'])) {
333 print '<td class="liste_titre">&nbsp;</td>';
334 }
335
336 // Filter: Amount
337 if (!empty($arrayfields['bc.amount']['checked'])) {
338 print '<td class="liste_titre right">';
339 print '<input class="flat maxwidth50" type="text" name="search_amount" value="' . $search_amount . '">';
340 print '</td>';
341 }
342
343 // Filter: Status (only placeholder)
344 if (!empty($arrayfields['bc.statut']['checked'])) {
345 print '<td class="liste_titre"></td>';
346 }
347
348 // Fields from hook
349 $parameters = array('arrayfields'=>$arrayfields);
350 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
351 print $hookmanager->resPrint;
352
353 // Action column
354 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
355 print '<td class="liste_titre center maxwidthsearch actioncolumn">';
356 $searchpicto = $form->showFilterButtons();
357 print $searchpicto;
358 print '</td>';
359 }
360
361 print "</tr>\n";
362
363 $totalarray = array();
364 $totalarray['nbfield'] = 0;
365
366 // Fields title label
367 // --------------------------------------------------------------------
368 print '<tr class="liste_titre">';
369 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
370 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
371 $totalarray['nbfield']++;
372 }
373 if (!empty($arrayfields['bc.ref']['checked'])) {
374 print_liste_field_titre($arrayfields['bc.ref']['label'], $_SERVER["PHP_SELF"], "bc.ref", "", $param, "", $sortfield, $sortorder);
375 $totalarray['nbfield']++;
376 }
377 if (!empty($arrayfields['bc.type']['checked'])) {
378 print_liste_field_titre($arrayfields['bc.type']['label'], $_SERVER["PHP_SELF"], "bc.type", "", $param, "", $sortfield, $sortorder);
379 $totalarray['nbfield']++;
380 }
381 if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
382 print_liste_field_titre($arrayfields['bc.date_bordereau']['label'], $_SERVER["PHP_SELF"], "bc.date_bordereau", "", $param, 'align="center"', $sortfield, $sortorder);
383 $totalarray['nbfield']++;
384 }
385 if (!empty($arrayfields['ba.label']['checked'])) {
386 print_liste_field_titre($arrayfields['ba.label']['label'], $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
387 $totalarray['nbfield']++;
388 }
389 if (!empty($arrayfields['bc.nbcheque']['checked'])) {
390 print_liste_field_titre($arrayfields['bc.nbcheque']['label'], $_SERVER["PHP_SELF"], "bc.nbcheque", "", $param, 'class="right"', $sortfield, $sortorder);
391 $totalarray['nbfield']++;
392 }
393 if (!empty($arrayfields['bc.amount']['checked'])) {
394 print_liste_field_titre($arrayfields['bc.amount']['label'], $_SERVER["PHP_SELF"], "bc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
395 $totalarray['nbfield']++;
396 }
397 if (!empty($arrayfields['bc.statut']['checked'])) {
398 print_liste_field_titre($arrayfields['bc.statut']['label'], $_SERVER["PHP_SELF"], "bc.statut", "", $param, 'class="right"', $sortfield, $sortorder);
399 $totalarray['nbfield']++;
400 }
401
402 // Hook fields
403 $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder);
404 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
405 print $hookmanager->resPrint;
406
407 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
408 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
409 $totalarray['nbfield']++;
410 }
411
412 print "</tr>\n";
413
414 $checkedCount = 0;
415 foreach ($arrayfields as $column) {
416 if ($column['checked']) {
417 $checkedCount++;
418 }
419 }
420
421 if ($num > 0) {
422 $savnbfield = 8;
423
424 $i = 0;
425 $totalarray = array();
426 $totalarray['nbfield'] = 0;
427 $imaxinloop = ($limit ? min($num, $limit) : $num);
428 while ($i < $imaxinloop) {
429 $objp = $db->fetch_object($resql);
430
431 $checkdepositstatic->id = $objp->rowid;
432 $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
433 $checkdepositstatic->statut = $objp->statut;
434 $checkdepositstatic->nbcheque = $objp->nbcheque;
435 $checkdepositstatic->amount = $objp->amount;
436 $checkdepositstatic->date_bordereau = $objp->date_bordereau;
437 $checkdepositstatic->type = $objp->type;
438
439 $account = new Account($db);
440 $account->fetch($objp->bid);
441 $checkdepositstatic->account_id = $account->getNomUrl(1);
442
443 if ($mode == 'kanban') {
444 if ($i == 0) {
445 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
446 print '<div class="box-flex-container kanban">';
447 }
448 // Output Kanban
449 print $checkdepositstatic->getKanbanView('', array('selected' => in_array($checkdepositstatic->id, $arrayofselected)));
450 if ($i == ($imaxinloop - 1)) {
451 print '</div>';
452 print '</td></tr>';
453 }
454 } else {
455 print '<tr class="oddeven">';
456
457 // Action column
458 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
459 print '<td class="nowrap center"></td>';
460 if (!$i) {
461 $totalarray['nbfield']++;
462 }
463 }
464
465 // Num ref cheque
466 if (!empty($arrayfields['bc.ref']['checked'])) {
467 print '<td>';
468 print $checkdepositstatic->getNomUrl(1);
469 print '</td>';
470 if (!$i) {
471 $totalarray['nbfield']++;
472 }
473 }
474
475 // Type
476 if (!empty($arrayfields['bc.type']['checked'])) {
477 $labelpaymentmode = ($langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) != "PaymentType".$checkdepositstatic->type ? $langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) : $checkdepositstatic->type);
478 print '<td>'.dol_escape_htmltag($labelpaymentmode).'</td>';
479 if (!$i) {
480 $totalarray['nbfield']++;
481 }
482 }
483
484 // Date
485 if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
486 print '<td class="center">'.dol_print_date($db->jdate($objp->date_bordereau), 'dayhour', 'tzuser').'</td>';
487 if (!$i) {
488 $totalarray['nbfield']++;
489 }
490 }
491
492 // Bank
493 if (!empty($arrayfields['ba.label']['checked'])) {
494 print '<td>';
495 if ($objp->bid) {
496 print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"), 'account').' '.$objp->label.'</a>';
497 } else {
498 print '&nbsp;';
499 }
500 print '</td>';
501 if (!$i) {
502 $totalarray['nbfield']++;
503 }
504 }
505
506 // Number of cheques
507 if (!empty($arrayfields['bc.nbcheque']['checked'])) {
508 print '<td class="right">'.$objp->nbcheque.'</td>';
509 if (!$i) {
510 $totalarray['nbfield']++;
511 }
512 }
513
514 // Amount
515 if (!empty($arrayfields['bc.amount']['checked'])) {
516 print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
517 if (!$i) {
518 $totalarray['nbfield']++;
519 }
520 if (empty($totalarray['val']['amount'])) {
521 $totalarray['val']['amount'] = $objp->amount;
522 } else {
523 $totalarray['val']['amount'] += $objp->amount;
524 }
525 }
526
527 // Status
528 if (!empty($arrayfields['bc.statut']['checked'])) {
529 print '<td class="right">';
530 print $checkdepositstatic->LibStatut($objp->statut, 5);
531 print '</td>';
532 if (!$i) {
533 $totalarray['nbfield']++;
534 }
535 }
536
537 // Action column
538 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
539 print '<td class="nowrap center"></td>';
540 if (!$i) {
541 $totalarray['nbfield']++;
542 }
543 }
544
545 print "</tr>\n";
546 }
547 $i++;
548 }
549 } else {
550 // If no record found
551 if ($num == 0) {
552 $colspan = 1;
553 foreach ($arrayfields as $key => $val) {
554 if (!empty($val['checked'])) {
555 $colspan++;
556 }
557 }
558 print '<tr class="oddeven">';
559 print '<td colspan="' . $colspan . '" class="opacitymedium">' . $langs->trans("NoRecordFound") . "</td>";
560 print '</tr>';
561 }
562 }
563 print "</table>";
564 print "</div>";
565 print "</form>\n";
566} else {
567 dol_print_error($db);
568}
569
570// End of page
571llxFooter();
572$db->close();
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Definition wrapper.php:55
llxFooter()
Empty footer.
Definition wrapper.php:69
Class to manage bank accounts.
Class to manage generation of HTML components Only common components must be here.
Classe permettant la generation de composants html autre Only common components are here.
Class to manage cheque delivery receipts.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed informations (by default a local PHP server timestamp) Re...
price2num($amount, $rounding='', $option=0)
Function that return a number with universal decimal format (decimal separator is '.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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.
img_object($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0)
Show a picto called object_picto (generic function)
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...
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 second index function, which produces ascending (default) or descending output...
print_liste_field_titre($name, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $tooltip="", $forcenowrapcolumntitle=0)
Show title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
print_barre_liste($titre, $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.
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.