dolibarr 23.0.3
recruitmentcandidature_list.php
Go to the documentation of this file.
1<?php
2/* Copyright (C) 2007-2017 Laurent Destailleur <eldy@users.sourceforge.net>
3 * Copyright (C) 2024-2025 Frédéric France <frederic.france@free.fr>
4 * Copyright (C) 2024-2025 MDW <mdeweerd@users.noreply.github.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
26// Load Dolibarr environment
27require_once '../main.inc.php';
28require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment.lib.php';
29require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
30require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
31require_once DOL_DOCUMENT_ROOT.'/core/lib/date.lib.php';
32require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
33require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentcandidature.class.php';
34require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
35
44// Load translation files required by the page
45$langs->loadLangs(array("recruitment", "other"));
46
47$id = GETPOSTINT('id');
48$ref = GETPOST('ref', 'alpha');
49
50$action = GETPOST('action', 'aZ09') ? GETPOST('action', 'aZ09') : 'view'; // The action 'add', 'create', 'edit', 'update', 'view', ...
51$massaction = GETPOST('massaction', 'alpha'); // The bulk action (combo box choice into lists)
52$show_files = GETPOSTINT('show_files'); // Show files area generated by bulk actions ?
53$confirm = GETPOST('confirm', 'alpha'); // Result of a confirmation
54$cancel = GETPOST('cancel', 'alpha'); // We click on a Cancel button
55$toselect = GETPOST('toselect', 'array:int'); // Array of ids of elements selected into a list
56$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : ((empty($id) && empty($ref)) ? 'recruitmentcandidaturelist' : 'recruitmentjobposition_candidature'); // To manage different context of search
57$backtopage = GETPOST('backtopage', 'alpha'); // Go back to a dedicated page
58$optioncss = GETPOST('optioncss', 'aZ'); // Option for the css output (always '' except when 'print')
59$mode = GETPOST('mode', 'aZ');
60$lineid = GETPOSTINT('lineid');
61
62// Load variable for pagination
63$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
64$sortfield = GETPOST('sortfield', 'aZ09comma');
65$sortorder = GETPOST('sortorder', 'aZ09comma');
66$page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTINT("page");
67if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) {
68 // If $page is not defined, or '' or -1 or if we click on clear filters
69 $page = 0;
70}
71$offset = $limit * $page;
72$pageprev = $page - 1;
73$pagenext = $page + 1;
74
75// Initialize a technical objects
77$extrafields = new ExtraFields($db);
78$diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id;
79$hookmanager->initHooks(array($contextpage)); // Note that conf->hooks_modules contains array of activated contexes
80
81// Fetch optionals attributes and labels
82$extrafields->fetch_name_optionals_label($object->table_element);
83//$extrafields->fetch_name_optionals_label($object->table_element_line);
84
85$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
86
87// Default sort order (if not yet defined by previous GETPOST)
88if (!$sortfield) {
89 $sortfield = "t.date_creation"; // Set here default search field. By default 1st field in definition.
90}
91if (!$sortorder) {
92 $sortorder = "DESC";
93}
94
95// Initialize array of search criteria
96$search_all = GETPOST('search_all', 'alphanohtml');
97$search = array();
98foreach ($object->fields as $key => $val) {
99 if (GETPOST('search_'.$key, 'alpha') !== '') {
100 $search[$key] = GETPOST('search_'.$key, 'alpha');
101 }
102 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
103 $search[$key.'_dtstart'] = dol_mktime(0, 0, 0, GETPOSTINT('search_'.$key.'_dtstartmonth'), GETPOSTINT('search_'.$key.'_dtstartday'), GETPOSTINT('search_'.$key.'_dtstartyear'));
104 $search[$key.'_dtend'] = dol_mktime(23, 59, 59, GETPOSTINT('search_'.$key.'_dtendmonth'), GETPOSTINT('search_'.$key.'_dtendday'), GETPOSTINT('search_'.$key.'_dtendyear'));
105 }
106}
107
108// List of fields to search into when doing a "search in all"
109$fieldstosearchall = array();
110foreach ($object->fields as $key => $val) {
111 if (!empty($val['searchall'])) {
112 $fieldstosearchall['t.'.$key] = $val['label'];
113 }
114}
115/*$parameters = array('fieldstosearchall'=>$fieldstosearchall);
116$reshook = $hookmanager->executeHooks('completeFieldsToSearchAll', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
117if ($reshook > 0) {
118 $fieldstosearchall = $hookmanager->resArray['fieldstosearchall'];
119} elseif ($reshook == 0) {
120 $fieldstosearchall = array_merge($fieldstosearchall, $hookmanager->resArray['fieldstosearchall']);
121}*/
122
123// Definition of array of fields for columns
124$arrayfields = array();
125foreach ($object->fields as $key => $val) {
126 // If $val['visible']==0, then we never show the field
127 if (!empty($val['visible'])) {
128 $visible = (int) dol_eval((string) $val['visible'], 1);
129 $arrayfields['t.'.$key] = array(
130 'label' => $val['label'],
131 'checked' => (($visible < 0) ? 0 : 1),
132 'enabled' => (abs($visible) != 3 && (bool) dol_eval((string) $val['enabled'], 1)),
133 'position' => $val['position'],
134 'help' => isset($val['help']) ? $val['help'] : ''
135 );
136 }
137}
138// Extra fields
139include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_array_fields.tpl.php';
140
141// Load object
142$jobposition = new RecruitmentJobPosition($db);
143if ($id > 0 || !empty($ref)) {
144 $jobposition->fetch($id, $ref);
145 $id = $jobposition->id;
146}
147
148$object->fields = dol_sort_array($object->fields, 'position');
149$arrayfields = dol_sort_array($arrayfields, 'position');
150
151$permissiontoread = $user->hasRight('recruitment', 'recruitmentjobposition', 'read');
152$permissiontoadd = $user->hasRight('recruitment', 'recruitmentjobposition', 'write');
153$permissiontodelete = $user->hasRight('recruitment', 'recruitmentjobposition', 'delete');
154
155// Security check - Protection if external user
156//if ($user->socid > 0) accessforbidden();
157//if ($user->socid > 0) $socid = $user->socid;
158//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
159if ($jobposition->id > 0) {
160 $isdraft = (($jobposition->status == $jobposition::STATUS_DRAFT) ? 1 : 0);
161 $result = restrictedArea($user, 'recruitment', $jobposition->id, 'recruitment_recruitmentjobposition', 'recruitmentjobposition', '', 'rowid', $isdraft);
162} else {
163 $result = restrictedArea($user, 'recruitment', 0, 'recruitment_recruitmentcandidature', 'recruitmentjobposition');
164}
165
166
167
168/*
169 * Actions
170 */
171
172if (GETPOST('cancel', 'alpha')) {
173 $action = 'list';
174 $massaction = '';
175}
176if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
177 $massaction = '';
178}
179
180$parameters = array();
181$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
182if ($reshook < 0) {
183 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
184}
185
186if (empty($reshook)) {
187 // Selection of new fields
188 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
189
190 // Purge search criteria
191 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
192 foreach ($object->fields as $key => $val) {
193 $search[$key] = '';
194 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
195 $search[$key.'_dtstart'] = '';
196 $search[$key.'_dtend'] = '';
197 }
198 }
199 $toselect = array();
200 $search_array_options = array();
201 }
202 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
203 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
204 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
205 }
206
207 // Mass actions
208 $objectclass = 'RecruitmentCandidature';
209 $objectlabel = 'RecruitmentCandidature';
210 $uploaddir = $conf->recruitment->dir_output;
211 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
212}
213
214
215
216/*
217 * View
218 */
219
220$form = new Form($db);
221
222$now = dol_now();
223
224//$help_url="EN:Module_RecruitmentCandidature|FR:Module_RecruitmentCandidature_FR|ES:Módulo_RecruitmentCandidature";
225$help_url = '';
226$title = $langs->trans('RecruitmentCandidatures');
227$morejs = array();
228$morecss = array();
229
230
231// Build and execute select
232// --------------------------------------------------------------------
233$sql = 'SELECT ';
234$sql .= $object->getFieldList('t');
235// Add fields from extrafields
236if (!empty($extrafields->attributes[$object->table_element]['label'])) {
237 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
238 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
239 }
240}
241// Add fields from hooks
242$parameters = array();
243$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
244$sql .= $hookmanager->resPrint;
245$sql = preg_replace('/,\s*$/', '', $sql);
246
247$sqlfields = $sql; // $sql fields to remove for count total
248
249$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
250if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
251 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
252}
253// Add table from hooks
254$parameters = array();
255$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
256$sql .= $hookmanager->resPrint;
257if ($object->ismultientitymanaged == 1) {
258 $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
259} else {
260 $sql .= " WHERE 1 = 1";
261}
262foreach ($search as $key => $val) {
263 if (array_key_exists($key, $object->fields)) {
264 if ($key == 'status' && $search[$key] == -1) {
265 continue;
266 }
267 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
268 if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
269 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
270 $search[$key] = '';
271 }
272 $mode_search = 2;
273 }
274 if ($search[$key] != '') {
275 $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
276 }
277 } else {
278 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
279 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
280 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
281 if (preg_match('/_dtstart$/', $key)) {
282 $sql .= " AND t.".$db->escape($columnName)." >= '".$db->idate($search[$key])."'";
283 }
284 if (preg_match('/_dtend$/', $key)) {
285 $sql .= " AND t.".$db->escape($columnName)." <= '" . $db->idate($search[$key])."'";
286 }
287 }
288 }
289 }
290}
291if ($search_all) {
292 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
293}
294if (!empty($id)) {
295 $sql .= " AND t.fk_recruitmentjobposition = ".((int) $id);
296}
297//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
298// Add where from extra fields
299include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
300// Add where from hooks
301$parameters = array();
302$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
303$sql .= $hookmanager->resPrint;
304
305/* If a group by is required
306$sql.= " GROUP BY ";
307foreach ($object->fields as $key => $val) {
308 $sql .= "t.".$db->escape($key).", ";
309}
310// Add fields from extrafields
311if (!empty($extrafields->attributes[$object->table_element]['label'])) {
312 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
313 $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
314 }
315}
316// Add where from hooks
317$parameters=array();
318$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
319$sql .= $hookmanager->resPrint;
320$sql = preg_replace('/,\s*$/', '', $sql);
321*/
322
323// Count total nb of records
324$nbtotalofrecords = '';
325if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
326 /* The fast and low memory method to get and count full list converts the sql into a sql count */
327 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
328 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
329 $resql = $db->query($sqlforcount);
330 if ($resql) {
331 $objforcount = $db->fetch_object($resql);
332 $nbtotalofrecords = $objforcount->nbtotalofrecords;
333 } else {
334 dol_print_error($db);
335 }
336
337 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
338 $page = 0;
339 $offset = 0;
340 }
341 $db->free($resql);
342}
343
344// Complete request and execute it with limit
345$sql .= $db->order($sortfield, $sortorder);
346if ($limit) {
347 $sql .= $db->plimit($limit + 1, $offset);
348}
349
350$resql = $db->query($sql);
351if (!$resql) {
352 dol_print_error($db);
353 exit;
354}
355
356$num = $db->num_rows($resql);
357
358
359// Direct jump if only one record found
360if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
361 $obj = $db->fetch_object($resql);
362 $id = $obj->rowid;
363 header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.$id);
364 exit;
365}
366
367
368// Output page
369// --------------------------------------------------------------------
370
371llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
372
373
374// Part to show record
375
376if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
377 $savobject = $object;
378
379 $object = $jobposition;
380
381 $res = $object->fetch_optionals();
382
383 $head = recruitmentjobpositionPrepareHead($object);
384 print dol_get_fiche_head($head, 'candidatures', $langs->trans("RecruitmentCandidatures"), -1, $object->picto);
385
386 $formconfirm = '';
387
388 // Confirmation to delete
389 if ($action == 'delete') {
390 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRecruitmentJobPosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
391 }
392 // Confirmation to delete line
393 if ($action == 'deleteline') {
394 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
395 }
396 // Clone confirmation
397 if ($action == 'clone') {
398 // Create an array for form
399 $formquestion = array();
400 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
401 }
402
403 // Call Hook formConfirm
404 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
405 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
406 if (empty($reshook)) {
407 $formconfirm .= $hookmanager->resPrint;
408 } elseif ($reshook > 0) {
409 $formconfirm = $hookmanager->resPrint;
410 }
411
412 // Print form confirm
413 print $formconfirm;
414
415
416 // Object card
417 // ------------------------------------------------------------
418 $linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
419
420 $morehtmlref = '<div class="refidno">';
421 /*
422 // Ref customer
423 $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
424 $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
425 // Thirdparty
426 $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
427 */
428 // Project
429 if (isModEnabled('project')) {
430 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
431 $formproject = new FormProjets($db);
432 $langs->load("projects");
433 $morehtmlref .= $langs->trans('Project').' ';
434 if ($permissiontoadd) {
435 if ($action != 'classify') {
436 $morehtmlref .= '<a class="editfielda" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'classify', 'id' => $object->id], true).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a>';
437 }
438 $morehtmlref .= ' : ';
439 if ($action == 'classify') {
440 //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
441 $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
442 $morehtmlref .= '<input type="hidden" name="action" value="classin">';
443 $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
444 $morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
445 $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
446 $morehtmlref .= '</form>';
447 } else {
448 $morehtmlref .= $form->form_project($_SERVER['PHP_SELF'].'?id='.$object->id, !empty($object->socid) ? $object->socid : 0, (string) $object->fk_project, 'none', 0, 0, 0, 1, '', 'maxwidth300');
449 }
450 } else {
451 if (!empty($object->fk_project)) {
452 $proj = new Project($db);
453 $proj->fetch($object->fk_project);
454 $morehtmlref .= ': '.$proj->getNomUrl();
455 } else {
456 $morehtmlref .= '';
457 }
458 }
459 }
460 $morehtmlref .= '</div>';
461
462
463 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
464
465
466 print '<div class="fichecenter">';
467 print '<div class="fichehalfleft">';
468 print '<div class="underbanner clearboth"></div>';
469 print '<table class="border centpercent tableforfield">'."\n";
470
471 // Common attributes
472 $keyforbreak = 'description'; // We change column just after this field
473 unset($object->fields['fk_project']); // Hide field already shown in banner
474 //unset($object->fields['fk_soc']); // Hide field already shown in banner
475 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
476
477 // Other attributes. Fields from hook formObjectOptions and Extrafields.
478 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
479
480 print '</table>';
481 print '</div>';
482 print '</div>';
483
484 print '<div class="clearboth"></div>';
485
486 print dol_get_fiche_end();
487
488 print '<br>';
489
490 $object = $savobject;
491}
492
493
494$arrayofselected = is_array($toselect) ? $toselect : array();
495
496$param = '';
497if (!empty($id)) {
498 $param .= '&id='.urlencode((string) ($id));
499}
500if (!empty($mode)) {
501 $param .= '&mode='.urlencode($mode);
502}
503if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
504 $param .= '&contextpage='.urlencode($contextpage);
505}
506if ($limit > 0 && $limit != $conf->liste_limit) {
507 $param .= '&limit='.((int) $limit);
508}
509foreach ($search as $key => $val) {
510 if (is_array($search[$key])) {
511 foreach ($search[$key] as $skey) {
512 if ($skey != '') {
513 $param .= '&search_'.$key.'[]='.urlencode($skey);
514 }
515 }
516 } elseif ($search[$key] != '') {
517 $param .= '&search_'.$key.'='.urlencode($search[$key]);
518 }
519}
520if ($optioncss != '') {
521 $param .= '&optioncss='.urlencode($optioncss);
522}
523// Add $param from extra fields
524include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
525// Add $param from hooks
526$parameters = array('param' => &$param);
527$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
528$param .= $hookmanager->resPrint;
529
530// List of mass actions available
531$arrayofmassactions = array(
532 'validate' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
533 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
534 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
535 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
536);
537if (!empty($permissiontodelete)) {
538 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
539}
540if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
541 $arrayofmassactions = array();
542}
543$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
544
545print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
546if ($optioncss != '') {
547 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
548}
549print '<input type="hidden" name="token" value="'.newToken().'">';
550print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
551print '<input type="hidden" name="action" value="list">';
552print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
553print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
554print '<input type="hidden" name="page" value="'.$page.'">';
555print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
556print '<input type="hidden" name="mode" value="'.$mode.'">';
557print '<input type="hidden" name="id" value="'.$id.'">';
558
559
560$newcardbutton = '';
561$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'));
562$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'));
563$newcardbutton .= dolGetButtonTitleSeparator();
564$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?action=create&fk_recruitmentjobposition='.$id, '', $permissiontoadd);
565
566print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
567
568// Add code for pre mass action (confirmation or email presend form)
569$topicmail = "SendRecruitmentCandidatureRef";
570$modelmail = "recruitmentcandidature";
571$objecttmp = new RecruitmentCandidature($db);
572$trackid = 'recruitmentapplication'.$object->id;
573include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
574
575if ($search_all) {
576 $setupstring = '';
577 foreach ($fieldstosearchall as $key => $val) {
578 $fieldstosearchall[$key] = $langs->trans($val);
579 $setupstring .= $key."=".$val.";";
580 }
581 print '<!-- Search done like if RECRUITMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
582 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
583}
584
585$moreforfilter = '';
586/*$moreforfilter.='<div class="divsearchfield">';
587$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
588$moreforfilter.= '</div>';*/
589
590$parameters = array();
591$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
592if (empty($reshook)) {
593 $moreforfilter .= $hookmanager->resPrint;
594} else {
595 $moreforfilter = $hookmanager->resPrint;
596}
597
598if (!empty($moreforfilter)) {
599 print '<div class="liste_titre liste_titre_bydiv centpercent">';
600 print $moreforfilter;
601 print '</div>';
602}
603
604$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
605$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')); // This also change content of $arrayfields
606$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
607
608print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
609print '<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
610
611
612// Fields title search
613// --------------------------------------------------------------------
614print '<tr class="liste_titre_filter">';
615// Action column
616if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
617 print '<td class="liste_titre maxwidthsearch center">';
618 $searchpicto = $form->showFilterButtons('left');
619 print $searchpicto;
620 print '</td>';
621}
622foreach ($object->fields as $key => $val) {
623 $searchkey = empty($search[$key]) ? '' : $search[$key];
624 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
625 if ($key == 'status') {
626 $cssforfield .= ($cssforfield ? ' ' : '').'center';
627 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
628 $cssforfield .= ($cssforfield ? ' ' : '').'center';
629 } elseif (in_array($val['type'], array('timestamp'))) {
630 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
631 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
632 $cssforfield .= ($cssforfield ? ' ' : '').'right';
633 }
634 if (!empty($arrayfields['t.'.$key]['checked'])) {
635 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
636 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
637 print $form->selectarray('search_'.$key, $val['arrayofkeyval'], (isset($search[$key]) ? $search[$key] : ''), $val['notnull'], 0, 0, '', 1, 0, 0, '', 'maxwidth100'.($key == 'status' ? ' search_status width100 onrightofpage' : ''), 1);
638 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
639 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
640 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
641 print '<div class="nowrap">';
642 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
643 print '</div>';
644 print '<div class="nowrap">';
645 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
646 print '</div>';
647 } elseif ($key == 'lang') {
648 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
649 $formadmin = new FormAdmin($db);
650 print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
651 } else {
652 print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
653 }
654 print '</td>';
655 }
656}
657// Extra fields
658include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
659
660// Fields from hook
661$parameters = array('arrayfields' => $arrayfields);
662$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
663print $hookmanager->resPrint;
664// Action column
665if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
666 print '<td class="liste_titre center maxwidthsearch">';
667 $searchpicto = $form->showFilterButtons();
668 print $searchpicto;
669 print '</td>';
670}
671print '</tr>'."\n";
672
673$totalarray = array();
674$totalarray['nbfield'] = 0;
675
676// Fields title label
677// --------------------------------------------------------------------
678print '<tr class="liste_titre">';
679if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
680 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
681 $totalarray['nbfield']++;
682}
683foreach ($object->fields as $key => $val) {
684 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
685 if ($key == 'status') {
686 $cssforfield .= ($cssforfield ? ' ' : '').'center';
687 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
688 $cssforfield .= ($cssforfield ? ' ' : '').'center';
689 } elseif (in_array($val['type'], array('timestamp'))) {
690 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
691 } elseif (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('id', 'rowid', 'ref', 'status')) && $val['label'] != 'TechnicalID' && empty($val['arrayofkeyval'])) {
692 $cssforfield .= ($cssforfield ? ' ' : '').'right';
693 }
694 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
695 if (!empty($arrayfields['t.'.$key]['checked'])) {
696 print getTitleFieldOfList($arrayfields['t.'.$key]['label'], 0, $_SERVER['PHP_SELF'], 't.'.$key, '', $param, ($cssforfield ? 'class="'.$cssforfield.'"' : ''), $sortfield, $sortorder, ($cssforfield ? $cssforfield.' ' : ''), 0, (empty($val['helplist']) ? '' : $val['helplist']))."\n";
697 $totalarray['nbfield']++;
698 }
699}
700// Extra fields
701include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
702// Hook fields
703$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
704$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
705print $hookmanager->resPrint;
706// Action column
707if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
708 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
709 $totalarray['nbfield']++;
710}
711print '</tr>'."\n";
712
713
714// Detect if we need a fetch on each output line
715$needToFetchEachLine = 0;
716if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
717 foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
718 if (!is_null($val) && preg_match('/\$object/', $val)) {
719 $needToFetchEachLine++; // There is at least one compute field that use $object
720 }
721 }
722}
723
724
725// Loop on record
726// --------------------------------------------------------------------
727$i = 0;
728$savnbfield = $totalarray['nbfield'];
729$totalarray = array();
730$totalarray['nbfield'] = 0;
731$imaxinloop = ($limit ? min($num, $limit) : $num);
732while ($i < $imaxinloop) {
733 $obj = $db->fetch_object($resql);
734 if (empty($obj)) {
735 break; // Should not happen
736 }
737
738 // Store properties in $object
739 $object->setVarsFromFetchObj($obj);
740
741 if ($mode == 'kanban') {
742 if ($i == 0) {
743 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
744 print '<div class="box-flex-container kanban">';
745 }
746 // TODO Use a cache for $recruitment
747 $recruitment = new RecruitmentJobPosition($db);
748 $recruitment->fetch($obj->fk_recruitmentjobposition);
749
750 $object->phone = $obj->phone;
751
752 // Output Kanban
753 $selected = -1;
754 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
755 $selected = 0;
756 if (in_array($object->id, $arrayofselected)) {
757 $selected = 1;
758 }
759 }
760 print $object->getKanbanView('', array('jobpositionlink' => $recruitment->getNomUrl(1), 'selected' => $selected));
761 if ($i == ($imaxinloop - 1)) {
762 print '</div>';
763 print '</td></tr>';
764 }
765 } else {
766 // Show here line of result
767 $j = 0;
768 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
769 // Action column
770 if (getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
771 print '<td class="nowrap center">';
772 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
773 $selected = 0;
774 if (in_array($object->id, $arrayofselected)) {
775 $selected = 1;
776 }
777 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
778 }
779 print '</td>';
780 if (!$i) {
781 $totalarray['nbfield']++;
782 }
783 }
784 foreach ($object->fields as $key => $val) {
785 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
786 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
787 $cssforfield .= ($cssforfield ? ' ' : '').'center';
788 } elseif ($key == 'status') {
789 $cssforfield .= ($cssforfield ? ' ' : '').'center';
790 }
791
792 if (in_array($val['type'], array('timestamp'))) {
793 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
794 } elseif ($key == 'ref') {
795 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
796 }
797
798 if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
799 $cssforfield .= ($cssforfield ? ' ' : '').'right';
800 }
801 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
802
803 if (!empty($arrayfields['t.'.$key]['checked'])) {
804 print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
805 if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
806 print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
807 }
808 print '>';
809 if ($key == 'status') {
810 print $object->getLibStatut(5);
811 } elseif ($key == 'rowid') {
812 print $object->showOutputField($val, $key, (string) $object->id, '');
813 } else {
814 print $object->showOutputField($val, $key, $object->$key, '');
815 }
816 print '</td>';
817 if (!$i) {
818 $totalarray['nbfield']++;
819 }
820 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
821 if (!$i) {
822 $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
823 }
824 if (!isset($totalarray['val'])) {
825 $totalarray['val'] = array();
826 }
827 if (!isset($totalarray['val']['t.'.$key])) {
828 $totalarray['val']['t.'.$key] = 0;
829 }
830 $totalarray['val']['t.'.$key] += $object->$key;
831 }
832 }
833 }
834 // Extra fields
835 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
836 // Fields from hook
837 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
838 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
839 print $hookmanager->resPrint;
840 // Action column
841 if (!getDolGlobalString('MAIN_CHECKBOX_LEFT_COLUMN')) {
842 print '<td class="nowrap center">';
843 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
844 $selected = 0;
845 if (in_array($object->id, $arrayofselected)) {
846 $selected = 1;
847 }
848 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
849 }
850 print '</td>';
851 if (!$i) {
852 $totalarray['nbfield']++;
853 }
854 }
855
856 print '</tr>'."\n";
857 }
858
859 $i++;
860}
861
862// Show total line
863include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
864
865// If no record found
866if ($num == 0) {
867 $colspan = 1;
868 foreach ($arrayfields as $key => $val) {
869 if (!empty($val['checked'])) {
870 $colspan++;
871 }
872 }
873 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
874}
875
876
877$db->free($resql);
878
879$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
880$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
881print $hookmanager->resPrint;
882
883print '</table>'."\n";
884print '</div>'."\n";
885
886print '</form>'."\n";
887
888if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
889 $hidegeneratedfilelistifempty = 1;
890 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
891 $hidegeneratedfilelistifempty = 0;
892 }
893
894 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
895 $formfile = new FormFile($db);
896
897 // Show list of available documents
898 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
899 $urlsource .= str_replace('&amp;', '&', $param);
900
901 $filedir = $diroutputmassaction;
902 $genallowed = $permissiontoread;
903 $delallowed = $permissiontoadd;
904
905 print $formfile->showdocuments('massfilesarea_recruitment', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
906}
907
908// End of page
909llxFooter();
910$db->close();
$id
Support class for third parties, contacts, members, users or resources.
Definition account.php:47
if(! $sortfield) if(! $sortorder) $object
Definition account.php:100
$totalarray
Definition export.php:1216
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
Definition wrapper.php:91
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Definition wrapper.php:73
Class to manage standard extra fields.
Class to generate html code for admin pages.
Class to offer components to list and upload files.
Class to manage generation of HTML components Only common components must be here.
Class to manage building of HTML components.
Class to manage projects.
Class for RecruitmentCandidature.
Class for RecruitmentJobPosition.
dol_now($mode='gmt')
Return date for now.
dol_mktime($hour, $minute, $second, $month, $day, $year, $gm='auto', $check=1)
Return a timestamp date built from detailed information (by default a local PHP server timestamp) Rep...
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
print_barre_liste($title, $page, $file, $options='', $sortfield='', $sortorder='', $morehtmlcenter='', $num=-1, $totalnboflines='', $picto='generic', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limit=-1, $selectlimitsuffix=0, $hidenavigation=0, $pagenavastextinput=0, $morehtmlrightbeforearrow='')
Print a title with navigation controls for pagination.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='', $dragdropfile=0, $morecssdiv='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
dol_eval($s, $returnvalue=1, $hideerrors=1, $onlysimplestring='1')
Replace eval function to add more security.
natural_search($fields, $value, $mode=0, $nofirstand=0, $sqltoadd='')
Generate natural SQL search string for a criteria (this criteria can be tested on one or several fiel...
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_sort_array(&$array, $index, $order='asc', $natsort=0, $case_sensitive=0, $keepindex=0)
Advanced sort array by the value of a given key, which produces ascending (default) or descending out...
getTitleFieldOfList($name, $thead=0, $file="", $field="", $begin="", $moreparam="", $moreattrib="", $sortfield="", $sortorder="", $prefix="", $disablesortlink=0, $tooltip='', $forcenowrapcolumntitle=0)
Get title line of an array.
dolGetButtonTitleSeparator($moreClass="")
Add space between dolGetButtonTitle.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
isModEnabled($module)
Is Dolibarr module enabled.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
recruitmentjobpositionPrepareHead($object)
Prepare array of tabs for RecruitmentJobPosition.
restrictedArea(User $user, $features, $object=0, $tableandshare='', $feature2='', $dbt_keyfield='fk_soc', $dbt_select='rowid', $isdraft=0, $mode=0)
Check permissions of a user to show a page and an object.