rollerhistory.tpl.php 38 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825
  1. <?php
  2. /* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
  3. * Copyright (C) 2023 László Szollősi
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  17. */
  18. /**
  19. * \file rollerhistory_list.php
  20. * \ingroup rollerstorage
  21. * \brief List page for rollerhistory
  22. */
  23. //if (! defined('NOREQUIREDB')) define('NOREQUIREDB', '1'); // Do not create database handler $db
  24. //if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER', '1'); // Do not load object $user
  25. //if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC', '1'); // Do not load object $mysoc
  26. //if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN', '1'); // Do not load object $langs
  27. //if (! defined('NOSCANGETFORINJECTION')) define('NOSCANGETFORINJECTION', '1'); // Do not check injection attack on GET parameters
  28. //if (! defined('NOSCANPOSTFORINJECTION')) define('NOSCANPOSTFORINJECTION', '1'); // Do not check injection attack on POST parameters
  29. //if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL', '1'); // Do not roll the Anti CSRF token (used if MAIN_SECURITY_CSRF_WITH_TOKEN is on)
  30. //if (! defined('NOSTYLECHECK')) define('NOSTYLECHECK', '1'); // Do not check style html tag into posted data
  31. //if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU', '1'); // If there is no need to load and show top and left menu
  32. //if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML', '1'); // If we don't need to load the html.form.class.php
  33. //if (! defined('NOREQUIREAJAX')) define('NOREQUIREAJAX', '1'); // Do not load ajax.lib.php library
  34. //if (! defined("NOLOGIN")) define("NOLOGIN", '1'); // If this page is public (can be called outside logged session). This include the NOIPCHECK too.
  35. //if (! defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
  36. //if (! defined("MAIN_LANG_DEFAULT")) define('MAIN_LANG_DEFAULT', 'auto'); // Force lang to a particular value
  37. //if (! defined("MAIN_AUTHENTICATION_MODE")) define('MAIN_AUTHENTICATION_MODE', 'aloginmodule'); // Force authentication handler
  38. //if (! defined("MAIN_SECURITY_FORCECSP")) define('MAIN_SECURITY_FORCECSP', 'none'); // Disable all Content Security Policies
  39. //if (! defined('CSRFCHECK_WITH_TOKEN')) define('CSRFCHECK_WITH_TOKEN', '1'); // Force use of CSRF protection with tokens even for GET
  40. //if (! defined('NOBROWSERNOTIF')) define('NOBROWSERNOTIF', '1'); // Disable browser notification
  41. //if (! defined('NOSESSION')) define('NOSESSION', '1'); // On CLI mode, no need to use web sessions
  42. // Load Dolibarr environment
  43. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formcompany.class.php';
  44. require_once DOL_DOCUMENT_ROOT . '/core/lib/date.lib.php';
  45. require_once DOL_DOCUMENT_ROOT . '/core/lib/company.lib.php';
  46. require_once DOL_DOCUMENT_ROOT . '/custom/rollerstorage/class/statuses.class.php';
  47. // load rollerstorage libraries
  48. //require_once __DIR__.'/../class/rollerhistory.class.php';
  49. require_once DOL_DOCUMENT_ROOT . '/custom/rollerstorage/class/rollerhistory.class.php';
  50. // for other modules
  51. //dol_include_once('/othermodule/class/otherobject.class.php');
  52. // Load translation files required by the page
  53. $langs->loadLangs(array("rollerstorage@rollerstorage", "other"));
  54. $action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'create'/'add', 'edit'/'update', 'view', ...
  55. $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
  56. $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
  57. $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
  58. $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
  59. $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
  60. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : str_replace('_', '', basename(dirname(__FILE__)) . basename(__FILE__, '.php')); // To manage different context of search
  61. $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
  62. $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
  63. $mode = GETPOST('mode', 'aZ'); // The output mode ('list', 'kanban', 'hierarchy', 'calendar', ...)
  64. $inventory_id = GETPOST('inventory_id', 'int') ? GETPOST('inventory_id', 'int') : null;
  65. $idmenu = GETPOST('idmenu', 'int');
  66. $id = GETPOST('id', 'int');
  67. $ref = GETPOST('ref', 'alpha');
  68. // Load variable for pagination
  69. $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
  70. $sortfield = GETPOST('sortfield', 'aZ09comma');
  71. $sortorder = GETPOST('sortorder', 'aZ09comma');
  72. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  73. if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
  74. // If $page is not defined, or '' or -1 or if we click on clear filters
  75. $page = 0;
  76. }
  77. $offset = $limit * $page;
  78. $pageprev = $page - 1;
  79. $pagenext = $page + 1;
  80. // Initialize technical objects
  81. $object = new RollerHistory($db);
  82. $extrafields = new ExtraFields($db);
  83. $diroutputmassaction = $conf->rollerstorage->dir_output . '/temp/massgeneration/' . $user->id;
  84. $hookmanager->initHooks(array('rollerhistorylist')); // Note that conf->hooks_modules contains array
  85. $statuses = new Statuses($db);
  86. $statusesObj = $statuses->getStatusIdsWithRowid($db);
  87. // Fetch optionals attributes and labels
  88. $extrafields->fetch_name_optionals_label($object->table_element);
  89. //$extrafields->fetch_name_optionals_label($object->table_element_line);
  90. $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
  91. // Default sort order (if not yet defined by previous GETPOST)
  92. if (!$sortfield) {
  93. reset($object->fields); // Reset is required to avoid key() to return null.
  94. $sortfield = "t." . key($object->fields); // Set here default search field. By default 1st field in definition.
  95. }
  96. if (!$sortorder) {
  97. $sortorder = "ASC";
  98. }
  99. // Initialize array of search criterias
  100. $search_all = GETPOST('search_all', 'alphanohtml') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
  101. $search = array();
  102. foreach ($object->fields as $key => $val) {
  103. if (GETPOST('search_' . $key, 'alpha') !== '') {
  104. $search[$key] = GETPOST('search_' . $key, 'alpha');
  105. }
  106. if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  107. $search[$key . '_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_' . $key . '_dtstartmonth', 'int'), GETPOST('search_' . $key . '_dtstartday', 'int'), GETPOST('search_' . $key . '_dtstartyear', 'int'));
  108. $search[$key . '_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_' . $key . '_dtendmonth', 'int'), GETPOST('search_' . $key . '_dtendday', 'int'), GETPOST('search_' . $key . '_dtendyear', 'int'));
  109. }
  110. }
  111. // List of fields to search into when doing a "search in all"
  112. $fieldstosearchall = array();
  113. foreach ($object->fields as $key => $val) {
  114. if (!empty($val['searchall'])) {
  115. $fieldstosearchall['t.' . $key] = $val['label'];
  116. }
  117. }
  118. // Definition of array of fields for columns
  119. $arrayfields = array();
  120. foreach ($object->fields as $key => $val) {
  121. // If $val['visible']==0, then we never show the field
  122. if (!empty($val['visible'])) {
  123. $visible = (int) dol_eval($val['visible'], 1);
  124. $arrayfields['t.' . $key] = array(
  125. 'label' => $val['label'],
  126. 'checked' => (($visible < 0) ? 0 : 1),
  127. 'enabled' => (abs($visible) != 3 && dol_eval($val['enabled'], 1)),
  128. 'position' => $val['position'],
  129. 'help' => isset($val['help']) ? $val['help'] : ''
  130. );
  131. }
  132. }
  133. // Extra fields
  134. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_array_fields.tpl.php';
  135. $object->fields = dol_sort_array($object->fields, 'position');
  136. //$arrayfields['anotherfield'] = array('type'=>'integer', 'label'=>'AnotherField', 'checked'=>1, 'enabled'=>1, 'position'=>90, 'csslist'=>'right');
  137. $arrayfields = dol_sort_array($arrayfields, 'position');
  138. // There is several ways to check permission.
  139. // Set $enablepermissioncheck to 1 to enable a minimum low level of checks
  140. $enablepermissioncheck = 0;
  141. if ($enablepermissioncheck) {
  142. $permissiontoread = $user->hasRight('rollerstorage', 'rollerhistory', 'read');
  143. $permissiontoadd = $user->hasRight('rollerstorage', 'rollerhistory', 'write');
  144. $permissiontodelete = $user->hasRight('rollerstorage', 'rollerhistory', 'delete');
  145. } else {
  146. $permissiontoread = 1;
  147. $permissiontoadd = 1;
  148. $permissiontodelete = 1;
  149. }
  150. // Security check (enable the most restrictive one)
  151. if ($user->socid > 0)
  152. accessforbidden();
  153. //if ($user->socid > 0) accessforbidden();
  154. //$socid = 0; if ($user->socid > 0) $socid = $user->socid;
  155. //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
  156. //restrictedArea($user, $object->module, 0, $object->table_element, $object->element, 'fk_soc', 'rowid', $isdraft);
  157. if (!isModEnabled("rollerstorage")) {
  158. accessforbidden('Module rollerstorage not enabled');
  159. }
  160. if (!$permissiontoread)
  161. accessforbidden();
  162. /*
  163. * Actions
  164. */
  165. if (GETPOST('cancel', 'alpha')) {
  166. $action = 'list';
  167. $massaction = '';
  168. }
  169. if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
  170. $massaction = '';
  171. }
  172. $parameters = array();
  173. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  174. if ($reshook < 0) {
  175. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  176. }
  177. if (empty($reshook)) {
  178. // Selection of new fields
  179. include DOL_DOCUMENT_ROOT . '/core/actions_changeselectedfields.inc.php';
  180. // Purge search criteria
  181. 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
  182. foreach ($object->fields as $key => $val) {
  183. $search[$key] = '';
  184. if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  185. $search[$key . '_dtstart'] = '';
  186. $search[$key . '_dtend'] = '';
  187. }
  188. //$search['id'] = $object->id;
  189. }
  190. $toselect = array();
  191. $search_array_options = array();
  192. }
  193. if (
  194. GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
  195. || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')
  196. ) {
  197. $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
  198. }
  199. // Mass actions
  200. $objectclass = 'RollerHistory';
  201. $objectlabel = 'RollerHistory';
  202. $uploaddir = $conf->rollerstorage->dir_output;
  203. include DOL_DOCUMENT_ROOT . '/core/actions_massactions.inc.php';
  204. // You can add more action here
  205. // if ($action == 'xxx' && $permissiontoxxx) ...
  206. }
  207. /*
  208. * View
  209. */
  210. $form = new Form($db);
  211. $now = dol_now();
  212. //$help_url = "EN:Module_RollerHistory|FR:Module_RollerHistory_FR|ES:Módulo_RollerHistory";
  213. $help_url = '';
  214. $title = $langs->trans("RollerHistorys");
  215. $morejs = array();
  216. $morecss = array();
  217. // Build and execute select
  218. // --------------------------------------------------------------------
  219. $sql = 'SELECT u.login, u.lastname, u.firstname, ent1.ref as wh_from_ref, ent1.lieu as wh_from_lieu, ent1.address as wh_from_address, ent2.ref as wh_to_ref, ent2.lieu as wh_to_lieu, ent2.address as wh_to_address, ';
  220. $sql .= $object->getFieldList('t');
  221. // Add fields from extrafields
  222. if (!empty($extrafields->attributes[$object->table_element]['label'])) {
  223. foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
  224. $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef." . $key . " as options_" . $key : '');
  225. }
  226. }
  227. // Add fields from hooks
  228. $parameters = array();
  229. $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
  230. $sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
  231. $sql = preg_replace('/,\s*$/', '', $sql);
  232. //$sql .= ", COUNT(rc.rowid) as anotherfield";
  233. $sqlfields = $sql; // $sql fields to remove for count total
  234. $sql .= " FROM " . MAIN_DB_PREFIX . $object->table_element . " as t";
  235. //$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."anothertable as rc ON rc.parent = t.rowid";
  236. if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
  237. $sql .= " LEFT JOIN " . MAIN_DB_PREFIX . $object->table_element . "_extrafields as ef on (t.rowid = ef.fk_object)";
  238. }
  239. $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "entrepot AS ent1 ON t.warehouse_from = ent1.rowid ";
  240. $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "entrepot AS ent2 ON t.warehouse_to = ent2.rowid ";
  241. $sql .= " INNER JOIN " . MAIN_DB_PREFIX . "user AS u ON t.fk_user_creat = u.rowid ";
  242. // Add table from hooks
  243. $parameters = array();
  244. $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
  245. $sql .= $hookmanager->resPrint;
  246. if ($object->ismultientitymanaged == 1) {
  247. $sql .= " WHERE t.entity IN (" . getEntity($object->element) . ") AND fk_inventory = " . $id;
  248. } else {
  249. $sql .= " WHERE fk_inventory = " . $id;
  250. }
  251. foreach ($search as $key => $val) {
  252. if (array_key_exists($key, $object->fields)) {
  253. if ($key == 'status' && $search[$key] == -1) {
  254. continue;
  255. }
  256. $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
  257. if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
  258. if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
  259. $search[$key] = '';
  260. }
  261. $mode_search = 2;
  262. }
  263. if ($search[$key] != '') {
  264. $sql .= natural_search("t." . $db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
  265. }
  266. } else {
  267. if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
  268. $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
  269. if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
  270. if (preg_match('/_dtstart$/', $key)) {
  271. $sql .= " AND t." . $db->escape($columnName) . " >= '" . $db->idate($search[$key]) . "'";
  272. }
  273. if (preg_match('/_dtend$/', $key)) {
  274. $sql .= " AND t." . $db->escape($columnName) . " <= '" . $db->idate($search[$key]) . "'";
  275. }
  276. }
  277. }
  278. }
  279. }
  280. if ($search_all) {
  281. $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
  282. }
  283. //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
  284. // Add where from extra fields
  285. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_sql.tpl.php';
  286. // Add where from hooks
  287. $parameters = array();
  288. $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
  289. $sql .= $hookmanager->resPrint;
  290. /* If a group by is required
  291. $sql .= " GROUP BY ";
  292. foreach($object->fields as $key => $val) {
  293. $sql .= "t.".$db->escape($key).", ";
  294. }
  295. // Add fields from extrafields
  296. if (!empty($extrafields->attributes[$object->table_element]['label'])) {
  297. foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
  298. $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
  299. }
  300. }
  301. // Add where from hooks
  302. $parameters = array();
  303. $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
  304. $sql .= $hookmanager->resPrint;
  305. $sql = preg_replace('/,\s*$/', '', $sql);
  306. */
  307. // Add HAVING from hooks
  308. /*
  309. $parameters = array();
  310. $reshook = $hookmanager->executeHooks('printFieldListHaving', $parameters, $object); // Note that $action and $object may have been modified by hook
  311. $sql .= empty($hookmanager->resPrint) ? "" : " HAVING 1=1 ".$hookmanager->resPrint;
  312. */
  313. // Count total nb of records
  314. $nbtotalofrecords = '';
  315. if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
  316. /* The fast and low memory method to get and count full list converts the sql into a sql count */
  317. $sqlforcount = preg_replace('/^' . preg_quote($sqlfields, '/') . '/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
  318. $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
  319. $resql = $db->query($sqlforcount);
  320. if ($resql) {
  321. $objforcount = $db->fetch_object($resql);
  322. $nbtotalofrecords = $objforcount->nbtotalofrecords;
  323. } else {
  324. dol_print_error($db);
  325. }
  326. if (($page * $limit) > $nbtotalofrecords) { // if total resultset is smaller then paging size (filtering), goto and load page 0
  327. $page = 0;
  328. $offset = 0;
  329. }
  330. $db->free($resql);
  331. }
  332. // Complete request and execute it with limit
  333. $sql .= $db->order($sortfield, $sortorder);
  334. if ($limit) {
  335. $sql .= $db->plimit($limit + 1, $offset);
  336. }
  337. /* //print $sql;
  338. $sql = 'SELECT rh.date_creation, usr.lastname, usr.firstname, ent1.ref as wh_from, ent2.ref as wh_to, stat1.label, stat2.label
  339. FROM llx_rollerstorage_rollerhistory as rh
  340. INNER JOIN llx_entrepot as ent1 ON rh.warehouse_from = ent1.rowid
  341. INNER JOIN llx_entrepot as ent2 ON rh.warehouse_to = ent2.rowid
  342. INNER JOIN llx_rollerstorage_statuses as stat1 ON rh.status_from = stat1.ref
  343. INNER JOIN llx_rollerstorage_statuses as stat2 ON rh.status_to = stat2.ref
  344. INNER JOIN llx_user as usr ON usr.rowid = rh.fk_user_creat
  345. WHERE rh.fk_inventory = '.$id;
  346. //print $id; */
  347. $resql = $db->query($sql);
  348. if (!$resql) {
  349. dol_print_error($db);
  350. exit;
  351. }
  352. $num = $db->num_rows($resql);
  353. // Example : Adding jquery code
  354. // print '<script type="text/javascript">
  355. // jQuery(document).ready(function() {
  356. // function init_myfunc()
  357. // {
  358. // jQuery("#myid").removeAttr(\'disabled\');
  359. // jQuery("#myid").attr(\'disabled\',\'disabled\');
  360. // }
  361. // init_myfunc();
  362. // jQuery("#mybutton").click(function() {
  363. // init_myfunc();
  364. // });
  365. // });
  366. // </script>';
  367. $arrayofselected = is_array($toselect) ? $toselect : array();
  368. $param = '';
  369. if (!empty($mode)) {
  370. $param .= '&mode=' . urlencode($mode);
  371. }
  372. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  373. $param .= '&contextpage=' . urlencode($contextpage);
  374. }
  375. if ($limit > 0 && $limit != $conf->liste_limit) {
  376. $param .= '&limit=' . urlencode($limit);
  377. }
  378. if (!empty($id)) {
  379. $param .= '&id=' . $id;
  380. }
  381. foreach ($search as $key => $val) {
  382. if (is_array($search[$key])) {
  383. foreach ($search[$key] as $skey) {
  384. if ($skey != '') {
  385. $param .= '&search_' . $key . '[]=' . urlencode($skey);
  386. }
  387. }
  388. } elseif (preg_match('/(_dtstart|_dtend)$/', $key) && !empty($val)) {
  389. $param .= '&search_' . $key . 'month=' . ((int) GETPOST('search_' . $key . 'month', 'int'));
  390. $param .= '&search_' . $key . 'day=' . ((int) GETPOST('search_' . $key . 'day', 'int'));
  391. $param .= '&search_' . $key . 'year=' . ((int) GETPOST('search_' . $key . 'year', 'int'));
  392. } elseif ($search[$key] != '') {
  393. $param .= '&search_' . $key . '=' . urlencode($search[$key]);
  394. }
  395. }
  396. if ($optioncss != '') {
  397. $param .= '&optioncss=' . urlencode($optioncss);
  398. }
  399. // Add $param from extra fields
  400. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_param.tpl.php';
  401. // Add $param from hooks
  402. $parameters = array();
  403. $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
  404. $param .= $hookmanager->resPrint;
  405. // List of mass actions available
  406. $arrayofmassactions = array(
  407. //'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
  408. //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
  409. //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
  410. //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
  411. );
  412. if (!empty($permissiontodelete)) {
  413. $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"') . $langs->trans("Delete");
  414. }
  415. if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
  416. $arrayofmassactions = array();
  417. }
  418. $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
  419. print '<form method="POST" id="searchFormList" action="' . $_SERVER["PHP_SELF"] . '?inventory_id=' . $inventory_id . '&backtopage=/custom/rollerstorage/rollerstorageinventoryindex.php?inventory_id=' . $inventory_id . '">' . "\n";
  420. if ($optioncss != '') {
  421. print '<input type="hidden" name="optioncss" value="' . $optioncss . '">';
  422. }
  423. print '<input type="hidden" name="token" value="' . newToken() . '">';
  424. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  425. print '<input type="hidden" name="action" value="list">';
  426. print '<input type="hidden" name="sortfield" value="' . $sortfield . '">';
  427. print '<input type="hidden" name="sortorder" value="' . $sortorder . '">';
  428. print '<input type="hidden" name="page" value="' . $page . '">';
  429. print '<input type="hidden" name="contextpage" value="' . $contextpage . '">';
  430. print '<input type="hidden" name="page_y" value="">';
  431. print '<input type="hidden" name="mode" value="' . $mode . '">';
  432. print '<input type="hidden" name="id" value="' . $id . '">';
  433. print '<input type="hidden" name="inventory_id" value="' . $inventory_id . '">';
  434. $newcardbutton = '';
  435. //$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'));
  436. //$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'));
  437. //$newcardbutton .= dolGetButtonTitleSeparator();
  438. //$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/rollerstorage/rollerhistory_card.php', 1).'?action=create&backtopage='.urlencode($_SERVER['PHP_SELF']), '', $permissiontoadd);
  439. //print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
  440. // Add code for pre mass action (confirmation or email presend form)
  441. $topicmail = "SendRollerHistoryRef";
  442. $modelmail = "rollerhistory";
  443. $objecttmp = new RollerHistory($db);
  444. $trackid = 'xxxx' . $object->id;
  445. include DOL_DOCUMENT_ROOT . '/core/tpl/massactions_pre.tpl.php';
  446. if ($search_all) {
  447. $setupstring = '';
  448. foreach ($fieldstosearchall as $key => $val) {
  449. $fieldstosearchall[$key] = $langs->trans($val);
  450. $setupstring .= $key . "=" . $val . ";";
  451. }
  452. print '<!-- Search done like if PRODUCT_QUICKSEARCH_ON_FIELDS = ' . $setupstring . ' -->' . "\n";
  453. print '<div class="divsearchfieldfilter">' . $langs->trans("FilterOnInto", $search_all) . join(', ', $fieldstosearchall) . '</div>' . "\n";
  454. }
  455. $moreforfilter = '';
  456. /*$moreforfilter.='<div class="divsearchfield">';
  457. $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
  458. $moreforfilter.= '</div>';*/
  459. $parameters = array();
  460. $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
  461. if (empty($reshook)) {
  462. $moreforfilter .= $hookmanager->resPrint;
  463. } else {
  464. $moreforfilter = $hookmanager->resPrint;
  465. }
  466. if (!empty($moreforfilter)) {
  467. print '<div class="liste_titre liste_titre_bydiv centpercent">';
  468. print $moreforfilter;
  469. print '</div>';
  470. }
  471. $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
  472. $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
  473. $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
  474. print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  475. print '<table class="tagtable nobottomiftotal liste' . ($moreforfilter ? " listwithfilterbefore" : "") . '">' . "\n";
  476. // Fields title search
  477. // --------------------------------------------------------------------
  478. print '<tr class="liste_titre">';
  479. // Action column
  480. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  481. print '<td class="liste_titre maxwidthsearch">';
  482. $searchpicto = $form->showFilterButtons('left');
  483. print $searchpicto;
  484. print '</td>';
  485. }
  486. foreach ($object->fields as $key => $val) {
  487. $searchkey = empty($search[$key]) ? '' : $search[$key];
  488. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  489. if ($key == 'status') {
  490. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  491. } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  492. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  493. } elseif (in_array($val['type'], array('timestamp'))) {
  494. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  495. } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
  496. $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
  497. }
  498. if (!empty($arrayfields['t.' . $key]['checked'])) {
  499. print '<td class="liste_titre' . ($cssforfield ? ' ' . $cssforfield : '') . '">';
  500. if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
  501. print $form->selectarray('search_' . $key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100' . ($key == 'status' ? ' search_status onrightofpage' : ''), 1);
  502. } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
  503. print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield . ' maxwidth250', 1);
  504. } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  505. print '<div class="nowrap">';
  506. print $form->selectDate($search[$key . '_dtstart'] ? $search[$key . '_dtstart'] : '', "search_" . $key . "_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
  507. print '</div>';
  508. print '<div class="nowrap">';
  509. print $form->selectDate($search[$key . '_dtend'] ? $search[$key . '_dtend'] : '', "search_" . $key . "_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
  510. print '</div>';
  511. } elseif ($key == 'lang') {
  512. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formadmin.class.php';
  513. $formadmin = new FormAdmin($db);
  514. print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2);
  515. } else {
  516. print '<input type="text" class="flat maxwidth75" name="search_' . $key . '" value="' . dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '') . '">';
  517. }
  518. print '</td>';
  519. }
  520. }
  521. // Extra fields
  522. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_input.tpl.php';
  523. // Fields from hook
  524. $parameters = array('arrayfields' => $arrayfields);
  525. $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
  526. print $hookmanager->resPrint;
  527. /*if (!empty($arrayfields['anotherfield']['checked'])) {
  528. print '<td class="liste_titre"></td>';
  529. }*/
  530. // Action column
  531. if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  532. print '<td class="liste_titre maxwidthsearch">';
  533. $searchpicto = $form->showFilterButtons();
  534. print $searchpicto;
  535. print '</td>';
  536. }
  537. print '</tr>' . "\n";
  538. $totalarray = array();
  539. $totalarray['nbfield'] = 0;
  540. // Fields title label
  541. // --------------------------------------------------------------------
  542. print '<tr class="liste_titre">';
  543. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  544. print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ') . "\n";
  545. $totalarray['nbfield']++;
  546. }
  547. // TODO ide kell valahogy belekalapálni az inventory_id-et
  548. $hrefUrl = $_SERVER['PHP_SELF'];
  549. foreach ($object->fields as $key => $val) {
  550. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  551. if ($key == 'status') {
  552. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  553. } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  554. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  555. } elseif (in_array($val['type'], array('timestamp'))) {
  556. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  557. } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $key != 'rowid' && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
  558. $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
  559. }
  560. $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
  561. if (!empty($arrayfields['t.' . $key]['checked'])) {
  562. print getTitleFieldOfList($arrayfields['t.' . $key]['label'], 0, $hrefUrl, 't.' . $key, '', $param, ($cssforfield ? 'class="' . $cssforfield . '"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield . ' ' : '')) . "\n";
  563. $totalarray['nbfield']++;
  564. }
  565. }
  566. // Extra fields
  567. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_search_title.tpl.php';
  568. // Hook fields
  569. $parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
  570. $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
  571. print $hookmanager->resPrint;
  572. // Action column
  573. print '</tr>' . "\n";
  574. $totalarray = array();
  575. $totalarray['nbfield'] = 0;
  576. // Detect if we need a fetch on each output line
  577. $needToFetchEachLine = 0;
  578. if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
  579. foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
  580. if (preg_match('/\$object/', $val)) {
  581. $needToFetchEachLine++; // There is at least one compute field that use $object
  582. }
  583. }
  584. }
  585. // Loop on record
  586. // --------------------------------------------------------------------
  587. $i = 0;
  588. $savnbfield = $totalarray['nbfield'];
  589. $totalarray = array();
  590. $totalarray['nbfield'] = 0;
  591. $imaxinloop = ($limit ? min($num, $limit) : $num);
  592. while ($i < $imaxinloop) {
  593. $obj = $db->fetch_object($resql);
  594. if (empty($obj)) {
  595. break; // Should not happen
  596. }
  597. // Store properties in $object
  598. $object->setVarsFromFetchObj($obj);
  599. if ($mode == 'kanban') {
  600. if ($i == 0) {
  601. print '<tr><td colspan="' . $savnbfield . '">';
  602. print '<div class="box-flex-container">';
  603. }
  604. // Output Kanban
  605. print $object->getKanbanView('');
  606. if ($i == ($imaxinloop - 1)) {
  607. print '</div>';
  608. print '</td></tr>';
  609. }
  610. } else {
  611. // Show here line of result
  612. $j = 0;
  613. print '<tr data-rowid="' . $object->id . '" class="oddeven">';
  614. // Action column
  615. if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
  616. print '<td class="nowrap center">';
  617. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  618. $selected = 0;
  619. if (in_array($object->id, $arrayofselected)) {
  620. $selected = 1;
  621. }
  622. print '<input id="cb' . $object->id . '" class="flat checkforselect" type="checkbox" name="toselect[]" value="' . $object->id . '"' . ($selected ? ' checked="checked"' : '') . '>';
  623. }
  624. print '</td>';
  625. if (!$i) {
  626. $totalarray['nbfield']++;
  627. }
  628. }
  629. foreach ($object->fields as $key => $val) {
  630. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  631. if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  632. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  633. } elseif ($key == 'status') {
  634. $cssforfield .= ($cssforfield ? ' ' : '') . 'center';
  635. }
  636. if (in_array($val['type'], array('timestamp'))) {
  637. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  638. } elseif ($key == 'ref') {
  639. $cssforfield .= ($cssforfield ? ' ' : '') . 'nowrap';
  640. }
  641. if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
  642. $cssforfield .= ($cssforfield ? ' ' : '') . 'right';
  643. }
  644. //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
  645. if (!empty($arrayfields['t.' . $key]['checked'])) {
  646. $typeData = explode(':', $val['type']);
  647. print '<td' . ($cssforfield ? ' class="' . $cssforfield . (preg_match('/tdoverflow/', $cssforfield) ? '' : '') . '"' : '');
  648. if (preg_match('/tdoverflow/', $cssforfield)) {
  649. print ' title="' . dol_escape_htmltag($object->$key) . '"';
  650. }
  651. print '>';
  652. if ($key == 'status') {
  653. print $object->getLibStatut(5);
  654. } elseif ($key == 'rowid') {
  655. print $object->showOutputField($val, $key, $object->id, '');
  656. } elseif ($key == 'status_from' || $key == 'status_to') {
  657. print '<span class="badge badge-status' . array_keys($statusesObj[$object->$key])[0] . ' badge-status" title="' . $statusesObj[$object->$key][array_keys($statusesObj[$object->$key])[0]] . '">' . $statusesObj[$object->$key][array_keys($statusesObj[$object->$key])[0]] . '</span>';
  658. } elseif (isset($typeData[1]) && $typeData[1] == 'Entrepot') {
  659. $address = $key == 'warehouse_from' ? 'wh_from_address' : 'wh_to_address';
  660. $lieu = $key == 'warehouse_from' ? 'wh_from_lieu' : 'wh_to_lieu';
  661. 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>
  662. <b>Ref.:</b> ' . $obj->$address . '<br><b>A hely rövid neve:</b> ' . $obj->$lieu . '" class="classfortooltip">
  663. <span class="fas fa-box-open em080 paddingright classfortooltip" style=" color: #a69944;"></span>
  664. ' . $obj->$lieu . '</div>';
  665. } elseif ($key == 'fk_user_creat') {
  666. print '<span class="fas fa-user infobox-adherent paddingright" style=""></span>' . $obj->login . '(' . $obj->lastname . ' ' . $obj->firstname . ')';
  667. } else {
  668. print $object->showOutputField($val, $key, $object->$key, '');
  669. }
  670. print '</td>';
  671. if (!$i) {
  672. $totalarray['nbfield']++;
  673. }
  674. if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
  675. if (!$i) {
  676. $totalarray['pos'][$totalarray['nbfield']] = 't.' . $key;
  677. }
  678. if (!isset($totalarray['val'])) {
  679. $totalarray['val'] = array();
  680. }
  681. if (!isset($totalarray['val']['t.' . $key])) {
  682. $totalarray['val']['t.' . $key] = 0;
  683. }
  684. $totalarray['val']['t.' . $key] += $object->$key;
  685. }
  686. }
  687. }
  688. // Extra fields
  689. include DOL_DOCUMENT_ROOT . '/core/tpl/extrafields_list_print_fields.tpl.php';
  690. // Fields from hook
  691. $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
  692. $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
  693. print $hookmanager->resPrint;
  694. print '</tr>' . "\n";
  695. }
  696. $i++;
  697. }
  698. // Show total line
  699. include DOL_DOCUMENT_ROOT . '/core/tpl/list_print_total.tpl.php';
  700. // If no record found
  701. if ($num == 0) {
  702. $colspan = 1;
  703. foreach ($arrayfields as $key => $val) {
  704. if (!empty($val['checked'])) {
  705. $colspan++;
  706. }
  707. }
  708. print '<tr><td colspan="' . $colspan . '"><span class="opacitymedium">' . $langs->trans("NoRecordFound") . '</span></td></tr>';
  709. }
  710. $db->free($resql);
  711. $parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
  712. $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  713. print $hookmanager->resPrint;
  714. print '</table>' . "\n";
  715. print '</div>' . "\n";
  716. print '</form>' . "\n";
  717. if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
  718. $hidegeneratedfilelistifempty = 1;
  719. if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
  720. $hidegeneratedfilelistifempty = 0;
  721. }
  722. require_once DOL_DOCUMENT_ROOT . '/core/class/html.formfile.class.php';
  723. $formfile = new FormFile($db);
  724. // Show list of available documents
  725. $urlsource = $_SERVER['PHP_SELF'] . '?sortfield=' . $sortfield . '&sortorder=' . $sortorder;
  726. $urlsource .= str_replace('&amp;', '&', $param);
  727. $filedir = $diroutputmassaction;
  728. $genallowed = $permissiontoread;
  729. $delallowed = $permissiontoadd;
  730. print $formfile->showdocuments('massfilesarea_rollerstorage', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
  731. }
  732. // End of page
  733. llxFooter();
  734. //$db->close();