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