dolibarr 21.0.0-alpha
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 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 3 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <https://www.gnu.org/licenses/>.
21 */
22
29// Load Dolibarr environment
30require '../../../main.inc.php';
31require_once DOL_DOCUMENT_ROOT.'/compta/paiement/cheque/class/remisecheque.class.php';
32require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
33require_once DOL_DOCUMENT_ROOT.'/core/class/html.formother.class.php';
34require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
35
36// Load translation files required by the page
37$langs->loadLangs(array('banks', 'categories', 'bills'));
38
39$search_ref = GETPOST('search_ref', 'alpha');
40$search_date_startday = GETPOSTINT('search_date_startday');
41$search_date_startmonth = GETPOSTINT('search_date_startmonth');
42$search_date_startyear = GETPOSTINT('search_date_startyear');
43$search_date_endday = GETPOSTINT('search_date_endday');
44$search_date_endmonth = GETPOSTINT('search_date_endmonth');
45$search_date_endyear = GETPOSTINT('search_date_endyear');
46$search_date_start = dol_mktime(0, 0, 0, $search_date_startmonth, $search_date_startday, $search_date_startyear); // Use tzserver
47$search_date_end = dol_mktime(23, 59, 59, $search_date_endmonth, $search_date_endday, $search_date_endyear);
48$search_account = GETPOST('search_account', 'alpha');
49$search_amount = GETPOST('search_amount', 'alpha');
50$mode = GETPOST('mode', 'alpha');
51
52$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
53$sortfield = GETPOST('sortfield', 'aZ09comma');
54$sortorder = GETPOST('sortorder', 'aZ09comma');
55$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
56if (empty($page) || $page == -1) {
57 $page = 0;
58} // If $page is not defined, or '' or -1
59$offset = $limit * $page;
60$pageprev = $page - 1;
61$pagenext = $page + 1;
62if (!$sortorder) {
63 $sortorder = "DESC";
64}
65if (!$sortfield) {
66 $sortfield = "bc.date_bordereau";
67}
68
69$optioncss = GETPOST('optioncss', 'alpha');
70$view = GETPOST("view", 'alpha');
71
72$form = new Form($db);
73$formother = new FormOther($db);
74$checkdepositstatic = new RemiseCheque($db);
75$accountstatic = new Account($db);
76
77// List of payment mode to support
78// Example: BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT = 'CHQ','TRA'
79$arrayofpaymentmodetomanage = explode(',', getDolGlobalString('BANK_PAYMENT_MODES_FOR_DEPOSIT_MANAGEMENT', 'CHQ'));
80
81$arrayoflabels = array();
82foreach ($arrayofpaymentmodetomanage as $key => $val) {
83 $labelval = ($langs->trans("PaymentType".$val) != "PaymentType".$val ? $langs->trans("PaymentType".$val) : $val);
84 $arrayoflabels[$key] = $labelval;
85}
86
87$arrayfields = array(
88 'bc.ref' => array('label' => "Ref", 'checked' => 1, 'position' => 10),
89 'bc.type' => array('label' => "Type", 'checked' => 1, 'position' => 20),
90 'bc.date_bordereau' => array('label' => "DateCreation", 'checked' => 1, 'position' => 30),
91 'ba.label' => array('label' => "BankAccount", 'checked' => 1, 'position' => 40),
92 'bc.nbcheque' => array('label' => "NbOfCheques", 'checked' => 1, 'position' => 50),
93 'bc.amount' => array('label' => "Amount", 'checked' => 1, 'position' => 60),
94 'bc.statut' => array('label' => "Status", 'checked' => 1, 'position' => 70)
95);
96$arrayfields = dol_sort_array($arrayfields, 'position');
97'@phan-var-force array<string,array{label:string,checked?:int<0,1>,position?:int,help?:string}> $arrayfields'; // dol_sort_array looses type for Phan
98
99// Initialize a technical object to manage hooks of page. Note that conf->hooks_modules contains an array of hook context
100$hookmanager->initHooks(array('chequelist'));
101$object = new RemiseCheque($db);
102
103// Security check
104$result = restrictedArea($user, 'banque', '', '');
105
106
107/*
108 * Actions
109 */
110
111$parameters = array();
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
144$title = $langs->trans("ChequeDeposits");
145
146llxHeader('', $title, '', '', 0, 0, '', '', '', 'bodyforlist');
147
148$sql = "SELECT bc.rowid, bc.ref, bc.date_bordereau,";
149$sql .= " bc.nbcheque, bc.amount, bc.statut, bc.type,";
150$sql .= " ba.rowid as bid, ba.label";
151
152// Add fields from hooks
153$parameters = array();
154$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters); // Note that $action and $object may have been modified by hook
155$sql .= $hookmanager->resPrint;
156
157$sqlfields = $sql; // $sql fields to remove for count total
158
159$sql .= " FROM ".MAIN_DB_PREFIX."bordereau_cheque as bc,";
160$sql .= " ".MAIN_DB_PREFIX."bank_account as ba";
161$sql .= " WHERE bc.fk_bank_account = ba.rowid";
162$sql .= " AND bc.entity = ".((int) $conf->entity);
163
164// Search criteria
165if ($search_ref) {
166 $sql .= natural_search("bc.ref", $search_ref);
167}
168if ($search_account > 0) {
169 $sql .= " AND bc.fk_bank_account = ".((int) $search_account);
170}
171if ($search_amount) {
172 $sql .= natural_search("bc.amount", price2num($search_amount));
173}
174if ($search_date_start) {
175 $sql .= " AND bc.date_bordereau >= '" . $db->idate($search_date_start) . "'";
176}
177if ($search_date_end) {
178 $sql .= " AND bc.date_bordereau <= '" . $db->idate($search_date_end) . "'";
179}
180
181// Add where from hooks
182$parameters = array();
183$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
184$sql .= $hookmanager->resPrint;
185
186// Count total nb of records
187$nbtotalofrecords = '';
188if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
189 /* The fast and low memory method to get and count full list converts the sql into a sql count */
190 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
191 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
192 $resql = $db->query($sqlforcount);
193 if ($resql) {
194 $objforcount = $db->fetch_object($resql);
195 $nbtotalofrecords = $objforcount->nbtotalofrecords;
196 } else {
197 dol_print_error($db);
198 }
199
200 if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
201 $page = 0;
202 $offset = 0;
203 }
204 $db->free($resql);
205}
206
207// Complete request and execute it with limit
208$sql .= $db->order($sortfield, $sortorder);
209if ($limit) {
210 $sql .= $db->plimit($limit + 1, $offset);
211}
212//print "$sql";
213
214$resql = $db->query($sql);
215if ($resql) {
216 $num = $db->num_rows($resql);
217 $i = 0;
218 $param = '';
219 if (!empty($mode)) {
220 $param .= '&mode='.urlencode($mode);
221 }
222 if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
223 $param .= '&contextpage='.$contextpage;
224 }
225 if ($search_date_startday) {
226 $param .= '&search_date_startday='.urlencode((string) ($search_date_startday));
227 }
228 if ($search_date_startmonth) {
229 $param .= '&search_date_startmonth='.urlencode((string) ($search_date_startmonth));
230 }
231 if ($search_date_startyear) {
232 $param .= '&search_date_startyear='.urlencode((string) ($search_date_startyear));
233 }
234 if ($search_date_endday) {
235 $param .= '&search_date_endday='.urlencode((string) ($search_date_endday));
236 }
237 if ($search_date_endmonth) {
238 $param .= '&search_date_endmonth='.urlencode((string) ($search_date_endmonth));
239 }
240 if ($search_date_endyear) {
241 $param .= '&search_date_endyear='.urlencode((string) ($search_date_endyear));
242 }
243 if ($limit > 0 && $limit != $conf->liste_limit) {
244 $param .= '&limit='.$limit;
245 }
246 if ($search_amount != '') {
247 $param .= '&search_amount='.urlencode($search_amount);
248 }
249 if ($search_account > 0) {
250 $param .= '&search_account='.urlencode((string) ($search_account));
251 }
252
253 $url = DOL_URL_ROOT.'/compta/paiement/cheque/card.php?action=new';
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 // @phan-suppress-next-line PhanPluginSuspiciousParamOrder
275 print_barre_liste($langs->trans("MenuChequeDeposits"), $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, $nbtotalofrecords, 'bank_account', 0, $newcardbutton, '', $limit);
276
277 $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
278 $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
279 $massactionbutton = '';
280 if ($massactionbutton) {
281 $selectedfields .= $form->showCheckAddButtons('checkforselect', 1);
282 }
283
284 $moreforfilter = '';
285 print '<div class="div-table-responsive">';
286 print '<table class="tagtable liste'.($moreforfilter ? " listwithfilterbefore" : '').'">';
287
288 // Fields title search
289 // --------------------------------------------------------------------
290 print '<tr class="liste_titre_filter">';
291
292 // Action column
293 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
294 print '<td class="liste_titre center maxwidthsearch actioncolumn">';
295 $searchpicto = $form->showFilterButtons('left');
296 print $searchpicto;
297 print '</td>';
298 }
299
300 // Filter: Ref
301 if (!empty($arrayfields['bc.ref']['checked'])) {
302 print '<td class="liste_titre">';
303 print '<input class="flat" type="text" size="4" name="search_ref" value="' . $search_ref . '">';
304 print '</td>';
305 }
306
307 // Filter: Type
308 if (!empty($arrayfields['bc.type']['checked'])) {
309 print '<td class="liste_titre">';
310 print '</td>';
311 }
312
313 // Filter: Date
314 if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
315 print '<td class="liste_titre center">';
316 print '<div class="nowrapfordate">';
317 print $form->selectDate($search_date_start ? $search_date_start : -1, 'search_date_start', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
318 print '</div>';
319 print '<div class="nowrapfordate">';
320 print $form->selectDate($search_date_end ? $search_date_end : -1, 'search_date_end', 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
321 print '</div>';
322 print '</td>';
323 }
324
325 // Filter: Bank account
326 if (!empty($arrayfields['ba.label']['checked'])) {
327 print '<td class="liste_titre">';
328 $form->select_comptes($search_account, 'search_account', 0, '', 1);
329 print '</td>';
330 }
331
332 // Filter: Number of cheques
333 if (!empty($arrayfields['bc.nbcheque']['checked'])) {
334 print '<td class="liste_titre">&nbsp;</td>';
335 }
336
337 // Filter: Amount
338 if (!empty($arrayfields['bc.amount']['checked'])) {
339 print '<td class="liste_titre right">';
340 print '<input class="flat maxwidth50" type="text" name="search_amount" value="' . $search_amount . '">';
341 print '</td>';
342 }
343
344 // Filter: Status (only placeholder)
345 if (!empty($arrayfields['bc.statut']['checked'])) {
346 print '<td class="liste_titre"></td>';
347 }
348
349 // Fields from hook
350 $parameters = array('arrayfields' => $arrayfields);
351 $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters); // Note that $action and $object may have been modified by hook
352 print $hookmanager->resPrint;
353
354 // Action column
355 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
356 print '<td class="liste_titre center maxwidthsearch actioncolumn">';
357 $searchpicto = $form->showFilterButtons();
358 print $searchpicto;
359 print '</td>';
360 }
361
362 print "</tr>\n";
363
364 $totalarray = array();
365 $totalarray['nbfield'] = 0;
366
367 // Fields title label
368 // --------------------------------------------------------------------
369 print '<tr class="liste_titre">';
370 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
371 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
372 $totalarray['nbfield']++;
373 }
374 if (!empty($arrayfields['bc.ref']['checked'])) {
375 // False positive @phan-suppress-next-line PhanTypeInvalidDimOffset
376 print_liste_field_titre($arrayfields['bc.ref']['label'], $_SERVER["PHP_SELF"], "bc.ref", "", $param, "", $sortfield, $sortorder);
377 $totalarray['nbfield']++;
378 }
379 if (!empty($arrayfields['bc.type']['checked'])) {
380 print_liste_field_titre($arrayfields['bc.type']['label'], $_SERVER["PHP_SELF"], "bc.type", "", $param, "", $sortfield, $sortorder);
381 $totalarray['nbfield']++;
382 }
383 if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
384 print_liste_field_titre($arrayfields['bc.date_bordereau']['label'], $_SERVER["PHP_SELF"], "bc.date_bordereau", "", $param, 'align="center"', $sortfield, $sortorder);
385 $totalarray['nbfield']++;
386 }
387 if (!empty($arrayfields['ba.label']['checked'])) {
388 print_liste_field_titre($arrayfields['ba.label']['label'], $_SERVER["PHP_SELF"], "ba.label", "", $param, "", $sortfield, $sortorder);
389 $totalarray['nbfield']++;
390 }
391 if (!empty($arrayfields['bc.nbcheque']['checked'])) {
392 print_liste_field_titre($arrayfields['bc.nbcheque']['label'], $_SERVER["PHP_SELF"], "bc.nbcheque", "", $param, 'class="right"', $sortfield, $sortorder);
393 $totalarray['nbfield']++;
394 }
395 if (!empty($arrayfields['bc.amount']['checked'])) {
396 print_liste_field_titre($arrayfields['bc.amount']['label'], $_SERVER["PHP_SELF"], "bc.amount", "", $param, 'class="right"', $sortfield, $sortorder);
397 $totalarray['nbfield']++;
398 }
399 if (!empty($arrayfields['bc.statut']['checked'])) {
400 print_liste_field_titre($arrayfields['bc.statut']['label'], $_SERVER["PHP_SELF"], "bc.statut", "", $param, 'class="right"', $sortfield, $sortorder);
401 $totalarray['nbfield']++;
402 }
403
404 // Hook fields
405 $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
406 $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters); // Note that $action and $object may have been modified by hook
407 print $hookmanager->resPrint;
408
409 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
410 print_liste_field_titre($selectedfields, $_SERVER["PHP_SELF"], "", '', '', 'align="center"', $sortfield, $sortorder, 'maxwidthsearch ');
411 $totalarray['nbfield']++;
412 }
413
414 print "</tr>\n";
415
416 $checkedCount = 0;
417 foreach ($arrayfields as $column) {
418 if ($column['checked']) {
419 $checkedCount++;
420 }
421 }
422
423 if ($num > 0) {
424 $savnbfield = 8;
425
426 $i = 0;
427 $totalarray = array();
428 $totalarray['nbfield'] = 0;
429 $imaxinloop = ($limit ? min($num, $limit) : $num);
430 while ($i < $imaxinloop) {
431 $objp = $db->fetch_object($resql);
432
433 $checkdepositstatic->id = $objp->rowid;
434 $checkdepositstatic->ref = ($objp->ref ? $objp->ref : $objp->rowid);
435 $checkdepositstatic->statut = $objp->statut;
436 $checkdepositstatic->nbcheque = $objp->nbcheque;
437 $checkdepositstatic->amount = $objp->amount;
438 $checkdepositstatic->date_bordereau = $objp->date_bordereau;
439 $checkdepositstatic->type = $objp->type;
440
441 $account = new Account($db);
442 $account->fetch($objp->bid);
443 $checkdepositstatic->account_id = $account->getNomUrl(1);
444
445 if ($mode == 'kanban') {
446 if ($i == 0) {
447 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
448 print '<div class="box-flex-container kanban">';
449 }
450 // Output Kanban
451 print $checkdepositstatic->getKanbanView('', array('selected' => in_array($checkdepositstatic->id, $arrayofselected)));
452 if ($i == ($imaxinloop - 1)) {
453 print '</div>';
454 print '</td></tr>';
455 }
456 } else {
457 print '<tr class="oddeven">';
458
459 // Action column
460 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
461 print '<td class="nowrap center"></td>';
462 if (!$i) {
463 $totalarray['nbfield']++;
464 }
465 }
466
467 // Num ref cheque
468 if (!empty($arrayfields['bc.ref']['checked'])) {
469 print '<td>';
470 print $checkdepositstatic->getNomUrl(1);
471 print '</td>';
472 if (!$i) {
473 $totalarray['nbfield']++;
474 }
475 }
476
477 // Type
478 if (!empty($arrayfields['bc.type']['checked'])) {
479 $labelpaymentmode = ($langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) != "PaymentType".$checkdepositstatic->type ? $langs->transnoentitiesnoconv("PaymentType".$checkdepositstatic->type) : $checkdepositstatic->type);
480 print '<td>'.dol_escape_htmltag($labelpaymentmode).'</td>';
481 if (!$i) {
482 $totalarray['nbfield']++;
483 }
484 }
485
486 // Date
487 if (!empty($arrayfields['bc.date_bordereau']['checked'])) {
488 print '<td class="center">'.dol_print_date($db->jdate($objp->date_bordereau), 'dayhour', 'tzuser').'</td>';
489 if (!$i) {
490 $totalarray['nbfield']++;
491 }
492 }
493
494 // Bank
495 if (!empty($arrayfields['ba.label']['checked'])) {
496 print '<td>';
497 if ($objp->bid) {
498 print '<a href="'.DOL_URL_ROOT.'/compta/bank/bankentries_list.php?account='.$objp->bid.'">'.img_object($langs->trans("ShowAccount"), 'account').' '.$objp->label.'</a>';
499 } else {
500 print '&nbsp;';
501 }
502 print '</td>';
503 if (!$i) {
504 $totalarray['nbfield']++;
505 }
506 }
507
508 // Number of cheques
509 if (!empty($arrayfields['bc.nbcheque']['checked'])) {
510 print '<td class="right">'.$objp->nbcheque.'</td>';
511 if (!$i) {
512 $totalarray['nbfield']++;
513 }
514 }
515
516 // Amount
517 if (!empty($arrayfields['bc.amount']['checked'])) {
518 print '<td class="right"><span class="amount">'.price($objp->amount).'</span></td>';
519 if (!$i) {
520 $totalarray['nbfield']++;
521 }
522 if (empty($totalarray['val']['amount'])) {
523 $totalarray['val']['amount'] = $objp->amount;
524 } else {
525 $totalarray['val']['amount'] += $objp->amount;
526 }
527 }
528
529 // Status
530 if (!empty($arrayfields['bc.statut']['checked'])) {
531 print '<td class="right">';
532 print $checkdepositstatic->LibStatut($objp->statut, 5);
533 print '</td>';
534 if (!$i) {
535 $totalarray['nbfield']++;
536 }
537 }
538
539 // Action column
540 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
541 print '<td class="nowrap center"></td>';
542 if (!$i) {
543 $totalarray['nbfield']++;
544 }
545 }
546
547 print "</tr>\n";
548 }
549 $i++;
550 }
551 } else {
552 // If no record found
553 if ($num == 0) {
554 $colspan = 1;
555 foreach ($arrayfields as $key => $val) {
556 if (!empty($val['checked'])) {
557 $colspan++;
558 }
559 }
560 print '<tr class="oddeven">';
561 print '<td colspan="' . $colspan . '" class="opacitymedium">' . $langs->trans("NoRecordFound") . "</td>";
562 print '</tr>';
563 }
564 }
565 print "</table>";
566 print "</div>";
567 print "</form>\n";
568} else {
569 dol_print_error($db);
570}
571
572// End of page
573llxFooter();
574$db->close();
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Definition card.php:58
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:70
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.
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.
print_barre_liste($title, $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.
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.
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.