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