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