rollerstorageinventoryindex.php 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859
  1. <?php
  2. /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  16. */
  17. /**
  18. * \file htdocs/custom/rollerstorage/rollerstorageindex.php
  19. * \ingroup inventory
  20. * \brief List page for inventory
  21. */
  22. // Load Dolibarr environment
  23. require '../../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
  25. require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
  26. require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
  27. require_once DOL_DOCUMENT_ROOT . '/product/inventory/class/inventory.class.php';
  28. require_once DOL_DOCUMENT_ROOT . '/product/stock/class/entrepot.class.php';
  29. require_once DOL_DOCUMENT_ROOT . '/custom/rollerstorage/class/statuses.class.php';
  30. require_once DOL_DOCUMENT_ROOT . '/custom/rollerstorage/core/modules/modRollerstorage.class.php';
  31. if (isModEnabled('categorie')) {
  32. require_once DOL_DOCUMENT_ROOT . '/categories/class/categorie.class.php';
  33. }
  34. // Load translation files required by the page
  35. $langs->loadLangs(array("stocks", "other"));
  36. $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
  37. $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
  38. $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
  39. $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
  40. $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
  41. $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
  42. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'inventorylist'; // To manage different context of search
  43. $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
  44. $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
  45. $inventory_id = GETPOST('inventory_id', 'int');
  46. $idmenu = GETPOST('idmenu', 'int');
  47. $id = GETPOST('id', 'int');
  48. // Load variable for pagination
  49. $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
  50. $sortfield = GETPOST('sortfield', 'aZ09comma');
  51. $sortorder = GETPOST('sortorder', 'aZ09comma');
  52. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  53. if (empty($page) || $page == -1 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha') || (empty($toselect) && $massaction === '0')) {
  54. // If $page is not defined, or '' or -1 or if we click on clear filters or if we select empty mass action
  55. $page = 0;
  56. }
  57. $offset = $limit * $page;
  58. $pageprev = $page - 1;
  59. $pagenext = $page + 1;
  60. // Initialize technical objects
  61. $object = new Inventory($db);
  62. $extrafields = new ExtraFields($db);
  63. $stasusesObj = new Statuses($db);
  64. $modRollerstorage = new modRollerstorage($db);
  65. if ($inventory_id) {
  66. $warehouseObj = getWarehouseData($inventory_id, $db);
  67. }
  68. $backurlforlist = '/custom/rollerstorage/rollerstorageinventoryindex.php?inventory_id=' . $inventory_id . '&idmenu=' . $idmenu . '&leftmenu=';
  69. function getWarehouses($db)
  70. {
  71. $warehousesObj = [];
  72. $warehouses = new Entrepot($db);
  73. $sql = "SELECT rowid, ref FROM " . $db->prefix() . $warehouses->table_element . " ORDER BY rowid ASC";
  74. $myWarehousesObj = $db->query($sql);
  75. while ($warehouse = pg_fetch_assoc($myWarehousesObj)) {
  76. $warehousesObj[] = $warehouse;
  77. }
  78. return $warehousesObj;
  79. }
  80. function getWarehouseData($inventory_id, $db)
  81. {
  82. $warehouses = new Entrepot($db);
  83. $sql = "SELECT rowid, ref, lieu, address, zip, town FROM " . $db->prefix() . $warehouses->table_element . " WHERE rowid = " . $inventory_id;
  84. $myWarehousesObj = $db->query($sql);
  85. while ($warehouse = pg_fetch_assoc($myWarehousesObj)) {
  86. return $warehouse;
  87. }
  88. }
  89. function getWarehouseStatusAndInventoryData($inventory_id, $db)
  90. {
  91. $data = [];
  92. $sql = "select s.status_id, s.ref, e.ref AS warehouse, count(i.rowid) as numberofstatuses
  93. FROM llx_inventory AS i
  94. INNER JOIN llx_entrepot AS e ON e.rowid = i.fk_warehouse
  95. INNER JOIN llx_rollerstorage_statuses as s ON i.status = s.status_id
  96. WHERE i.fk_warehouse = {$inventory_id}
  97. group by e.rowid, i.status, s.ref, s.status_id
  98. ORDER BY e.ref";
  99. $res = $db->query($sql);
  100. while ($result = pg_fetch_assoc($res)) {
  101. $data[] = $result;
  102. }
  103. return $data;
  104. }
  105. function getLibStatus($object)
  106. {
  107. global $stasusesObj;
  108. global $db;
  109. $allapotok = $stasusesObj->getStatusIds($db);
  110. return '<span class="badge badge-status' . $object->status . ' badge-status" title="' . $allapotok[$object->status] . '">' . $allapotok[$object->status] . '</span>';
  111. }
  112. // no inventory docs yet
  113. // $diroutputmassaction = $conf->inventory->dir_output.'/temp/massgeneration/'.$user->id;
  114. $diroutputmassaction = null;
  115. $hookmanager->initHooks(array('inventorylist')); // Note that conf->hooks_modules contains array
  116. // Fetch optionals attributes and labels
  117. $extrafields->fetch_name_optionals_label($object->table_element);
  118. $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
  119. // Default sort order (if not yet defined by previous GETPOST)
  120. if (!$sortfield) {
  121. reset($object->fields); // Reset is required to avoid key() to return null.
  122. $sortfield = "t." . key($object->fields); // Set here default search field. By default 1st field in definition.
  123. }
  124. if (!$sortorder) {
  125. $sortorder = "ASC";
  126. }
  127. // Initialize array of search criterias
  128. $search_all = GETPOST('search_all', 'alphanohtml');
  129. $search = array();
  130. foreach ($object->fields as $key => $val) {
  131. if (GETPOST('search_' . $key, 'alpha') !== '') {
  132. $search[$key] = GETPOST('search_' . $key, 'alpha');
  133. }
  134. if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  135. $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int'));
  136. $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int'));
  137. }
  138. }
  139. $searchCategoryProductOperator = 0;
  140. if (GETPOSTISSET('formfilteraction')) {
  141. $searchCategoryProductOperator = GETPOST('search_category_product_operator', 'int');
  142. } elseif (!empty($conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT)) {
  143. $searchCategoryProductOperator = $conf->global->MAIN_SEARCH_CAT_OR_BY_DEFAULT;
  144. }
  145. $searchCategoryProductList = GETPOST('search_category_product_list', 'array');
  146. // List of fields to search into when doing a "search in all"
  147. $fieldstosearchall = array();
  148. foreach ($object->fields as $key => $val) {
  149. if (!empty($val['searchall'])) {
  150. $fieldstosearchall['t.' . $key] = $val['label'];
  151. }
  152. }
  153. // Definition of array of fields for columns
  154. $arrayfields = array();
  155. foreach ($object->fields as $key => $val) {
  156. // If $val['visible']==0, then we never show the field
  157. if (!empty($val['visible'])) {
  158. $visible = (int) dol_eval($val['visible'], 1, 1, '1');
  159. $arrayfields['t.' . $key] = array(
  160. 'label' => $val['label'],
  161. 'checked' => (($visible < 0) ? 0 : 1),
  162. 'enabled' => ($visible != 3 && dol_eval($val['enabled'], 1, 1, '1')),
  163. 'position' => $val['position'],
  164. 'help' => isset($val['help']) ? $val['help'] : ''
  165. );
  166. }
  167. }
  168. // Extra fields
  169. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
  170. $object->fields = dol_sort_array($object->fields, 'position');
  171. $arrayfields = dol_sort_array($arrayfields, 'position');
  172. //$permissiontoread = $user->rights->stock->lire;
  173. //$permissiontoadd = $user->rights->stock->creer;
  174. //$permissiontodelete = $user->rights->stock->supprimer;
  175. $read = 'read_' . $inventory_id;
  176. $write = 'write_' . $inventory_id;
  177. $delete = 'delete_' . $inventory_id;
  178. $permissiontoread = $user->rights->rollerstorage->rollerhistory->$read;
  179. $permissiontoadd = $user->rights->rollerstorage->rollerhistory->$write;
  180. $permissiontodelete = $user->rights->rollerstorage->rollerhistory->$delete;
  181. // Security check
  182. $socid = 0;
  183. if ($user->socid > 0) { // Protection if external user
  184. //$socid = $user->socid;
  185. accessforbidden();
  186. }
  187. if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
  188. $result = restrictedArea($user, 'stock');
  189. } else {
  190. $result = restrictedArea($user, 'stock', 0, '', 'inventory_advance');
  191. }
  192. /*
  193. * Actions
  194. */
  195. if (GETPOST('cancel', 'alpha')) {
  196. $action = 'list';
  197. $massaction = '';
  198. }
  199. if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
  200. $massaction = '';
  201. }
  202. $parameters = array();
  203. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  204. if ($reshook < 0) {
  205. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  206. }
  207. if (empty($reshook)) {
  208. // Selection of new fields
  209. include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
  210. // Purge search criteria
  211. 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
  212. foreach ($object->fields as $key => $val) {
  213. $search[$key] = '';
  214. if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  215. $search[$key . '_dtstart'] = '';
  216. $search[$key . '_dtend'] = '';
  217. }
  218. }
  219. $searchCategoryProductList = array();
  220. $toselect = array();
  221. $search_array_options = array();
  222. }
  223. if (
  224. GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
  225. || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')
  226. ) {
  227. $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
  228. }
  229. // Mass actions
  230. $objectclass = 'Inventory';
  231. $objectlabel = 'Inventory';
  232. $uploaddir = $conf->stock->dir_output;
  233. include DOL_DOCUMENT_ROOT . '/custom/rollerstorage/actions_massactions.inc.php';
  234. }
  235. /*
  236. * View
  237. */
  238. $form = new Form($db);
  239. $now = dol_now();
  240. //$help_url="EN:Module_Inventory|FR:Module_Inventory_FR|ES:Módulo_Inventory";
  241. $help_url = '';
  242. //$title = $langs->trans('ListOfInventories');
  243. $title = 'Raktár: ' . $warehouseObj['ref'];
  244. $morejs = array();
  245. $morecss = array();
  246. /*
  247. Kell a statuszok atirasahoz, mert az llx_inventoryban a status rowid-helyett status_id-et tartalmaz
  248. */
  249. $statusesForSQL = array_flip($stasusesObj->getStatusidsAndRowids());
  250. //____________________________________________________________________
  251. // Build and execute select
  252. // --------------------------------------------------------------------
  253. $sql = 'SELECT ent.*, ';
  254. $sql .= $object->getFieldList('t');
  255. // Add fields from extrafields
  256. if (!empty($extrafields->attributes[$object->table_element]['label'])) {
  257. foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
  258. $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . " as options_" . $key : '');
  259. }
  260. }
  261. // Add fields from hooks
  262. $parameters = array();
  263. $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
  264. $sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
  265. $sql = preg_replace('/,\s*$/', '', $sql);
  266. $sqlfields = $sql; // $sql fields to remove for count total
  267. $sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t";
  268. if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
  269. $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (t.rowid = ef.fk_object)";
  270. }
  271. //print $sql;exit;
  272. $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "entrepot AS ent ON t.fk_warehouse = ent.rowid ";
  273. // Add table from hooks
  274. $parameters = array();
  275. $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
  276. $sql .= $hookmanager->resPrint;
  277. if ($object->ismultientitymanaged == 1) {
  278. $sql .= " WHERE t.entity IN (" . getEntity($object->element) . ")";
  279. } else {
  280. $sql .= " WHERE 1 = 1";
  281. }
  282. if ($inventory_id) {
  283. $sql .= " AND t.fk_warehouse = {$inventory_id}";
  284. }
  285. foreach ($search as $key => $val) {
  286. if (array_key_exists($key, $object->fields)) {
  287. if ($key == 'status' && $search[$key] == -1) {
  288. continue;
  289. }
  290. $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
  291. if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
  292. if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
  293. $search[$key] = '';
  294. }
  295. $mode_search = 2;
  296. }
  297. if ($search[$key] != '') {
  298. $akey = 't.' . $key;
  299. if($key == 'status'){
  300. $search[$key] = $statusesForSQL[$val];
  301. }
  302. $sql .= natural_search($akey, $search[$key], (($key == 'status') ? 2 : $mode_search));
  303. }
  304. } else {
  305. if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
  306. $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
  307. if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
  308. if (preg_match('/_dtstart$/', $key)) {
  309. $sql .= " AND t." . $columnName . " >= '" . $db->idate($search[$key]) . "'";
  310. }
  311. if (preg_match('/_dtend$/', $key)) {
  312. $sql .= " AND t." . $columnName . " <= '" . $db->idate($search[$key]) . "'";
  313. }
  314. }
  315. }
  316. }
  317. }
  318. if ($search_all) {
  319. $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
  320. }
  321. // Search for tag/category ($searchCategoryProductList is an array of ID)
  322. if (!empty($searchCategoryProductList)) {
  323. $searchCategoryProductSqlList = array();
  324. $listofcategoryid = '';
  325. foreach ($searchCategoryProductList as $searchCategoryProduct) {
  326. if (intval($searchCategoryProduct) == -2) {
  327. $searchCategoryProductSqlList[] = "NOT EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck WHERE p.rowid = ck.fk_product)";
  328. } elseif (intval($searchCategoryProduct) > 0) {
  329. if ($searchCategoryProductOperator == 0) {
  330. $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie = " . ((int) $searchCategoryProduct) . ")";
  331. } else {
  332. $listofcategoryid .= ($listofcategoryid ? ', ' : '') . ((int) $searchCategoryProduct);
  333. }
  334. }
  335. }
  336. if ($listofcategoryid) {
  337. $searchCategoryProductSqlList[] = " EXISTS (SELECT ck.fk_product FROM " . MAIN_DB_PREFIX . "categorie_product as ck WHERE p.rowid = ck.fk_product AND ck.fk_categorie IN (" . $db->sanitize($listofcategoryid) . "))";
  338. }
  339. if ($searchCategoryProductOperator == 1) {
  340. if (!empty($searchCategoryProductSqlList)) {
  341. $sql .= " AND (" . implode(' OR ', $searchCategoryProductSqlList) . ")";
  342. }
  343. } else {
  344. if (!empty($searchCategoryProductSqlList)) {
  345. $sql .= " AND (" . implode(' AND ', $searchCategoryProductSqlList) . ")";
  346. }
  347. }
  348. }
  349. //print $sql;exit;
  350. // Add where from extra fields
  351. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php';
  352. // Add where from hooks
  353. $parameters = array();
  354. $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
  355. $sql .= $hookmanager->resPrint;
  356. //print $sql;exit;
  357. /* If a group by is required
  358. $sql.= " GROUP BY ";
  359. foreach($object->fields as $key => $val)
  360. {
  361. $sql .= "t.".$key.", ";
  362. }
  363. // Add fields from extrafields
  364. if (!empty($extrafields->attributes[$object->table_element]['label'])) {
  365. foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
  366. }
  367. // Add where from hooks
  368. $parameters=array();
  369. $reshook=$hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
  370. $sql.=$hookmanager->resPrint;
  371. $sql=preg_replace('/,\s*$/','', $sql);
  372. */
  373. /// Count total nb of records
  374. $nbtotalofrecords = '';
  375. if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
  376. /* The fast and low memory method to get and count full list converts the sql into a sql count */
  377. $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
  378. $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
  379. $resql = $db->query($sqlforcount);
  380. if ($resql) {
  381. $objforcount = $db->fetch_object($resql);
  382. $nbtotalofrecords = $objforcount->nbtotalofrecords;
  383. } else {
  384. dol_print_error($db);
  385. }
  386. if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
  387. $page = 0;
  388. $offset = 0;
  389. }
  390. $db->free($resql);
  391. }
  392. // Complete request and execute it with limit
  393. $sql .= $db->order($sortfield, $sortorder);
  394. if ($limit) {
  395. $sql .= $db->plimit($limit + 1, $offset);
  396. }
  397. $resql = $db->query($sql);
  398. if (!$resql) {
  399. dol_print_error($db);
  400. exit;
  401. }
  402. $num = $db->num_rows($resql);
  403. // Direct jump if only one record found
  404. if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
  405. $obj = $db->fetch_object($resql);
  406. $id = $obj->rowid;
  407. header("Location: " . DOL_URL_ROOT . '/custom/rollerstorage/card.php?id=' . $id);
  408. exit;
  409. }
  410. // Output page
  411. // --------------------------------------------------------------------
  412. llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'classforhorizontalscrolloftabs');
  413. $arrayofselected = is_array($toselect) ? $toselect : array();
  414. $param = '';
  415. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  416. $param .= '&contextpage=' . urlencode($contextpage);
  417. }
  418. if ($limit > 0 && $limit != $conf->liste_limit) {
  419. $param .= '&limit=' . urlencode($limit);
  420. }
  421. foreach ($search as $key => $val) {
  422. if (is_array($search[$key]) && count($search[$key])) {
  423. foreach ($search[$key] as $skey) {
  424. $param .= '&search_' . $key . '[]=' . urlencode($skey);
  425. }
  426. } else {
  427. $param .= '&search_' . $key . '=' . urlencode($search[$key]);
  428. }
  429. }
  430. if ($optioncss != '') {
  431. $param .= '&optioncss=' . urlencode($optioncss);
  432. }
  433. foreach ($searchCategoryProductList as $searchCategoryProduct) {
  434. $param .= "&search_category_product_list[]=" . urlencode($searchCategoryProduct);
  435. }
  436. // Add $param from extra fields
  437. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php';
  438. // Add $param from hooks
  439. $parameters = array();
  440. $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
  441. $param .= $hookmanager->resPrint;
  442. // List of mass actions available
  443. $warehouses = getWarehouses($db);
  444. /* if ($inventory_id !== '4') {
  445. $arrayofmassactions = array(
  446. 'preout_' . $inventory_id => img_picto('', 'fa-biking', 'class="pictofixedwidth"') . $langs->trans("inoutsidestatus"),
  447. 'prewarehouse_' . $inventory_id => img_picto('', 'fa-warehouse', 'class="pictofixedwidth"') . $langs->trans("inwarehousestatus"),
  448. 'prefaulty_' . $inventory_id => img_picto('', 'fa-exclamation-triangle', 'class="pictofixedwidth"') . $langs->trans("infaultystatus"),
  449. );
  450. } else { */
  451. $arrayofmassactions = array(
  452. 'preout_' . $inventory_id => img_picto('', 'fa-biking', 'class="pictofixedwidth"') . $langs->trans("inoutsidestatus"),
  453. 'prewarehouse_' . $inventory_id => img_picto('', 'fa-warehouse', 'class="pictofixedwidth"') . $langs->trans("inwarehousestatus"),
  454. 'prefaulty_' . $inventory_id => img_picto('', 'fa-exclamation-triangle', 'class="pictofixedwidth"') . $langs->trans("infaultystatus"),
  455. 'preservice_' . $inventory_id => img_picto('', 'fa-wrench', 'class="pictofixedwidth"') . $langs->trans("inservicestatus"),
  456. );
  457. //}
  458. foreach ($warehouses as $wh) {
  459. if ($wh['rowid'] !== $inventory_id) {
  460. /*if ($wh['rowid'] == 4) {
  461. $arrayofmassactions['towarehouse_' . $wh['rowid']] = img_picto('', 'fa-wrench', 'class="pictofixedwidth"') . $langs->trans("toservicestatus");
  462. } else {*/
  463. $arrayofmassactions['towarehouse_' . $wh['rowid']] = img_picto('', 'fa-warehouse', 'class="pictofixedwidth"') . $wh['ref'] . ' ' . $langs->trans("towarehousestatus");
  464. //}
  465. }
  466. }
  467. if ($permissiontodelete) {
  468. $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"') . $langs->trans("Delete");
  469. }
  470. if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
  471. $arrayofmassactions = array();
  472. }
  473. $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
  474. if ($permissiontoread || $permissiontoadd) {
  475. $url = $_SERVER["PHP_SELF"] . '?inventory_id=' . $inventory_id . '&idmenu=' . $idmenu . '&leftmenu=';
  476. print '<form method="POST" id="searchFormList" action="' . $url . '">' . "\n";
  477. if ($optioncss != '') {
  478. print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
  479. }
  480. print '<input type="hidden" name="token" value="' . newToken() . '">';
  481. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  482. print '<input type="hidden" name="action" value="list">';
  483. print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
  484. print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
  485. print '<input type="hidden" name="page" value="' . $page . '">';
  486. print '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
  487. //$newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT.'/product/inventory/card.php?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
  488. $newcardbutton = dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', DOL_URL_ROOT . '/custom/rollerstorage/card.php?action=create&inventory_id=' . $inventory_id, '', $permissiontoadd);
  489. $param .= '&inventory_id=' . $inventory_id . '&idmenu=' . $menuid . '&leftmenu=';
  490. $headTitle = 'Raktár: ' . $warehouseObj['ref'] . ' <font style="opacity: 0.4;">(' . $warehouseObj['zip'] . ' ' . $warehouseObj['town'] . ', ' . $warehouseObj['address'] . ')</font>';
  491. print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, $object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
  492. $icons = ['110' => 'fa-warehouse', '111' => 'fa-wrench', '112' => 'fa-biking', '113' => 'fa-truck', '114' => 'fa-exclamation-triangle'];
  493. $colors = ['110' => 'green', '111' => '#f8c471', '112' => '#a569bd', '113' => '#5499c7', '114' => 'Red'];
  494. foreach (getWarehouseStatusAndInventoryData($inventory_id, $db) as $data) {
  495. print '<div class="boxstats" style="border-left: 6px solid ' . $colors[$data['status_id']] . '">
  496. <span class="boxstatstext" title="' . $data['ref'] . '">' . $data['ref'] . '</span><br>
  497. <span class="boxstatsindicator"><span class="fa ' . $icons[$data['status_id']] . ' infobox-adherent inline-block" style=""></span> ' . $data['numberofstatuses'] . '</span>
  498. </div>';
  499. }
  500. // Add code for pre mass action (confirmation or email presend form)
  501. $topicmail = "Information";
  502. $modelmail = "inventory";
  503. $objecttmp = new Inventory($db);
  504. $trackid = 'stockinv' . $object->id;
  505. include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php';
  506. if ($search_all) {
  507. foreach ($fieldstosearchall as $key => $val) {
  508. $fieldstosearchall[$key] = $langs->trans($val);
  509. }
  510. print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '</div>';
  511. }
  512. $moreforfilter = '';
  513. /*$moreforfilter.='<div class="divsearchfield">';
  514. $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
  515. $moreforfilter.= '</div>';*/
  516. // Filter on categories
  517. if (!empty($conf->global->MAIN_SEARCH_CATEGORY_PRODUCT_ON_LISTS) && isModEnabled('categorie') && $user->rights->categorie->lire) {
  518. $moreforfilter .= '<div class="divsearchfield">';
  519. $tmptitle = $langs->transnoentities('ProductsCategoriesShort');
  520. $moreforfilter .= img_picto($tmptitle, 'category', 'class="pictofixedwidth"');
  521. $categoriesProductArr = $form->select_all_categories(Categorie::TYPE_PRODUCT, '', '', 64, 0, 1);
  522. $categoriesProductArr[-2] = '- ' . $langs->trans('NotCategorized') . ' -';
  523. $moreforfilter .= Form::multiselectarray('search_category_product_list', $categoriesProductArr, $searchCategoryProductList, 0, 0, 'minwidth300', 0, 0, '', 'category', $tmptitle);
  524. $moreforfilter .= ' <input type="checkbox" class="valignmiddle" id="search_category_product_operator" name="search_category_product_operator" value="1"' . ($searchCategoryProductOperator == 1 ? ' checked="checked"' : '') . '/>';
  525. $moreforfilter .= $form->textwithpicto('', $langs->trans('UseOrOperatorForCategories') . ' : ' . $tmptitle, 1, 'help', '', 0, 2, 'tooltip_cat_pro'); // Tooltip on click
  526. $moreforfilter .= '</div>';
  527. }
  528. $parameters = array();
  529. $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
  530. if (empty($reshook)) {
  531. $moreforfilter .= $hookmanager->resPrint;
  532. } else {
  533. $moreforfilter = $hookmanager->resPrint;
  534. }
  535. if (!empty($moreforfilter)) {
  536. print '<div class="liste_titre liste_titre_bydiv centpercent">';
  537. print $moreforfilter;
  538. print '</div>';
  539. }
  540. $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
  541. $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
  542. if ($permissiontoadd) {
  543. $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
  544. }
  545. print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  546. print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
  547. // Fields title search
  548. // --------------------------------------------------------------------
  549. print '<tr class="liste_titre">';
  550. // Action column
  551. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  552. print '<td class="liste_titre maxwidthsearch">';
  553. $searchpicto = $form->showFilterButtons('left');
  554. print $searchpicto;
  555. print '</td>';
  556. }
  557. foreach ($object->fields as $key => $val) {
  558. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  559. if ($key == 'status') {
  560. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  561. } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  562. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  563. } elseif (in_array($val['type'], array('timestamp'))) {
  564. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  565. } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
  566. $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
  567. }
  568. if (!empty($arrayfields['t.' . $key]['checked'])) {
  569. print '<td class="liste_titre' . ($cssforfield ? ' ' . $cssforfield : '') . '">';
  570. if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
  571. print $form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
  572. } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
  573. print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', 'maxwidth125', 1);
  574. } elseif (!preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  575. print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">';
  576. } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  577. print '<div class="nowrap">';
  578. print $form->selectDate($search[$key . '_dtstart'] ? $search[$key . '_dtstart'] : '', "search_" . $key . "_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
  579. print '</div>';
  580. print '<div class="nowrap">';
  581. print $form->selectDate($search[$key . '_dtend'] ? $search[$key . '_dtend'] : '', "search_" . $key . "_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
  582. print '</div>';
  583. }
  584. print '</td>';
  585. }
  586. }
  587. // Extra fields
  588. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php';
  589. // Fields from hook
  590. $parameters = array('arrayfields' => $arrayfields);
  591. $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
  592. print $hookmanager->resPrint;
  593. // Action column
  594. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  595. print '<td class="liste_titre maxwidthsearch">';
  596. $searchpicto = $form->showFilterButtons();
  597. print $searchpicto;
  598. print '</td>';
  599. }
  600. print '</tr>' . "\n";
  601. // Fields title label
  602. // --------------------------------------------------------------------
  603. print '<tr class="liste_titre">';
  604. // Action column
  605. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  606. print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ') . "\n";
  607. }
  608. foreach ($object->fields as $key => $val) {
  609. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  610. if ($key == 'status') {
  611. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  612. } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  613. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  614. } elseif (in_array($val['type'], array('timestamp'))) {
  615. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  616. } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
  617. $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
  618. }
  619. if (!empty($arrayfields['t.' . $key]['checked'])) {
  620. print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $_SERVER['PHP_SELF'], 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n";
  621. }
  622. }
  623. // Extra fields
  624. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php';
  625. // Hook fields
  626. $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder);
  627. $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
  628. print $hookmanager->resPrint;
  629. // Action column
  630. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  631. print getTitleFieldOfList($selectedfields, 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ') . "\n";
  632. }
  633. print '</tr>' . "\n";
  634. // Detect if we need a fetch on each output line
  635. $needToFetchEachLine = 0;
  636. if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
  637. foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
  638. if (preg_match('/\$object/', $val)) {
  639. $needToFetchEachLine++; // There is at least one compute field that use $object
  640. }
  641. }
  642. }
  643. // Loop on record
  644. // --------------------------------------------------------------------
  645. $i = 0;
  646. $totalarray = array();
  647. $totalarray['nbfield'] = 0;
  648. while ($i < ($limit ? min($num, $limit) : $num)) {
  649. $obj = $db->fetch_object($resql);
  650. if (empty($obj)) {
  651. break; // Should not happen
  652. }
  653. // Store properties in $object
  654. $object->setVarsFromFetchObj($obj);
  655. // Show here line of result
  656. print '<tr class="oddeven">';
  657. // Action column
  658. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  659. print '<td class="nowrap center">';
  660. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  661. $selected = 0;
  662. if (in_array($object->id, $arrayofselected)) {
  663. $selected = 1;
  664. }
  665. print '<input id="cb' . $object->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $object->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
  666. }
  667. print '</td>';
  668. }
  669. foreach ($object->fields as $key => $val) {
  670. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  671. if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  672. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  673. } elseif ($key == 'status') {
  674. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  675. }
  676. if (in_array($val['type'], array('timestamp'))) {
  677. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  678. } elseif ($key == 'ref') {
  679. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  680. }
  681. if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
  682. $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
  683. }
  684. if (!empty($arrayfields['t.' . $key]['checked'])) {
  685. print '<td' . ($cssforfield ? ' class="' . $cssforfield . '"' : '') . '>';
  686. $typeData = explode(':', $val['type']);
  687. if ($key == 'status') {
  688. print getLibStatus($object);
  689. //print $object->getLibStatut(5);
  690. } elseif ($key == 'rowid') {
  691. print $object->showOutputField($val, $key, $object->id, '');
  692. } elseif ($key == 'ref') {
  693. print '<span class="fas fa-boxes paddingright classfortooltip" style=" color: #a69944;"></span><a href="' . DOL_URL_ROOT . '/custom/rollerstorage/card.php?id=' . $object->id . '&inventory_id=' . $inventory_id . '&backtopage=' . $backurlforlist . '">' . $object->$key . '</a>';
  694. } elseif (isset($typeData[1]) && $typeData[1] == 'Entrepot') {
  695. print '<div title="<span class=&quot;fas fa-box-open em080&quot; style=&quot; color: #a69944;&quot; cursor: pointer;></span> <u class=&quot;paddingrightonly&quot;>Raktár</u><br><b>Ref.:</b> ' . $obj->address . '<br>
  696. <b>A hely rövid neve:</b> ' . $obj->lieu . '" class="classfortooltip"><span class="fas fa-box-open em080 paddingright classfortooltip" style=" color: #a69944;"></span>
  697. ' . $obj->lieu . '</div>';
  698. } else {
  699. print $object->showOutputField($val, $key, $object->$key, '');
  700. }
  701. print '</td>';
  702. if (!$i) {
  703. $totalarray['nbfield']++;
  704. }
  705. if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
  706. if (!$i) {
  707. $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
  708. }
  709. if (!isset($totalarray['val'])) {
  710. $totalarray['val'] = array();
  711. }
  712. if (!isset($totalarray['val']['t.' . $key])) {
  713. $totalarray['val']['t.' . $key] = 0;
  714. }
  715. $totalarray['val']['t.' . $key] += $object->$key;
  716. }
  717. }
  718. }
  719. // Extra fields
  720. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php';
  721. // Fields from hook
  722. $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
  723. $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
  724. print $hookmanager->resPrint;
  725. // Action column
  726. if ($permissiontoadd) {
  727. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  728. print '<td class="nowrap center">';
  729. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  730. $selected = 0;
  731. if (in_array($object->id, $arrayofselected)) {
  732. $selected = 1;
  733. }
  734. print '<input id="cb' . $object->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $object->status . '_' . $object->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
  735. }
  736. print '</td>';
  737. }
  738. }
  739. if (!$i) {
  740. $totalarray['nbfield']++;
  741. }
  742. print '</tr>' . "\n";
  743. $i++;
  744. }
  745. // Show total line
  746. //include DOL_DOCUMENT_ROOT . '/core/tpl/list_print_total.tpl.php';
  747. // If no record found
  748. if ($num == 0) {
  749. $colspan = 1;
  750. foreach ($arrayfields as $key => $val) {
  751. if (!empty($val['checked'])) {
  752. $colspan++;
  753. }
  754. }
  755. print '<tr><td colspan="' . $colspan . '" class="opacitymedium">' . $langs->trans("NoRecordFound") . '</td></tr>';
  756. }
  757. $db->free($resql);
  758. $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
  759. $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object); // Note that $action and $object may have been modified by hook
  760. print $hookmanager->resPrint;
  761. print '</table>' . "\n";
  762. print '</div>' . "\n";
  763. print '</form>' . "\n";
  764. } else {
  765. print '<div class="error">Hozzáférés megtagadva.<br>Egy letiltott modul oldalához, területéhez vagy szolgáltatásához próbál hozzáférni, vagy anélkül, hogy hitelesített munkamenetben lenne, vagy amely nem engedélyezett a felhasználó számára.</div>';
  766. }
  767. // End of page
  768. llxFooter();
  769. $db->close();