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