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