dolibarr 24.0.1
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-2026 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// Add hook to complete $arrayfield
141$parameters = array('arrayfields' => &$arrayfields);
142$reshook = $hookmanager->executeHooks('completeArrayFields', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
143
144// Load object
145$jobposition = new RecruitmentJobPosition($db);
146if ($id > 0 || !empty($ref)) {
147 $jobposition->fetch($id, $ref);
148 $id = $jobposition->id;
149}
150
151$object->fields = dol_sort_array($object->fields, 'position');
152$arrayfields = dol_sort_array($arrayfields, 'position');
153
154$permissiontoread = $user->hasRight('recruitment', 'recruitmentjobposition', 'read');
155$permissiontoadd = $user->hasRight('recruitment', 'recruitmentjobposition', 'write');
156$permissiontodelete = $user->hasRight('recruitment', 'recruitmentjobposition', 'delete');
157
158// Security check - Protection if external user
159//if ($user->socid > 0) accessforbidden();
160//if ($user->socid > 0) $socid = $user->socid;
161//$isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
162if ($jobposition->id > 0) {
163 $isdraft = (($jobposition->status == $jobposition::STATUS_DRAFT) ? 1 : 0);
164 $result = restrictedArea($user, 'recruitment', $jobposition->id, 'recruitment_recruitmentjobposition', 'recruitmentjobposition', '', 'rowid', $isdraft);
165} else {
166 $result = restrictedArea($user, 'recruitment', 0, 'recruitment_recruitmentcandidature', 'recruitmentjobposition');
167}
168
169
170
171/*
172 * Actions
173 */
174
175if (GETPOST('cancel', 'alpha')) {
176 $action = 'list';
177 $massaction = '';
178}
179if (!GETPOST('confirmmassaction', 'alpha') && $massaction != 'presend' && $massaction != 'confirm_presend') {
180 $massaction = '';
181}
182
183$parameters = array();
184$reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
185if ($reshook < 0) {
186 setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
187}
188
189if (empty($reshook)) {
190 // Selection of new fields
191 include DOL_DOCUMENT_ROOT.'/core/actions_changeselectedfields.inc.php';
192
193 // Purge search criteria
194 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
195 foreach ($object->fields as $key => $val) {
196 $search[$key] = '';
197 if (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
198 $search[$key.'_dtstart'] = '';
199 $search[$key.'_dtend'] = '';
200 }
201 }
202 $toselect = array();
203 $search_array_options = array();
204 }
205 if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x', 'alpha') || GETPOST('button_removefilter', 'alpha')
206 || GETPOST('button_search_x', 'alpha') || GETPOST('button_search.x', 'alpha') || GETPOST('button_search', 'alpha')) {
207 $massaction = ''; // Protection to avoid mass action if we force a new search during a mass action confirmation
208 }
209
210 // Mass actions
211 $objectclass = 'RecruitmentCandidature';
212 $objectlabel = 'RecruitmentCandidature';
213 $uploaddir = $conf->recruitment->dir_output;
214 include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
215}
216
217
218
219/*
220 * View
221 */
222
223$form = new Form($db);
224
225$now = dol_now();
226
227//$help_url="EN:Module_RecruitmentCandidature|FR:Module_RecruitmentCandidature_FR|ES:Módulo_RecruitmentCandidature";
228$help_url = '';
229$title = $langs->trans('RecruitmentCandidatures');
230$morejs = array();
231$morecss = array();
232
233
234// Build and execute select
235// --------------------------------------------------------------------
236$sql = 'SELECT ';
237$sql .= $object->getFieldList('t');
238// Add fields from extrafields
239if (!empty($extrafields->attributes[$object->table_element]['label'])) {
240 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
241 $sql .= ($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? ", ef.".$key." as options_".$key : '');
242 }
243}
244// Add fields from hooks
245$parameters = array();
246$reshook = $hookmanager->executeHooks('printFieldListSelect', $parameters, $object); // Note that $action and $object may have been modified by hook
247$sql .= $hookmanager->resPrint;
248$sql = preg_replace('/,\s*$/', '', $sql);
249
250$sqlfields = $sql; // $sql fields to remove for count total
251
252$sql .= " FROM ".MAIN_DB_PREFIX.$object->table_element." as t";
253if (isset($extrafields->attributes[$object->table_element]['label']) && is_array($extrafields->attributes[$object->table_element]['label']) && count($extrafields->attributes[$object->table_element]['label'])) {
254 $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$object->table_element."_extrafields as ef on (t.rowid = ef.fk_object)";
255}
256// Add table from hooks
257$parameters = array();
258$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object); // Note that $action and $object may have been modified by hook
259$sql .= $hookmanager->resPrint;
260if ($object->ismultientitymanaged == 1) {
261 $sql .= " WHERE t.entity IN (".getEntity($object->element).")";
262} else {
263 $sql .= " WHERE 1 = 1";
264}
265foreach ($search as $key => $val) {
266 if (array_key_exists($key, $object->fields)) {
267 if ($key == 'status' && $search[$key] == -1) {
268 continue;
269 }
270 $mode_search = (($object->isInt($object->fields[$key]) || $object->isFloat($object->fields[$key])) ? 1 : 0);
271 if ((strpos($object->fields[$key]['type'], 'integer:') === 0) || (strpos($object->fields[$key]['type'], 'sellist:') === 0) || !empty($object->fields[$key]['arrayofkeyval'])) {
272 if ($search[$key] == '-1' || ($search[$key] === '0' && (empty($object->fields[$key]['arrayofkeyval']) || !array_key_exists('0', $object->fields[$key]['arrayofkeyval'])))) {
273 $search[$key] = '';
274 }
275 $mode_search = 2;
276 }
277 if ($search[$key] != '') {
278 $sql .= natural_search("t.".$db->escape($key), $search[$key], (($key == 'status') ? 2 : $mode_search));
279 }
280 } else {
281 if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') {
282 $columnName = preg_replace('/(_dtstart|_dtend)$/', '', $key);
283 if (preg_match('/^(date|timestamp|datetime)/', $object->fields[$columnName]['type'])) {
284 if (preg_match('/_dtstart$/', $key)) {
285 $sql .= " AND t.".$db->sanitize($columnName)." >= '".$db->idate($search[$key])."'";
286 }
287 if (preg_match('/_dtend$/', $key)) {
288 $sql .= " AND t.".$db->sanitize($columnName)." <= '" . $db->idate($search[$key])."'";
289 }
290 }
291 }
292 }
293}
294if ($search_all) {
295 $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
296}
297if (!empty($id)) {
298 $sql .= " AND t.fk_recruitmentjobposition = ".((int) $id);
299}
300//$sql.= dolSqlDateFilter("t.field", $search_xxxday, $search_xxxmonth, $search_xxxyear);
301// Add where from extra fields
302include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
303// Add where from hooks
304$parameters = array();
305$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
306$sql .= $hookmanager->resPrint;
307
308/* If a group by is required
309$sql.= " GROUP BY ";
310foreach ($object->fields as $key => $val) {
311 $sql .= "t.".$db->escape($key).", ";
312}
313// Add fields from extrafields
314if (!empty($extrafields->attributes[$object->table_element]['label'])) {
315 foreach ($extrafields->attributes[$object->table_element]['label'] as $key => $val) {
316 $sql.=($extrafields->attributes[$object->table_element]['type'][$key] != 'separate' ? "ef.".$key.', ' : '');
317 }
318}
319// Add where from hooks
320$parameters=array();
321$reshook = $hookmanager->executeHooks('printFieldListGroupBy', $parameters, $object); // Note that $action and $object may have been modified by hook
322$sql .= $hookmanager->resPrint;
323$sql = preg_replace('/,\s*$/', '', $sql);
324*/
325
326// Count total nb of records
327$nbtotalofrecords = '';
328if (!getDolGlobalInt('MAIN_DISABLE_FULL_SCANLIST')) {
329 /* The fast and low memory method to get and count full list converts the sql into a sql count */
330 $sqlforcount = preg_replace('/^'.preg_quote($sqlfields, '/').'/', 'SELECT COUNT(*) as nbtotalofrecords', $sql);
331 $sqlforcount = preg_replace('/GROUP BY .*$/', '', $sqlforcount);
332 $resql = $db->query($sqlforcount);
333 if ($resql) {
334 $objforcount = $db->fetch_object($resql);
335 $nbtotalofrecords = $objforcount->nbtotalofrecords;
336 } else {
338 }
339
340 if (($page * $limit) > (int) $nbtotalofrecords) { // if total resultset is smaller than the paging size (filtering), goto and load page 0
341 $page = 0;
342 $offset = 0;
343 }
344 $db->free($resql);
345}
346
347// Complete request and execute it with limit
348$sql .= $db->order($sortfield, $sortorder);
349if ($limit) {
350 $sql .= $db->plimit($limit + 1, $offset);
351}
352
353$resql = $db->query($sql);
354if (!$resql) {
356 exit;
357}
358
359$num = $db->num_rows($resql);
360
361
362// Direct jump if only one record found
363if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all && !$page) {
364 $obj = $db->fetch_object($resql);
365 $id = $obj->rowid;
366 header("Location: ".DOL_URL_ROOT.'/recruitment/recruitmentcandidature_card.php?id='.$id);
367 exit;
368}
369
370
371// Output page
372// --------------------------------------------------------------------
373
374llxHeader('', $title, $help_url, '', 0, 0, $morejs, $morecss, '', 'bodyforlist');
375
376
377// Part to show record
378
379if ($jobposition->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
380 $savobject = $object;
381
382 $object = $jobposition;
383
384 $res = $object->fetch_optionals();
385
386 $head = recruitmentjobpositionPrepareHead($object);
387 print dol_get_fiche_head($head, 'candidatures', $langs->trans("RecruitmentCandidatures"), -1, $object->picto);
388
389 $formconfirm = '';
390
391 // Confirmation to delete
392 if ($action == 'delete') {
393 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRecruitmentJobPosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
394 }
395 // Confirmation to delete line
396 if ($action == 'deleteline') {
397 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
398 }
399 // Clone confirmation
400 if ($action == 'clone') {
401 // Create an array for form
402 $formquestion = array();
403 $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
404 }
405
406 // Call Hook formConfirm
407 $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
408 $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
409 if (empty($reshook)) {
410 $formconfirm .= $hookmanager->resPrint;
411 } elseif ($reshook > 0) {
412 $formconfirm = $hookmanager->resPrint;
413 }
414
415 // Print form confirm
416 print $formconfirm;
417
418
419 // Object card
420 // ------------------------------------------------------------
421 $linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
422
423 $morehtmlref = '<div class="refidno">';
424 /*
425 // Ref customer
426 $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
427 $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
428 // Thirdparty
429 $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
430 */
431 // Project
432 if (isModEnabled('project')) {
433 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
434 $formproject = new FormProjets($db);
435 $langs->load("projects");
436 $morehtmlref .= $langs->trans('Project').' ';
437 if ($permissiontoadd) {
438 if ($action != 'classify') {
439 $morehtmlref .= '<a class="editfielda" href="'.dolBuildUrl($_SERVER['PHP_SELF'], ['action' => 'classify', 'id' => $object->id], true).'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a>';
440 }
441 $morehtmlref .= ' : ';
442 if ($action == 'classify') {
443 //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
444 $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
445 $morehtmlref .= '<input type="hidden" name="action" value="classin">';
446 $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
447 $morehtmlref .= $formproject->select_projects(0, (string) $object->fk_project, 'projectid', 0, 0, 1, 0, 1, 0, 0, '', 1);
448 $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
449 $morehtmlref .= '</form>';
450 } else {
451 $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');
452 }
453 } else {
454 if (!empty($object->fk_project)) {
455 $proj = new Project($db);
456 $proj->fetch($object->fk_project);
457 $morehtmlref .= ': '.$proj->getNomUrl();
458 } else {
459 $morehtmlref .= '';
460 }
461 }
462 }
463 $morehtmlref .= '</div>';
464
465
466 dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
467
468
469 print '<div class="fichecenter">';
470 print '<div class="fichehalfleft">';
471 print '<div class="underbanner clearboth"></div>';
472 print '<table class="border centpercent tableforfield">'."\n";
473
474 // Common attributes
475 $keyforbreak = 'description'; // We change column just after this field
476 unset($object->fields['fk_project']); // Hide field already shown in banner
477 //unset($object->fields['fk_soc']); // Hide field already shown in banner
478 include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
479
480 // Other attributes. Fields from hook formObjectOptions and Extrafields.
481 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
482
483 print '</table>';
484 print '</div>';
485 print '</div>';
486
487 print '<div class="clearboth"></div>';
488
489 print dol_get_fiche_end();
490
491 print '<br>';
492
493 $object = $savobject;
494}
495
496
497$arrayofselected = is_array($toselect) ? $toselect : array();
498
499$param = '';
500if (!empty($id)) {
501 $param .= '&id='.urlencode((string) ($id));
502}
503if (!empty($mode)) {
504 $param .= '&mode='.urlencode($mode);
505}
506if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) {
507 $param .= '&contextpage='.urlencode($contextpage);
508}
509if ($limit > 0 && $limit != $conf->liste_limit) {
510 $param .= '&limit='.((int) $limit);
511}
512foreach ($search as $key => $val) {
513 if (is_array($search[$key])) {
514 foreach ($search[$key] as $skey) {
515 if ($skey != '') {
516 $param .= '&search_'.$key.'[]='.urlencode($skey);
517 }
518 }
519 } elseif ($search[$key] != '') {
520 $param .= '&search_'.$key.'='.urlencode($search[$key]);
521 }
522}
523if ($optioncss != '') {
524 $param .= '&optioncss='.urlencode($optioncss);
525}
526// Add $param from extra fields
527include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php';
528// Add $param from hooks
529$parameters = array('param' => &$param);
530$reshook = $hookmanager->executeHooks('printFieldListSearchParam', $parameters, $object); // Note that $action and $object may have been modified by hook
531$param .= $hookmanager->resPrint;
532
533// List of mass actions available
534$arrayofmassactions = array(
535 'validate' => img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate"),
536 //'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
537 //'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
538 //'presend'=>img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail"),
539);
540if (!empty($permissiontodelete)) {
541 $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
542}
543if (GETPOSTINT('nomassaction') || in_array($massaction, array('presend', 'predelete'))) {
544 $arrayofmassactions = array();
545}
546$massactionbutton = $form->selectMassAction('', $arrayofmassactions);
547
548print '<form method="POST" id="searchFormList" action="'.$_SERVER["PHP_SELF"].'">'."\n";
549if ($optioncss != '') {
550 print '<input type="hidden" name="optioncss" value="'.$optioncss.'">';
551}
552print '<input type="hidden" name="token" value="'.newToken().'">';
553print '<input type="hidden" name="formfilteraction" id="formfilteraction" value="list">';
554print '<input type="hidden" name="action" value="list">';
555print '<input type="hidden" name="sortfield" value="'.$sortfield.'">';
556print '<input type="hidden" name="sortorder" value="'.$sortorder.'">';
557print '<input type="hidden" name="page" value="'.$page.'">';
558print '<input type="hidden" name="contextpage" value="'.$contextpage.'">';
559print '<input type="hidden" name="mode" value="'.$mode.'">';
560print '<input type="hidden" name="id" value="'.$id.'">';
561
562
563$newcardbutton = '';
564$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'));
565$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'));
566$newcardbutton .= dolGetButtonTitleSeparator();
567$newcardbutton .= dolGetButtonTitle($langs->trans('New'), '', 'fa fa-plus-circle', dol_buildpath('/recruitment/recruitmentcandidature_card.php', 1).'?action=create&fk_recruitmentjobposition='.$id, '', $permissiontoadd);
568
569print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, $massactionbutton, $num, $nbtotalofrecords, 'object_'.$object->picto, 0, $newcardbutton, '', $limit, 0, 0, 1);
570
571// Add code for pre mass action (confirmation or email presend form)
572$topicmail = "SendRecruitmentCandidatureRef";
573$modelmail = "recruitmentcandidature";
574$objecttmp = new RecruitmentCandidature($db);
575$trackid = 'recruitmentapplication'.$object->id;
576include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
577
578if ($search_all) {
579 $setupstring = '';
580 foreach ($fieldstosearchall as $key => $val) {
581 $fieldstosearchall[$key] = $langs->trans($val);
582 $setupstring .= $key."=".$val.";";
583 }
584 print '<!-- Search done like if RECRUITMENT_QUICKSEARCH_ON_FIELDS = '.$setupstring.' -->'."\n";
585 print '<div class="divsearchfieldfilter">'.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).'</div>'."\n";
586}
587
588$moreforfilter = '';
589/*$moreforfilter.='<div class="divsearchfield">';
590$moreforfilter.= $langs->trans('MyFilter') . ': <input type="text" name="search_myfield" value="'.dol_escape_htmltag($search_myfield).'">';
591$moreforfilter.= '</div>';*/
592
593$parameters = array();
594$reshook = $hookmanager->executeHooks('printFieldPreListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
595if (empty($reshook)) {
596 $moreforfilter .= $hookmanager->resPrint;
597} else {
598 $moreforfilter = $hookmanager->resPrint;
599}
600
601if (!empty($moreforfilter)) {
602 print '<div class="liste_titre liste_titre_bydiv centpercent">';
603 print $moreforfilter;
604 print '</div>';
605}
606
607$varpage = empty($contextpage) ? $_SERVER["PHP_SELF"] : $contextpage;
608$selectedfields = $form->multiSelectArrayWithCheckbox('selectedfields', $arrayfields, $varpage, $conf->main_checkbox_left_column); // This also change content of $arrayfields
609$selectedfields .= (count($arrayofmassactions) ? $form->showCheckAddButtons('checkforselect', 1) : '');
610
611print '<div class="div-table-responsive">'; // You can use div-table-responsive-no-min if you don't need reserved height for your table
612print '<table class="tagtable nobottomiftotal noborder liste'.($moreforfilter ? " listwithfilterbefore" : "").'">'."\n";
613
614
615// Fields title search
616// --------------------------------------------------------------------
617print '<tr class="liste_titre_filter">';
618// Action column
619if ($conf->main_checkbox_left_column) {
620 print '<td class="liste_titre maxwidthsearch center">';
621 $searchpicto = $form->showFilterButtons('left');
622 print $searchpicto;
623 print '</td>';
624}
625foreach ($object->fields as $key => $val) {
626 $searchkey = empty($search[$key]) ? '' : $search[$key];
627 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
628 if ($key == 'status') {
629 $cssforfield .= ($cssforfield ? ' ' : '').'center';
630 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
631 $cssforfield .= ($cssforfield ? ' ' : '').'center';
632 } elseif (in_array($val['type'], array('timestamp'))) {
633 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
634 } 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'])) {
635 $cssforfield .= ($cssforfield ? ' ' : '').'right';
636 }
637 if (!empty($arrayfields['t.'.$key]['checked'])) {
638 print '<td class="liste_titre'.($cssforfield ? ' '.$cssforfield : '').($key == 'status' ? ' parentonrightofpage' : '').'">';
639 if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) {
640 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);
641 } elseif ((strpos($val['type'], 'integer:') === 0) || (strpos($val['type'], 'sellist:') === 0)) {
642 print $object->showInputField($val, $key, (isset($search[$key]) ? $search[$key] : ''), '', '', 'search_', $cssforfield.' maxwidth250', 1);
643 } elseif (preg_match('/^(date|timestamp|datetime)/', $val['type'])) {
644 print '<div class="nowrap">';
645 print $form->selectDate($search[$key.'_dtstart'] ? $search[$key.'_dtstart'] : '', "search_".$key."_dtstart", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('From'));
646 print '</div>';
647 print '<div class="nowrap">';
648 print $form->selectDate($search[$key.'_dtend'] ? $search[$key.'_dtend'] : '', "search_".$key."_dtend", 0, 0, 1, '', 1, 0, 0, '', '', '', '', 1, '', $langs->trans('to'));
649 print '</div>';
650 } elseif ($key == 'lang') {
651 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formadmin.class.php';
652 $formadmin = new FormAdmin($db);
653 print $formadmin->select_language($search[$key], 'search_lang', 0, array(), 1, 0, 0, 'minwidth100imp maxwidth125', 2);
654 } else {
655 print '<input type="text" class="flat maxwidth'.($val['type'] == 'integer' ? '50' : '75').'" name="search_'.$key.'" value="'.dol_escape_htmltag(isset($search[$key]) ? $search[$key] : '').'">';
656 }
657 print '</td>';
658 }
659}
660// Extra fields
661include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_input.tpl.php';
662
663// Fields from hook
664$parameters = array('arrayfields' => $arrayfields);
665$reshook = $hookmanager->executeHooks('printFieldListOption', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
666print $hookmanager->resPrint;
667// Action column
668if (!$conf->main_checkbox_left_column) {
669 print '<td class="liste_titre center maxwidthsearch">';
670 $searchpicto = $form->showFilterButtons();
671 print $searchpicto;
672 print '</td>';
673}
674print '</tr>'."\n";
675
676$totalarray = array();
677$totalarray['nbfield'] = 0;
678
679// Fields title label
680// --------------------------------------------------------------------
681print '<tr class="liste_titre">';
682if ($conf->main_checkbox_left_column) {
683 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
684 $totalarray['nbfield']++;
685}
686foreach ($object->fields as $key => $val) {
687 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
688 if ($key == 'status') {
689 $cssforfield .= ($cssforfield ? ' ' : '').'center';
690 } elseif (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
691 $cssforfield .= ($cssforfield ? ' ' : '').'center';
692 } elseif (in_array($val['type'], array('timestamp'))) {
693 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
694 } 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'])) {
695 $cssforfield .= ($cssforfield ? ' ' : '').'right';
696 }
697 $cssforfield = preg_replace('/small\s*/', '', $cssforfield); // the 'small' css must not be used for the title label
698 if (!empty($arrayfields['t.'.$key]['checked'])) {
699 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";
700 $totalarray['nbfield']++;
701 }
702}
703// Extra fields
704include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_title.tpl.php';
705// Hook fields
706$parameters = array('arrayfields' => $arrayfields, 'param' => $param, 'sortfield' => $sortfield, 'sortorder' => $sortorder, 'totalarray' => &$totalarray);
707$reshook = $hookmanager->executeHooks('printFieldListTitle', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
708print $hookmanager->resPrint;
709// Action column
710if (!$conf->main_checkbox_left_column) {
711 print getTitleFieldOfList(($mode != 'kanban' ? $selectedfields : ''), 0, $_SERVER["PHP_SELF"], '', '', '', '', $sortfield, $sortorder, 'center maxwidthsearch ')."\n";
712 $totalarray['nbfield']++;
713}
714print '</tr>'."\n";
715
716
717// Detect if we need a fetch on each output line
718$needToFetchEachLine = 0;
719if (isset($extrafields->attributes[$object->table_element]['computed']) && is_array($extrafields->attributes[$object->table_element]['computed']) && count($extrafields->attributes[$object->table_element]['computed']) > 0) {
720 foreach ($extrafields->attributes[$object->table_element]['computed'] as $key => $val) {
721 if (!is_null($val) && preg_match('/\$object/', $val)) {
722 $needToFetchEachLine++; // There is at least one compute field that use $object
723 }
724 }
725}
726
727
728// Loop on record
729// --------------------------------------------------------------------
730$i = 0;
731$savnbfield = $totalarray['nbfield'];
732$totalarray = array();
733$totalarray['nbfield'] = 0;
734$imaxinloop = ($limit ? min($num, $limit) : $num);
735while ($i < $imaxinloop) {
736 $obj = $db->fetch_object($resql);
737 if (empty($obj)) {
738 break; // Should not happen
739 }
740
741 // Store properties in $object
742 $object->setVarsFromFetchObj($obj);
743
744 if ($mode == 'kanban') {
745 if ($i == 0) {
746 print '<tr class="trkanban"><td colspan="'.$savnbfield.'">';
747 print '<div class="box-flex-container kanban">';
748 }
749 // TODO Use a cache for $recruitment
750 $recruitment = new RecruitmentJobPosition($db);
751 $recruitment->fetch($obj->fk_recruitmentjobposition);
752
753 $object->phone = $obj->phone;
754
755 // Output Kanban
756 $selected = -1;
757 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
758 $selected = 0;
759 if (in_array($object->id, $arrayofselected)) {
760 $selected = 1;
761 }
762 }
763 print $object->getKanbanView('', array('jobpositionlink' => $recruitment->getNomUrl(1), 'selected' => $selected));
764 if ($i == ($imaxinloop - 1)) {
765 print '</div>';
766 print '</td></tr>';
767 }
768 } else {
769 // Show here line of result
770 $j = 0;
771 print '<tr data-rowid="'.$object->id.'" class="oddeven">';
772 // Action column
773 if ($conf->main_checkbox_left_column) {
774 print '<td class="nowrap center">';
775 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
776 $selected = 0;
777 if (in_array($object->id, $arrayofselected)) {
778 $selected = 1;
779 }
780 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
781 }
782 print '</td>';
783 if (!$i) {
784 $totalarray['nbfield']++;
785 }
786 }
787 foreach ($object->fields as $key => $val) {
788 $cssforfield = (empty($val['csslist']) ? (empty($val['css']) ? '' : $val['css']) : $val['csslist']);
789 if (in_array($val['type'], array('date', 'datetime', 'timestamp'))) {
790 $cssforfield .= ($cssforfield ? ' ' : '').'center';
791 } elseif ($key == 'status') {
792 $cssforfield .= ($cssforfield ? ' ' : '').'center';
793 }
794
795 if (in_array($val['type'], array('timestamp'))) {
796 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
797 } elseif ($key == 'ref') {
798 $cssforfield .= ($cssforfield ? ' ' : '').'nowrap';
799 }
800
801 if (in_array($val['type'], array('double(24,8)', 'double(6,3)', 'integer', 'real', 'price')) && !in_array($key, array('rowid', 'status')) && empty($val['arrayofkeyval'])) {
802 $cssforfield .= ($cssforfield ? ' ' : '').'right';
803 }
804 //if (in_array($key, array('fk_soc', 'fk_user', 'fk_warehouse'))) $cssforfield = 'tdoverflowmax100';
805
806 if (!empty($arrayfields['t.'.$key]['checked'])) {
807 print '<td'.($cssforfield ? ' class="'.$cssforfield.(preg_match('/tdoverflow/', $cssforfield) ? ' classfortooltip' : '').'"' : '');
808 if (preg_match('/tdoverflow/', $cssforfield) && !is_numeric($object->$key)) {
809 print ' title="'.dol_escape_htmltag((string) $object->$key).'"';
810 }
811 print '>';
812 if ($key == 'status') {
813 print $object->getLibStatut(5);
814 } elseif ($key == 'rowid') {
815 print $object->showOutputField($val, $key, (string) $object->id, '');
816 } else {
817 print $object->showOutputField($val, $key, $object->$key, '');
818 }
819 print '</td>';
820 if (!$i) {
821 $totalarray['nbfield']++;
822 }
823 if (!empty($val['isameasure']) && $val['isameasure'] == 1) {
824 if (!$i) {
825 $totalarray['pos'][$totalarray['nbfield']] = 't.'.$key;
826 }
827 if (!isset($totalarray['val'])) {
828 $totalarray['val'] = array();
829 }
830 if (!isset($totalarray['val']['t.'.$key])) {
831 $totalarray['val']['t.'.$key] = 0;
832 }
833 $totalarray['val']['t.'.$key] += $object->$key;
834 }
835 }
836 }
837 // Extra fields
838 include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_print_fields.tpl.php';
839 // Fields from hook
840 $parameters = array('arrayfields' => $arrayfields, 'object' => $object, 'obj' => $obj, 'i' => $i, 'totalarray' => &$totalarray);
841 $reshook = $hookmanager->executeHooks('printFieldListValue', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
842 print $hookmanager->resPrint;
843 // Action column
844 if (!$conf->main_checkbox_left_column) {
845 print '<td class="nowrap center">';
846 if ($massactionbutton || $massaction) { // If we are in select mode (massactionbutton defined) or if we have already selected and sent an action ($massaction) defined
847 $selected = 0;
848 if (in_array($object->id, $arrayofselected)) {
849 $selected = 1;
850 }
851 print '<input id="cb'.$object->id.'" class="flat checkforselect" type="checkbox" name="toselect[]" value="'.$object->id.'"'.($selected ? ' checked="checked"' : '').'>';
852 }
853 print '</td>';
854 if (!$i) {
855 $totalarray['nbfield']++;
856 }
857 }
858
859 print '</tr>'."\n";
860 }
861
862 $i++;
863}
864
865// Show total line
866include DOL_DOCUMENT_ROOT.'/core/tpl/list_print_total.tpl.php';
867
868// If no record found
869if ($num == 0) {
870 $colspan = 1;
871 foreach ($arrayfields as $key => $val) {
872 if (!empty($val['checked'])) {
873 $colspan++;
874 }
875 }
876 print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
877}
878
879
880$db->free($resql);
881
882$parameters = array('arrayfields' => $arrayfields, 'sql' => $sql);
883$reshook = $hookmanager->executeHooks('printFieldListFooter', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
884print $hookmanager->resPrint;
885
886print '</table>'."\n";
887print '</div>'."\n";
888
889print '</form>'."\n";
890
891if (in_array('builddoc', array_keys($arrayofmassactions)) && ($nbtotalofrecords === '' || $nbtotalofrecords)) {
892 $hidegeneratedfilelistifempty = 1;
893 if ($massaction == 'builddoc' || $action == 'remove_file' || $show_files) {
894 $hidegeneratedfilelistifempty = 0;
895 }
896
897 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
898 $formfile = new FormFile($db);
899
900 // Show list of available documents
901 $urlsource = $_SERVER['PHP_SELF'].'?sortfield='.$sortfield.'&sortorder='.$sortorder;
902 $urlsource .= str_replace('&amp;', '&', $param);
903
904 $filedir = $diroutputmassaction;
905 $genallowed = $permissiontoread;
906 $delallowed = $permissiontoadd;
907
908 print $formfile->showdocuments('massfilesarea_recruitment', '', $filedir, $urlsource, 0, $delallowed, '', 1, 1, 0, 48, 1, $param, $title, '', '', '', null, $hidegeneratedfilelistifempty);
909}
910
911// End of page
912llxFooter();
913$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 list.php:501
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.
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $conf
The main.inc.php has been included so the following variable are now defined:
if(!isModEnabled('ai')||!getDolGlobalString('AI_ASSISTANT_ENABLED')) global $db
API class for accounts.
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)
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...
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
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.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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...
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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...
print $langs trans("Show") . '< td style="' . $timeColor . '" align="center"> s</td > badge status0 badge status4 badge status3 Error badge status8< td align="center">< span class="badge ' . $badge . '"></span ></td >< td align="center">< a href="#" class="button button-small" onclick="openLogModal(this)" data-req="' . dol_escape_htmltag($reqSafe) . '" data-res="' . dol_escape_htmltag($resSafe) . '" data-err="' . dol_escape_htmltag($errSafe) . '">< span class="fa fa-search-plus"></span ></a ></td ></tr >< tr >< td colspan="' . $colspan . '" class="opacitymedium"></td ></tr ></table ></div ></form > logModal none logModal none s a JSON string
buildzip.php
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.