recruitmentcandidature_list.php 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886
  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 recruitmentcandidature_list.php
  19. * \ingroup recruitment
  20. * \brief List page for recruitmentcandidature
  21. */
  22. // Load Dolibarr environment
  23. require_once '../main.inc.php';
  24. require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment.lib.php';
  25. require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
  26. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
  27. require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
  28. require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
  29. require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
  30. require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
  31. // Load translation files required by the page
  32. $langs->loadLangs(array("recruitment", "other"));
  33. $id = GETPOST('id', 'int');
  34. $ref = GETPOST('ref', 'alpha');
  35. $action = GETPOST('action', 'aZ09') ?GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
  36. $massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
  37. $show_files = GETPOST('show_files', 'int'); // Show files area generated by bulk actions ?
  38. $confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
  39. $cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
  40. $toselect = GETPOST('toselect', 'array'); // Array of ids of elements selected into a list
  41. $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : ((empty($id) && empty($ref)) ? 'recruitmentcandidaturelist' : 'recruitmentjobposition_candidature'); // To manage different context of search
  42. $backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
  43. $optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
  44. $mode = GETPOST('mode', 'aZ');
  45. $lineid = GETPOST('lineid', 'int');
  46. // Load variable for pagination
  47. $limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit;
  48. $sortfield = GETPOST('sortfield', 'aZ09comma');
  49. $sortorder = GETPOST('sortorder', 'aZ09comma');
  50. $page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int');
  51. if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
  52. // If $page is not defined, or '' or -1 or if we click on clear filters
  53. $page = 0;
  54. }
  55. $offset = $limit * $page;
  56. $pageprev = $page - 1;
  57. $pagenext = $page + 1;
  58. // Initialize technical objects
  59. $object = new RecruitmentCandidature($db);
  60. $extrafields = new ExtraFields($db);
  61. $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id;
  62. $hookmanager->initHooks(array('recruitmentcandidaturelist')); // Note that conf->hooks_modules contains array
  63. // Fetch optionals attributes and labels
  64. $extrafields->fetch_name_optionals_label($object->table_element);
  65. //$extrafields->fetch_name_optionals_label($object->table_element_line);
  66. $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
  67. // Default sort order (if not yet defined by previous GETPOST)
  68. if (!$sortfield) {
  69. $sortfield = "t.date_creation"; // Set here default search field. By default 1st field in definition.
  70. }
  71. if (!$sortorder) {
  72. $sortorder = "DESC";
  73. }
  74. // Initialize array of search criterias
  75. $search_all = GETPOST('search_all', 'alphanohtml');
  76. $search = array();
  77. foreach ($object->fields as $key => $val) {
  78. if (GETPOST('search_'.$key, 'alpha') !== '') {
  79. $search[$key] = GETPOST('search_'.$key, 'alpha');
  80. }
  81. if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  82. $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOST('search_'.$key.'_dtstartmonth', 'int'), GETPOST('search_'.$key.'_dtstartday', 'int'), GETPOST('search_'.$key.'_dtstartyear', 'int'));
  83. $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOST('search_'.$key.'_dtendmonth', 'int'), GETPOST('search_'.$key.'_dtendday', 'int'), GETPOST('search_'.$key.'_dtendyear', 'int'));
  84. }
  85. }
  86. // List of fields to search into when doing a "search in all"
  87. $fieldstosearchall = array();
  88. foreach ($object->fields as $key => $val) {
  89. if (!empty($val['searchall'])) {
  90. $fieldstosearchall['t.'.$key] = $val['label'];
  91. }
  92. }
  93. // Definition of array of fields for columns
  94. $arrayfields = array();
  95. foreach ($object->fields as $key => $val) {
  96. // If $val['visible']==0, then we never show the field
  97. if (!empty($val['visible'])) {
  98. $visible = (int) dol_eval($val['visible'], 1);
  99. $arrayfields['t.'.$key] = array(
  100. 'label'=>$val['label'],
  101. 'checked'=>(($visible < 0) ? 0 : 1),
  102. 'enabled'=>(abs($visible) != 3 && dol_eval($val['enabled'], 1)),
  103. 'position'=>$val['position'],
  104. 'help'=> isset($val['help']) ? $val['help'] : ''
  105. );
  106. }
  107. }
  108. // Extra fields
  109. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
  110. // Load object
  111. $jobposition = new RecruitmentJobPosition($db);
  112. if ($id > 0 || !empty($ref)) {
  113. $jobposition->fetch($id, $ref);
  114. $id = $jobposition->id;
  115. }
  116. $object->fields = dol_sort_array($object->fields, 'position');
  117. $arrayfields = dol_sort_array($arrayfields, 'position');
  118. $permissiontoread = $user->rights->recruitment->recruitmentjobposition->read;
  119. $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write;
  120. $permissiontodelete = $user->rights->recruitment->recruitmentjobposition->delete;
  121. // Security check - Protection if external user
  122. //if ($user->socid > 0) accessforbidden();
  123. //if ($user->socid > 0) $socid = $user->socid;
  124. //$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
  125. if ($jobposition->id > 0) {
  126. $isdraft = (($jobposition->status == $jobposition::STATUS_DRAFT) ? 1 : 0);
  127. $result = restrictedArea($user, 'recruitment', $jobposition->id, 'recruitment_recruitmentjobposition', 'recruitmentjobposition', '', 'rowid', $isdraft);
  128. } else {
  129. $result = restrictedArea($user, 'recruitment', 0, 'recruitment_recruitmentcandidature', 'recruitmentjobposition');
  130. }
  131. /*
  132. * Actions
  133. */
  134. if (GETPOST('cancel', 'alpha')) {
  135. $action = 'list';
  136. $massaction = '';
  137. }
  138. if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
  139. $massaction = '';
  140. }
  141. $parameters = array();
  142. $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
  143. if ($reshook < 0) {
  144. setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
  145. }
  146. if (empty($reshook)) {
  147. // Selection of new fields
  148. include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
  149. // Purge search criteria
  150. 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
  151. foreach ($object->fields as $key => $val) {
  152. $search[$key] = '';
  153. if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  154. $search[$key.'_dtstart'] = '';
  155. $search[$key.'_dtend'] = '';
  156. }
  157. }
  158. $toselect = array();
  159. $search_array_options = array();
  160. }
  161. if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
  162. || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
  163. $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
  164. }
  165. // Mass actions
  166. $objectclass = 'RecruitmentCandidature';
  167. $objectlabel = 'RecruitmentCandidature';
  168. $uploaddir = $conf->recruitment->dir_output;
  169. include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
  170. }
  171. /*
  172. * View
  173. */
  174. $form = new Form($db);
  175. $now = dol_now();
  176. //$help_url="EN:Module_RecruitmentCandidature|FR:Module_RecruitmentCandidature_FR|ES:Módulo_RecruitmentCandidature";
  177. $help_url = '';
  178. $title = $langs->trans('RecruitmentCandidatures');
  179. $morejs = array();
  180. $morecss = array();
  181. // Build and execute select
  182. // --------------------------------------------------------------------
  183. $sql = 'SELECT ';
  184. $sql .= $object->getFieldList('t');
  185. // Add fields from extrafields
  186. if (!empty($extrafields->attributes[$object->table_element]['label'])) {
  187. foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
  188. $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
  189. }
  190. }
  191. // Add fields from hooks
  192. $parameters = array();
  193. $reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
  194. $sql .= preg_replace('/^,/', '', $hookmanager->resPrint);
  195. $sql = preg_replace('/,\s*$/', '', $sql);
  196. $sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
  197. if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
  198. $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
  199. }
  200. // Add table from hooks
  201. $parameters = array();
  202. $reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
  203. $sql .= $hookmanager->resPrint;
  204. if ($object->ismultientitymanaged == 1) {
  205. $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
  206. } else {
  207. $sql .= " WHERE 1 = 1";
  208. }
  209. foreach ($search as $key => $val) {
  210. if (array_key_exists($key, $object->fields)) {
  211. if ($key == 'status' && $search[$key] == -1) {
  212. continue;
  213. }
  214. $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
  215. if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
  216. if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
  217. $search[$key] = '';
  218. }
  219. $mode_search = 2;
  220. }
  221. if ($search[$key] != '') {
  222. $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
  223. }
  224. } else {
  225. if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
  226. $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
  227. if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
  228. if (preg_match('/_dtstart$/', $key)) {
  229. $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
  230. }
  231. if (preg_match('/_dtend$/', $key)) {
  232. $sql .= " AND t.".$db->escape($columnName)." <= '" . $db->idate($search[$key])."'";
  233. }
  234. }
  235. }
  236. }
  237. }
  238. if ($search_all) {
  239. $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
  240. }
  241. if (!empty($id)) {
  242. $sql .= " AND t.fk_recruitmentjobposition = ".((int) $id);
  243. }
  244. //$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
  245. // Add where from extra fields
  246. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
  247. // Add where from hooks
  248. $parameters = array();
  249. $reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object); // Note that $action and $object may have been modified by hook
  250. $sql .= $hookmanager->resPrint;
  251. /* If a group by is required
  252. $sql.= " GROUP BY ";
  253. foreach ($object->fields as $key => $val) {
  254. $sql .= "t.".$db->escape($key).", ";
  255. }
  256. // Add fields from extrafields
  257. if (!empty($extrafields->attributes[$object->table_element]['label'])) {
  258. foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
  259. $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
  260. }
  261. }
  262. // Add where from hooks
  263. $parameters=array();
  264. $reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
  265. $sql .= $hookmanager->resPrint;
  266. $sql = preg_replace('/,\s*$/', '', $sql);
  267. */
  268. // Count total nb of records
  269. $nbtotalofrecords = '';
  270. if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST)) {
  271. /* The fast and low memory method to get and count full list converts the sql into a sql count */
  272. $sqlforcount = preg_replace('/^SELECT[a-zA-Z0-9\._\s\(\),=<>\:\-\']+\sFROM/Ui', 'SELECT COUNT(*) as nbtotalofrecords FROM', $sql);
  273. $resql = $db->query($sqlforcount);
  274. if ($resql) {
  275. $objforcount = $db->fetch_object($resql);
  276. $nbtotalofrecords = $objforcount->nbtotalofrecords;
  277. } else {
  278. dol_print_error($db);
  279. }
  280. if (($page * $limit) > $nbtotalofrecords) { // if total of record found is smaller than page * limit, goto and load page 0
  281. $page = 0;
  282. $offset = 0;
  283. }
  284. $db->free($resql);
  285. }
  286. // Complete request and execute it with limit
  287. $sql .= $db->order($sortfield, $sortorder);
  288. if ($limit) {
  289. $sql .= $db->plimit($limit + 1, $offset);
  290. }
  291. $resql = $db->query($sql);
  292. if (!$resql) {
  293. dol_print_error($db);
  294. exit;
  295. }
  296. $num = $db->num_rows($resql);
  297. // Direct jump if only one record found
  298. if ($num == 1 && !empty($conf->global->MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE) && $search_all && !$page) {
  299. $obj = $db->fetch_object($resql);
  300. $id = $obj->rowid;
  301. header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.$id);
  302. exit;
  303. }
  304. // Output page
  305. // --------------------------------------------------------------------
  306. llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
  307. // Part to show record
  308. if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
  309. $savobject = $object;
  310. $object = $jobposition;
  311. $res = $object->fetch_optionals();
  312. $head = recruitmentjobpositionPrepareHead($object);
  313. print dol_get_fiche_head($head, 'candidatures', $langs->trans("RecruitmentCandidatures"), -1, $object->picto);
  314. $formconfirm = '';
  315. // Confirmation to delete
  316. if ($action == 'delete') {
  317. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRecruitmentJobPosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
  318. }
  319. // Confirmation to delete line
  320. if ($action == 'deleteline') {
  321. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
  322. }
  323. // Clone confirmation
  324. if ($action == 'clone') {
  325. // Create an array for form
  326. $formquestion = array();
  327. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
  328. }
  329. // Confirmation of action xxxx
  330. if ($action == 'xxx') {
  331. $formquestion = array();
  332. /*
  333. $forcecombo=0;
  334. if ($conf->browser->name == 'ie') $forcecombo = 1; // There is a bug in IE10 that make combo inside popup crazy
  335. $formquestion = array(
  336. // 'text' => $langs->trans("ConfirmClone"),
  337. // array('type' => 'checkbox', 'name' => 'clone_content', 'label' => $langs->trans("CloneMainAttributes"), 'value' => 1),
  338. // array('type' => 'checkbox', 'name' => 'update_prices', 'label' => $langs->trans("PuttingPricesUpToDate"), 'value' => 1),
  339. // array('type' => 'other', 'name' => 'idwarehouse', 'label' => $langs->trans("SelectWarehouseForStockDecrease"), 'value' => $formproduct->selectWarehouses(GETPOST('idwarehouse')?GETPOST('idwarehouse'):'ifone', 'idwarehouse', '', 1, 0, 0, '', 0, $forcecombo))
  340. );
  341. */
  342. $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('XXX'), $text, 'confirm_xxx', $formquestion, 0, 1, 220);
  343. }
  344. // Call Hook formConfirm
  345. $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
  346. $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  347. if (empty($reshook)) {
  348. $formconfirm .= $hookmanager->resPrint;
  349. } elseif ($reshook > 0) {
  350. $formconfirm = $hookmanager->resPrint;
  351. }
  352. // Print form confirm
  353. print $formconfirm;
  354. // Object card
  355. // ------------------------------------------------------------
  356. $linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
  357. $morehtmlref = '<div class="refidno">';
  358. /*
  359. // Ref customer
  360. $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
  361. $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
  362. // Thirdparty
  363. $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
  364. */
  365. // Project
  366. if (!empty($conf->project->enabled)) {
  367. $langs->load("projects");
  368. $morehtmlref .= $langs->trans('Project').' ';
  369. if ($permissiontoadd) {
  370. if ($action != 'classify') {
  371. $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a>';
  372. }
  373. $morehtmlref .= ' : ';
  374. if ($action == 'classify') {
  375. //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
  376. $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
  377. $morehtmlref .= '<input type="hidden" name="action" value="classin">';
  378. $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
  379. $morehtmlref .= $formproject->select_projects(0, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
  380. $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
  381. $morehtmlref .= '</form>';
  382. } else {
  383. $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, !empty($object->socid) ? $object->socid : 0, $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
  384. }
  385. } else {
  386. if (!empty($object->fk_project)) {
  387. $proj = new Project($db);
  388. $proj->fetch($object->fk_project);
  389. $morehtmlref .= ': '.$proj->getNomUrl();
  390. } else {
  391. $morehtmlref .= '';
  392. }
  393. }
  394. }
  395. $morehtmlref .= '</div>';
  396. dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
  397. print '<div class="fichecenter">';
  398. print '<div class="fichehalfleft">';
  399. print '<div class="underbanner clearboth"></div>';
  400. print '<table class="border centpercent tableforfield">'."\n";
  401. // Common attributes
  402. $keyforbreak = 'description'; // We change column just after this field
  403. unset($object->fields['fk_project']); // Hide field already shown in banner
  404. //unset($object->fields['fk_soc']); // Hide field already shown in banner
  405. include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
  406. // Other attributes. Fields from hook formObjectOptions and Extrafields.
  407. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
  408. print '</table>';
  409. print '</div>';
  410. print '</div>';
  411. print '<div class="clearboth"></div>';
  412. print dol_get_fiche_end();
  413. print '<br>';
  414. $object = $savobject;
  415. }
  416. $arrayofselected = is_array($toselect) ? $toselect : array();
  417. $param = '';
  418. if (!empty($id)) {
  419. $param .= '&id='.urlencode($id);
  420. }
  421. if (!empty($mode)) {
  422. $param .= '&mode='.urlencode($mode);
  423. }
  424. if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
  425. $param .= '&contextpage='.urlencode($contextpage);
  426. }
  427. if ($limit > 0 && $limit != $conf->liste_limit) {
  428. $param .= '&limit='.urlencode($limit);
  429. }
  430. foreach ($search as $key => $val) {
  431. if (is_array($search[$key]) && count($search[$key])) {
  432. foreach ($search[$key] as $skey) {
  433. if ($skey != '') {
  434. $param .= '&search_'.$key.'[]='.urlencode($skey);
  435. }
  436. }
  437. } elseif ($search[$key] != '') {
  438. $param .= '&search_'.$key.'='.urlencode($search[$key]);
  439. }
  440. }
  441. if ($optioncss != '') {
  442. $param .= '&optioncss='.urlencode($optioncss);
  443. }
  444. // Add $param from extra fields
  445. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
  446. // Add $param from hooks
  447. $parameters = array();
  448. $reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
  449. $param .= $hookmanager->resPrint;
  450. // List of mass actions available
  451. $arrayofmassactions = array(
  452. 'validate'=>img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
  453. //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
  454. //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
  455. //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
  456. );
  457. if (!empty($permissiontodelete)) {
  458. $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
  459. }
  460. if (GETPOST('nomassaction', 'int') || in_array($massaction, array('presend', 'predelete'))) {
  461. $arrayofmassactions = array();
  462. }
  463. $massactionbutton = $form->selectMassAction('', $arrayofmassactions);
  464. print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
  465. if ($optioncss != '') {
  466. print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
  467. }
  468. print '<input type="hidden" name="token" value="'.newToken().'">';
  469. print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
  470. print '<input type="hidden" name="action" value="list">';
  471. print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
  472. print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
  473. print '<input type="hidden" name="page" value="'.$page.'">';
  474. print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
  475. print '<input type="hidden" name="mode" value="'.$mode.'">';
  476. print '<input type="hidden" name="id" value="'.$id.'">';
  477. $newcardbutton = '';
  478. $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'));
  479. $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'));
  480. $newcardbutton .= dolGetButtonTitleSeparator();
  481. $newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?action=create&fk_recruitmentjobposition='.$id, '', $permissiontoadd);
  482. print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
  483. // Add code for pre mass action (confirmation or email presend form)
  484. $topicmail = "SendRecruitmentCandidatureRef";
  485. $modelmail = "recruitmentcandidature";
  486. $objecttmp = new RecruitmentCandidature($db);
  487. $trackid = 'recruitmentapplication'.$object->id;
  488. include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
  489. if ($search_all) {
  490. $setupstring = '';
  491. foreach ($fieldstosearchall as $key => $val) {
  492. $fieldstosearchall[$key] = $langs->trans($val);
  493. $setupstring .= $key."=".$val.";";
  494. }
  495. print '<!-- Search done like if PRODUCT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
  496. print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).join(', ', $fieldstosearchall).'</div>'."\n";
  497. }
  498. $moreforfilter = '';
  499. /*$moreforfilter.='<div class="divsearchfield">';
  500. $moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
  501. $moreforfilter.= '</div>';*/
  502. $parameters = array();
  503. $reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
  504. if (empty($reshook)) {
  505. $moreforfilter .= $hookmanager->resPrint;
  506. } else {
  507. $moreforfilter = $hookmanager->resPrint;
  508. }
  509. if (!empty($moreforfilter)) {
  510. print '<div class="liste_titre liste_titre_bydiv centpercent">';
  511. print $moreforfilter;
  512. print '</div>';
  513. }
  514. $varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
  515. $selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN', '')); // This also change content of $arrayfields
  516. $selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
  517. print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you dont need reserved height for your table
  518. print '<table class="tagtable nobottomiftotal liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
  519. // Fields title search
  520. // --------------------------------------------------------------------
  521. print '<tr class="liste_titre">';
  522. // Action column
  523. if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
  524. print '<td class="liste_titre maxwidthsearch">';
  525. $searchpicto = $form->showFilterButtons('left');
  526. print $searchpicto;
  527. print '</td>';
  528. }
  529. foreach ($object->fields as $key => $val) {
  530. $searchkey = empty($search[$key]) ? '' : $search[$key];
  531. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  532. if ($key == 'status') {
  533. $cssforfield .= ($cssforfield ? ' ' : '').'center';
  534. } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  535. $cssforfield .= ($cssforfield ? ' ' : '').'center';
  536. } elseif (in_array($val['type'], array('timestamp'))) {
  537. $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
  538. } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
  539. $cssforfield .= ($cssforfield ? ' ' : '').'right';
  540. }
  541. if (!empty($arrayfields['t.'.$key]['checked'])) {
  542. print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').'">';
  543. if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
  544. print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100', 1);
  545. } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
  546. print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
  547. } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
  548. print '<div class="nowrap">';
  549. print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
  550. print '</div>';
  551. print '<div class="nowrap">';
  552. print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
  553. print '</div>';
  554. } elseif ($key == 'lang') {
  555. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
  556. $formadmin = new FormAdmin($db);
  557. print $formadmin->select_language($search[$key], 'search_lang', 0, null, 1, 0, 0, 'minwidth150 maxwidth200', 2);
  558. } else {
  559. print '<input type="text" class="flat maxwidth75" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
  560. }
  561. print '</td>';
  562. }
  563. }
  564. // Extra fields
  565. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
  566. // Fields from hook
  567. $parameters = array('arrayfields'=>$arrayfields);
  568. $reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object); // Note that $action and $object may have been modified by hook
  569. print $hookmanager->resPrint;
  570. // Action column
  571. if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
  572. print '<td class="liste_titre maxwidthsearch">';
  573. $searchpicto = $form->showFilterButtons();
  574. print $searchpicto;
  575. print '</td>';
  576. }
  577. print '</tr>'."\n";
  578. $totalarray = array();
  579. $totalarray['nbfield'] = 0;
  580. // Fields title label
  581. // --------------------------------------------------------------------
  582. print '<tr class="liste_titre">';
  583. if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
  584. print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
  585. }
  586. foreach ($object->fields as $key => $val) {
  587. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  588. if ($key == 'status') {
  589. $cssforfield .= ($cssforfield ? ' ' : '').'center';
  590. } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  591. $cssforfield .= ($cssforfield ? ' ' : '').'center';
  592. } elseif (in_array($val['type'], array('timestamp'))) {
  593. $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
  594. } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
  595. $cssforfield .= ($cssforfield ? ' ' : '').'right';
  596. }
  597. $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
  598. if (!empty($arrayfields['t.'.$key]['checked'])) {
  599. print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''))."\n";
  600. $totalarray['nbfield']++;
  601. }
  602. }
  603. // Extra fields
  604. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
  605. // Hook fields
  606. $parameters = array('arrayfields'=>$arrayfields, 'param'=>$param, 'sortfield'=>$sortfield, 'sortorder'=>$sortorder, 'totalarray'=>&$totalarray);
  607. $reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object); // Note that $action and $object may have been modified by hook
  608. print $hookmanager->resPrint;
  609. // Action column
  610. if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
  611. print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
  612. }
  613. $totalarray['nbfield']++;
  614. print '</tr>'."\n";
  615. // Detect if we need a fetch on each output line
  616. $needToFetchEachLine = 0;
  617. if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
  618. foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
  619. if (preg_match('/\$object/', $val)) {
  620. $needToFetchEachLine++; // There is at least one compute field that use $object
  621. }
  622. }
  623. }
  624. // Loop on record
  625. // --------------------------------------------------------------------
  626. $i = 0;
  627. $savnbfield = $totalarray['nbfield'];
  628. $totalarray = array();
  629. $totalarray['nbfield'] = 0;
  630. $imaxinloop = ($limit ? min($num, $limit) : $num);
  631. while ($i < $imaxinloop) {
  632. $obj = $db->fetch_object($resql);
  633. if (empty($obj)) {
  634. break; // Should not happen
  635. }
  636. // Store properties in $object
  637. $object->setVarsFromFetchObj($obj);
  638. if ($mode == 'kanban') {
  639. if ($i == 0) {
  640. print '<tr><td colspan="'.$savnbfield.'">';
  641. print '<div class="box-flex-container">';
  642. }
  643. // Output Kanban
  644. print $object->getKanbanView('');
  645. if ($i == ($imaxinloop - 1)) {
  646. print '</div>';
  647. print '</td></tr>';
  648. }
  649. } else {
  650. // Show here line of result
  651. $j = 0;
  652. print '<tr data-rowid="'.$object->id.'" class="oddeven">';
  653. // Action column
  654. if (!empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
  655. print '<td class="nowrap center">';
  656. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  657. $selected = 0;
  658. if (in_array($object->id, $arrayofselected)) {
  659. $selected = 1;
  660. }
  661. print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
  662. }
  663. print '</td>';
  664. }
  665. foreach ($object->fields as $key => $val) {
  666. $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
  667. if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
  668. $cssforfield .= ($cssforfield ? ' ' : '').'center';
  669. } elseif ($key == 'status') {
  670. $cssforfield .= ($cssforfield ? ' ' : '').'center';
  671. }
  672. if (in_array($val['type'], array('timestamp'))) {
  673. $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
  674. } elseif ($key == 'ref') {
  675. $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
  676. }
  677. if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
  678. $cssforfield .= ($cssforfield ? ' ' : '').'right';
  679. }
  680. //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
  681. if (!empty($arrayfields['t.'.$key]['checked'])) {
  682. print '<td'.($cssforfield ? ' class="'.$cssforfield.'"' : '');
  683. if (preg_match('/tdoverflow/', $cssforfield)) {
  684. print ' title="'.dol_escape_htmltag($object->$key).'"';
  685. }
  686. print '>';
  687. if ($key == 'status') {
  688. print $object->getLibStatut(5);
  689. } elseif ($key == 'rowid') {
  690. print $object->showOutputField($val, $key, $object->id, '');
  691. } else {
  692. print $object->showOutputField($val, $key, $object->$key, '');
  693. }
  694. print '</td>';
  695. if (!$i) {
  696. $totalarray['nbfield']++;
  697. }
  698. if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
  699. if (!$i) {
  700. $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
  701. }
  702. if (!isset($totalarray['val'])) {
  703. $totalarray['val'] = array();
  704. }
  705. if (!isset($totalarray['val']['t.'.$key])) {
  706. $totalarray['val']['t.'.$key] = 0;
  707. }
  708. $totalarray['val']['t.'.$key] += $object->$key;
  709. }
  710. }
  711. }
  712. // Extra fields
  713. include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
  714. // Fields from hook
  715. $parameters = array('arrayfields'=>$arrayfields, 'object'=>$object, 'obj'=>$obj, 'i'=>$i, 'totalarray'=>&$totalarray);
  716. $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object); // Note that $action and $object may have been modified by hook
  717. print $hookmanager->resPrint;
  718. // Action column
  719. if (empty($conf->global->MAIN_CHECKBOX_LEFT_COLUMN)) {
  720. print '<td class="nowrap center">';
  721. if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
  722. $selected = 0;
  723. if (in_array($object->id, $arrayofselected)) {
  724. $selected = 1;
  725. }
  726. print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
  727. }
  728. print '</td>';
  729. }
  730. if (!$i) {
  731. $totalarray['nbfield']++;
  732. }
  733. print '</tr>'."\n";
  734. }
  735. $i++;
  736. }
  737. // Show total line
  738. include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
  739. // If no record found
  740. if ($num == 0) {
  741. $colspan = 1;
  742. foreach ($arrayfields as $key => $val) {
  743. if (!empty($val['checked'])) {
  744. $colspan++;
  745. }
  746. }
  747. print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
  748. }
  749. $db->free($resql);
  750. $parameters = array('arrayfields'=>$arrayfields, 'sql'=>$sql);
  751. $reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
  752. print $hookmanager->resPrint;
  753. print '</table>'."\n";
  754. print '</div>'."\n";
  755. print '</form>'."\n";
  756. if (in_array('builddoc', $arrayofmassactions) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
  757. $hidegeneratedfilelistifempty = 1;
  758. if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
  759. $hidegeneratedfilelistifempty = 0;
  760. }
  761. require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
  762. $formfile = new FormFile($db);
  763. // Show list of available documents
  764. $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
  765. $urlsource .= str_replace('&amp;', '&', $param);
  766. $filedir = $diroutputmassaction;
  767. $genallowed = $permissiontoread;
  768. $delallowed = $permissiontoadd;
  769. print $formfile->showdocuments('massfilesarea_recruitment', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
  770. }
  771. // End of page
  772. llxFooter();
  773. $db->close();