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