list.php 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. <?php
  2. /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
  3. * Copyright (C) 2005-2016 Laurent Destailleur <eldy@users.sourceforge.net>
  4. * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@inodbox.com>
  5. * Copyright (C) 2010-2018 Juanjo Menent <jmenent@2byte.es>
  6. * Copyright (C) 2022 Alexandre Spangaro <aspangaro@open-dsi.fr>
  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. /**
  22. * \file htdocs/compta/prelevement/list.php
  23. * \ingroup prelevement
  24. * \brief Page to list direct debit orders or credit transfers orders
  25. */
  26. // Load Dolibarr environment
  27. require '../../main.inc.php';
  28. require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/bonprelevement.class.php';
  29. require_once DOL_DOCUMENT_ROOT.'/compta/prelevement/class/ligneprelevement.class.php';
  30. require_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
  31. // Load translation files required by the page
  32. $langs->loadLangs(array('banks', 'withdrawals', 'companies', 'categories'));
  33. $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
  34. $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
  35. $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
  36. $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
  37. $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
  38. $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
  39. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'directdebitcredittransferlinelist'; // To manage different context of search
  40. $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
  41. $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
  42. $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
  43. $type = GETPOST('type', 'aZ09');
  44. // Load variable for pagination
  45. $limit = GETPOST('limit', 'int') ?GETPOST('limit', 'int') : $conf->liste_limit;
  46. $sortfield = GETPOST('sortfield', 'aZ09comma');
  47. $sortorder = GETPOST('sortorder', 'aZ09comma');
  48. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  49. if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
  50. // If $page is not defined, or '' or -1 or if we click on clear filters
  51. $page = 0;
  52. }
  53. $offset = $limit * $page;
  54. $pageprev = $page - 1;
  55. $pagenext = $page + 1;
  56. if (!$sortorder) {
  57. $sortorder = "DESC";
  58. }
  59. if (!$sortfield) {
  60. $sortfield = "p.datec";
  61. }
  62. $search_line = GETPOST('search_line', 'alpha');
  63. $search_bon = GETPOST('search_bon', 'alpha');
  64. $search_code = GETPOST('search_code', 'alpha');
  65. $search_company = GETPOST('search_company', 'alpha');
  66. $statut = GETPOST('statut', 'int');
  67. $bon = new BonPrelevement($db);
  68. $line = new LignePrelevement($db);
  69. $company = new Societe($db);
  70. $hookmanager->initHooks(array('withdrawalsreceiptslineslist'));
  71. // Security check
  72. $socid = GETPOST('socid', 'int');
  73. if ($user->socid) {
  74. $socid = $user->socid;
  75. }
  76. if ($type == 'bank-transfer') {
  77. $result = restrictedArea($user, 'paymentbybanktransfer', '', '', '');
  78. } else {
  79. $result = restrictedArea($user, 'prelevement', '', '', 'bons');
  80. }
  81. /*
  82. * Actions
  83. */
  84. if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')) { // All tests are required to be compatible with all browsers
  85. $search_line = "";
  86. $search_bon = "";
  87. $search_code = "";
  88. $search_company = "";
  89. $statut = "";
  90. }
  91. /*
  92. * View
  93. */
  94. $form = new Form($db);
  95. $title = $langs->trans("WithdrawalsLines");
  96. if ($type == 'bank-transfer') {
  97. $title = $langs->trans("CreditTransferLines");
  98. }
  99. $help_url = '';
  100. $sql = "SELECT p.rowid, p.ref, p.statut as status, p.datec";
  101. $sql .= " , f.rowid as facid, f.ref as invoiceref, f.total_ttc";
  102. $sql .= " , s.rowid as socid, s.nom as name, s.code_client, s.code_fournisseur, s.email";
  103. $sql .= " , pl.amount, pl.statut as statut_ligne, pl.rowid as rowid_ligne";
  104. $sqlfields = $sql; // $sql fields to remove for count total
  105. $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_bons as p";
  106. $sql .= " , ".MAIN_DB_PREFIX."prelevement_lignes as pl";
  107. $sql .= " , ".MAIN_DB_PREFIX."prelevement as pf";
  108. if ($type == 'bank-transfer') {
  109. $sql .= " , ".MAIN_DB_PREFIX."facture_fourn as f";
  110. } else {
  111. $sql .= " , ".MAIN_DB_PREFIX."facture as f";
  112. }
  113. $sql .= " , ".MAIN_DB_PREFIX."societe as s";
  114. $sql .= " WHERE pl.fk_prelevement_bons = p.rowid";
  115. $sql .= " AND pf.fk_prelevement_lignes = pl.rowid";
  116. if ($type == 'bank-transfer') {
  117. $sql .= " AND pf.fk_facture_fourn = f.rowid";
  118. } else {
  119. $sql .= " AND pf.fk_facture = f.rowid";
  120. }
  121. $sql .= " AND f.fk_soc = s.rowid";
  122. $sql .= " AND f.entity IN (".getEntity('invoice').")";
  123. if ($socid) {
  124. $sql .= " AND s.rowid = ".((int) $socid);
  125. }
  126. if ($search_line) {
  127. $sql .= " AND pl.rowid = '".$db->escape($search_line)."'";
  128. }
  129. if ($search_bon) {
  130. $sql .= natural_search("p.ref", $search_bon);
  131. }
  132. if ($type == 'bank-transfer') {
  133. if ($search_code) {
  134. $sql .= natural_search("s.code_fournisseur", $search_code);
  135. }
  136. } else {
  137. if ($search_code) {
  138. $sql .= natural_search("s.code_client", $search_code);
  139. }
  140. }
  141. if ($search_company) {
  142. $sql .= natural_search("s.nom", $search_company);
  143. }
  144. // Count total nb of records
  145. $nbtotalofrecords = '';
  146. if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
  147. /* The fast and low memory method to get and count full list converts the sql into a sql count */
  148. $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
  149. $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
  150. $resql = $db->query($sqlforcount);
  151. if ($resql) {
  152. $objforcount = $db->fetch_object($resql);
  153. $nbtotalofrecords = $objforcount->nbtotalofrecords;
  154. } else {
  155. dol_print_error($db);
  156. }
  157. if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
  158. $page = 0;
  159. $offset = 0;
  160. }
  161. $db->free($resql);
  162. }
  163. // Complete request and execute it with limit
  164. $sql .= $db->order($sortfield, $sortorder);
  165. if ($limit) {
  166. $sql .= $db->plimit($limit + 1, $offset);
  167. }
  168. $resql = $db->query($sql);
  169. if (!$resql) {
  170. dol_print_error($db);
  171. exit;
  172. }
  173. $num = $db->num_rows($resql);
  174. // Output page
  175. // --------------------------------------------------------------------
  176. llxHeader('', $title, $help_url);
  177. $arrayofselected = is_array($toselect) ? $toselect : array();
  178. $param = '';
  179. $param .= "&statut=".urlencode($statut);
  180. $param .= "&search_bon=".urlencode($search_bon);
  181. if ($type == 'bank-transfer') {
  182. $param .= '&type=bank-transfer';
  183. }
  184. if (!empty($mode)) {
  185. $param .= '&mode='.urlencode($mode);
  186. }
  187. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  188. $param .= '&contextpage='.urlencode($contextpage);
  189. }
  190. if ($limit > 0 && $limit != $conf->liste_limit) {
  191. $param .= '&limit='.((int) $limit);
  192. }
  193. if ($optioncss != '') {
  194. $param .= '&optioncss='.urlencode($optioncss);
  195. }
  196. $arrayofmassactions = array(
  197. //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
  198. //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
  199. );
  200. $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
  201. print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
  202. print '<input type="hidden" name="token" value="'.newToken().'">';
  203. if ($optioncss != '') {
  204. print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  205. }
  206. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  207. print '<input type="hidden" name="action" value="list">';
  208. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  209. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  210. print '<input type="hidden" name="page" value="'.$page.'">';
  211. print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
  212. print '<input type="hidden" name="page_y" value="">';
  213. print '<input type="hidden" name="mode" value="'.$mode.'">';
  214. if ($type != '') {
  215. print '<input type="hidden" name="type" value="'.$type.'">';
  216. }
  217. $newcardbutton = '';
  218. $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'));
  219. $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'));
  220. print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'generic', 0, $newcardbutton, '', $limit, 0, 0, 1);
  221. $moreforfilter = '';
  222. /*$moreforfilter.='<div class="divsearchfield">';
  223. $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
  224. $moreforfilter.= '</div>';*/
  225. $parameters = array();
  226. $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  227. if (empty($reshook)) {
  228. $moreforfilter .= $hookmanager->resPrint;
  229. } else {
  230. $moreforfilter = $hookmanager->resPrint;
  231. }
  232. if (!empty($moreforfilter)) {
  233. print '<div class="liste_titre liste_titre_bydiv centpercent">';
  234. print $moreforfilter;
  235. $parameters = array();
  236. $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  237. print $hookmanager->resPrint;
  238. print '</div>';
  239. }
  240. $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
  241. $selectedfields = ($mode != 'kanban' ? $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')) : ''); // This also change content of $arrayfields
  242. $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
  243. print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  244. print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
  245. // Fields title search
  246. // --------------------------------------------------------------------
  247. print '<tr class="liste_titre_filter">';
  248. // Action column
  249. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  250. print '<td class="liste_titre center maxwidthsearch">';
  251. $searchpicto = $form->showFilterButtons('left');
  252. print $searchpicto;
  253. print '</td>';
  254. }
  255. print '<td class="liste_titre"><input type="text" class="flat" name="search_line" value="'.dol_escape_htmltag($search_line).'" size="6"></td>';
  256. print '<td class="liste_titre"><input type="text" class="flat" name="search_bon" value="'.dol_escape_htmltag($search_bon).'" size="6"></td>';
  257. print '<td class="liste_titre">&nbsp;</td>';
  258. print '<td class="liste_titre"><input type="text" class="flat" name="search_company" value="'.dol_escape_htmltag($search_company).'" size="6"></td>';
  259. print '<td class="liste_titre center"><input type="text" class="flat" name="search_code" value="'.dol_escape_htmltag($search_code).'" size="6"></td>';
  260. print '<td class="liste_titre">&nbsp;</td>';
  261. print '<td class="liste_titre">&nbsp;</td>';
  262. // Action column
  263. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  264. print '<td class="liste_titre center maxwidthsearch">';
  265. $searchpicto = $form->showFilterButtons();
  266. print $searchpicto;
  267. print '</td>';
  268. }
  269. print '</tr>'."\n";
  270. $totalarray = array();
  271. $totalarray['nbfield'] = 0;
  272. $columntitle = "WithdrawalsReceipts";
  273. $columntitlethirdparty = "CustomerCode";
  274. $columncodethirdparty = "s.code_client";
  275. if ($type == 'bank-transfer') {
  276. $columntitle = "BankTransferReceipts";
  277. $columntitlethirdparty = "SupplierCode";
  278. $columncodethirdparty = "s.code_fournisseur";
  279. }
  280. // Fields title label
  281. // --------------------------------------------------------------------
  282. print '<tr class="liste_titre">';
  283. // Action column
  284. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  285. print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
  286. $totalarray['nbfield']++;
  287. }
  288. print_liste_field_titre($columntitle, $_SERVER["PHP_SELF"], "p.ref", '', $param, '', $sortfield, $sortorder);
  289. $totalarray['nbfield']++;
  290. print_liste_field_titre("Line", $_SERVER["PHP_SELF"], '', '', $param, '', $sortfield, $sortorder);
  291. $totalarray['nbfield']++;
  292. print_liste_field_titre("Bill", $_SERVER["PHP_SELF"], "f.ref", '', $param, '', $sortfield, $sortorder);
  293. $totalarray['nbfield']++;
  294. print_liste_field_titre("Company", $_SERVER["PHP_SELF"], "s.nom", '', $param, '', $sortfield, $sortorder);
  295. $totalarray['nbfield']++;
  296. print_liste_field_titre($columntitlethirdparty, $_SERVER["PHP_SELF"], $columncodethirdparty, '', $param, '', $sortfield, $sortorder, 'center ');
  297. $totalarray['nbfield']++;
  298. print_liste_field_titre("Date", $_SERVER["PHP_SELF"], "p.datec", "", $param, '', $sortfield, $sortorder, 'center ');
  299. $totalarray['nbfield']++;
  300. print_liste_field_titre("Amount", $_SERVER["PHP_SELF"], "pl.amount", "", $param, '', $sortfield, $sortorder, 'right ');
  301. $totalarray['nbfield']++;
  302. // Action column
  303. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  304. print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
  305. $totalarray['nbfield']++;
  306. }
  307. print '</tr>'."\n";
  308. // Loop on record
  309. // --------------------------------------------------------------------
  310. $i = 0;
  311. $savnbfield = $totalarray['nbfield'];
  312. $totalarray = array();
  313. $totalarray['nbfield'] = 0;
  314. $imaxinloop = ($limit ? min($num, $limit) : $num);
  315. while ($i < $imaxinloop) {
  316. $obj = $db->fetch_object($resql);
  317. $bon->id = $obj->rowid;
  318. $bon->ref = $obj->ref;
  319. $bon->statut = $obj->status;
  320. $bon->date_echeance = $obj->datec;
  321. $bon->total = $obj->amount;
  322. $object = $bon;
  323. $company->id = $obj->socid;
  324. $company->name = $obj->name;
  325. $company->email = $obj->email;
  326. $company->code_client = $obj->code_client;
  327. if ($mode == 'kanban') {
  328. if ($i == 0) {
  329. print '<tr><td colspan="'.$savnbfield.'">';
  330. print '<div class="box-flex-container kanban">';
  331. }
  332. // Output Kanban
  333. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  334. $selected = 0;
  335. if (in_array($object->id, $arrayofselected)) {
  336. $selected = 1;
  337. }
  338. }
  339. print $object->getKanbanView('', array('selected' => in_array($bon->id, $arrayofselected)));
  340. if ($i == ($imaxinloop - 1)) {
  341. print '</div>';
  342. print '</td></tr>';
  343. }
  344. } else {
  345. // Show line of result
  346. $j = 0;
  347. print '<tr data-rowid="'.$object->id.'" class="oddeven">';
  348. // Action column
  349. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  350. print '<td class="nowrap center">';
  351. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  352. $selected = 0;
  353. if (in_array($object->id, $arrayofselected)) {
  354. $selected = 1;
  355. }
  356. print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
  357. }
  358. print '</td>';
  359. if (!$i) {
  360. $totalarray['nbfield']++;
  361. }
  362. }
  363. print '<td>';
  364. print $bon->getNomUrl(1);
  365. print "</td>\n";
  366. print '<td>';
  367. print $line->LibStatut($obj->statut_ligne, 2);
  368. print "&nbsp;";
  369. print '<a href="'.DOL_URL_ROOT.'/compta/prelevement/line.php?id='.$obj->rowid_ligne.'">';
  370. print substr('000000'.$obj->rowid_ligne, -6);
  371. print '</a></td>';
  372. print '<td>';
  373. $link_to_bill = '/compta/facture/card.php?facid=';
  374. $link_title = 'Invoice';
  375. $link_picto = 'bill';
  376. if ($type == 'bank-transfer') {
  377. $link_to_bill = '/fourn/facture/card.php?facid=';
  378. $link_title = 'SupplierInvoice';
  379. $link_picto = 'supplier_invoice';
  380. }
  381. print '<a href="'.DOL_URL_ROOT.$link_to_bill.$obj->facid.'">';
  382. print img_object($langs->trans($link_title), $link_picto);
  383. print '&nbsp;'.$obj->invoiceref."</td>\n";
  384. print '</a>';
  385. print '</td>';
  386. print '<td>';
  387. print $company->getNomUrl(1);
  388. print "</td>\n";
  389. print '<td class="center">';
  390. $link_to_tab = '/comm/card.php?socid=';
  391. $link_code = $obj->code_client;
  392. if ($type == 'bank-transfer') {
  393. $link_to_tab = '/fourn/card.php?socid=';
  394. $link_code = $obj->code_fournisseur;
  395. }
  396. print '<a href="'.DOL_URL_ROOT.$link_to_tab.$company->id.'">'.$link_code."</a></td>\n";
  397. print '<td class="center">'.dol_print_date($db->jdate($obj->datec), 'day')."</td>\n";
  398. print '<td class="right"><span class="amount">'.price($obj->amount)."</span></td>\n";
  399. // Action column
  400. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  401. print '<td class="nowrap center">';
  402. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  403. $selected = 0;
  404. if (in_array($object->id, $arrayofselected)) {
  405. $selected = 1;
  406. }
  407. print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
  408. }
  409. print '</td>';
  410. if (!$i) {
  411. $totalarray['nbfield']++;
  412. }
  413. }
  414. print '</tr>'."\n";
  415. }
  416. $i++;
  417. }
  418. if ($num == 0) {
  419. print '<tr><td colspan="8"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
  420. }
  421. $db->free($result);
  422. $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
  423. $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  424. print $hookmanager->resPrint;
  425. print '</table>'."\n";
  426. print '</div>'."\n";
  427. print '</form>'."\n";
  428. // End of page
  429. llxFooter();
  430. $db->close();