dolibarr  17.0.4
recruitmentjobposition_card.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 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.'/core/class/html.formcompany.class.php';
27 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/class/html.formprojet.class.php';
29 require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
30 require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
31 require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
32 
33 // Load translation files required by the page
34 $langs->loadLangs(array("recruitment", "other"));
35 
36 // Get parameters
37 $id = GETPOST('id', 'int');
38 $ref = GETPOST('ref', 'alpha');
39 $action = GETPOST('action', 'aZ09');
40 $confirm = GETPOST('confirm', 'alpha');
41 $cancel = GETPOST('cancel', 'aZ09');
42 $contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'recruitmentjobpositioncard'; // To manage different context of search
43 $backtopage = GETPOST('backtopage', 'alpha');
44 $backtopageforcancel = GETPOST('backtopageforcancel', 'alpha');
45 $lineid = GETPOST('lineid', 'int');
46 
47 // Initialize technical objects
48 $object = new RecruitmentJobPosition($db);
49 $extrafields = new ExtraFields($db);
50 $diroutputmassaction = $conf->recruitment->dir_output.'/temp/massgeneration/'.$user->id;
51 $hookmanager->initHooks(array('recruitmentjobpositioncard', 'globalcard')); // Note that conf->hooks_modules contains array
52 
53 // Fetch optionals attributes and labels
54 $extrafields->fetch_name_optionals_label($object->table_element);
55 
56 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
57 
58 // Initialize array of search criterias
59 $search_all = GETPOST("search_all", 'alpha');
60 $search = array();
61 foreach ($object->fields as $key => $val) {
62  if (GETPOST('search_'.$key, 'alpha')) {
63  $search[$key] = GETPOST('search_'.$key, 'alpha');
64  }
65 }
66 
67 if (empty($action) && empty($id) && empty($ref)) {
68  $action = 'create';
69 }
70 
71 // Load object
72 include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
73 
74 
75 $permissiontoread = $user->rights->recruitment->recruitmentjobposition->read;
76 $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php
77 $permissiontodelete = $user->rights->recruitment->recruitmentjobposition->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
78 $permissionnote = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_setnotes.inc.php
79 $permissiondellink = $user->rights->recruitment->recruitmentjobposition->write; // Used by the include of actions_dellink.inc.php
80 $upload_dir = $conf->recruitment->multidir_output[isset($object->entity) ? $object->entity : 1];
81 
82 $usercanclose = $permissiontoadd;
83 
84 // Security check - Protection if external user
85 //if ($user->socid > 0) accessforbidden();
86 //if ($user->socid > 0) $socid = $user->socid;
87 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
88 $result = restrictedArea($user, 'recruitment', $object->id, 'recruitment_recruitmentjobposition', 'recruitmentjobposition', '', 'rowid', $isdraft);
89 
90 
91 /*
92  * Actions
93  */
94 
95 $parameters = array();
96 $reshook = $hookmanager->executeHooks('doActions', $parameters, $object, $action); // Note that $action and $object may have been modified by some hooks
97 if ($reshook < 0) {
98  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
99 }
100 
101 if (empty($reshook)) {
102  $error = 0;
103 
104  $backurlforlist = dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1);
105 
106  if (empty($backtopage) || ($cancel && empty($id))) {
107  if (empty($backtopage) || ($cancel && strpos($backtopage, '__ID__'))) {
108  if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
109  $backtopage = $backurlforlist;
110  } else {
111  $backtopage = dol_buildpath('/recruitment/recruitmentjobposition_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
112  }
113  }
114  }
115  $triggermodname = 'RECRUITMENT_RECRUITMENTJOBPOSITION_MODIFY'; // Name of trigger action code to execute when we modify record
116 
117  // Actions cancel, add, update, update_extras, confirm_validate, confirm_delete, confirm_deleteline, confirm_clone, confirm_close, confirm_setdraft, confirm_reopen
118  include DOL_DOCUMENT_ROOT.'/core/actions_addupdatedelete.inc.php';
119 
120  // Actions when linking object each other
121  include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
122 
123  // Actions when printing a doc from card
124  include DOL_DOCUMENT_ROOT.'/core/actions_printing.inc.php';
125 
126  // Action to move up and down lines of object
127  //include DOL_DOCUMENT_ROOT.'/core/actions_lineupdown.inc.php';
128 
129  // Action to build doc
130  include DOL_DOCUMENT_ROOT.'/core/actions_builddoc.inc.php';
131 
132  if ($action == 'set_thirdparty' && $permissiontoadd) {
133  $object->setValueFrom('fk_soc', GETPOST('fk_soc', 'int'), '', '', 'date', '', $user, 'RECRUITMENTJOBPOSITION_MODIFY');
134  }
135  if ($action == 'classin' && $permissiontoadd) {
136  $object->setProject(GETPOST('projectid', 'int'));
137  }
138  if ($action == 'confirm_closeas' && $usercanclose && !GETPOST('cancel', 'alpha')) {
139  if (!(GETPOST('status', 'int') > 0)) {
140  setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CloseAs")), null, 'errors');
141  $action = 'closeas';
142  } else {
143  // prevent browser refresh from closing proposal several times
144  if ($object->status == $object::STATUS_VALIDATED) {
145  $db->begin();
146 
147  $result = $object->cloture($user, GETPOST('status', 'int'), GETPOST('note_private', 'restricthtml'));
148  if ($result < 0) {
149  setEventMessages($object->error, $object->errors, 'errors');
150  $error++;
151  }
152 
153  if (!$error) {
154  $db->commit();
155  } else {
156  $db->rollback();
157  }
158  }
159  }
160  }
161 
162  // Actions to send emails
163  $triggersendname = 'RECRUITMENTJOBPOSITION_SENTBYMAIL';
164  $autocopy = 'MAIN_MAIL_AUTOCOPY_RECRUITMENTJOBPOSITION_TO';
165  $trackid = 'recruitmentjobposition'.$object->id;
166  include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
167 }
168 
169 
170 
171 
172 /*
173  * View
174  */
175 
176 $form = new Form($db);
177 $formfile = new FormFile($db);
178 $formproject = new FormProjets($db);
179 
180 $title = $object->ref." - ".$langs->trans('Card');
181 $help_url = '';
182 llxHeader('', $title, $help_url);
183 
184 // Part to create
185 if ($action == 'create') {
186  print load_fiche_titre($langs->trans("NewPositionToBeFilled"), '', 'object_'.$object->picto);
187 
188  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
189  print '<input type="hidden" name="token" value="'.newToken().'">';
190  print '<input type="hidden" name="action" value="add">';
191  if ($backtopage) {
192  print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
193  }
194  if ($backtopageforcancel) {
195  print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
196  }
197 
198  // Set some default values
199  if (!GETPOSTISSET('fk_user_recruiter')) {
200  $_POST['fk_user_recruiter'] = $user->id;
201  }
202 
203  print dol_get_fiche_head(array(), '');
204 
205  print '<table class="border centpercent tableforfieldcreate">'."\n";
206 
207  // Common attributes
208  include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_add.tpl.php';
209 
210  // Other attributes
211  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php';
212 
213  print '</table>'."\n";
214 
215  print dol_get_fiche_end();
216 
217  print $form->buttonsSaveCancel("Create");
218 
219  print '</form>';
220 
221  //dol_set_focus('input[name="ref"]');
222 }
223 
224 // Part to edit record
225 if (($id || $ref) && $action == 'edit') {
226  print load_fiche_titre($langs->trans("PositionToBeFilled"), '', 'object_'.$object->picto);
227 
228  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].'">';
229  print '<input type="hidden" name="token" value="'.newToken().'">';
230  print '<input type="hidden" name="action" value="update">';
231  print '<input type="hidden" name="id" value="'.$object->id.'">';
232  if ($backtopage) {
233  print '<input type="hidden" name="backtopage" value="'.$backtopage.'">';
234  }
235  if ($backtopageforcancel) {
236  print '<input type="hidden" name="backtopageforcancel" value="'.$backtopageforcancel.'">';
237  }
238 
239  print dol_get_fiche_head();
240 
241  print '<table class="border centpercent tableforfieldedit">'."\n";
242 
243  // Common attributes
244  include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_edit.tpl.php';
245 
246  // Other attributes
247  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_edit.tpl.php';
248 
249  print '</table>';
250 
251  print dol_get_fiche_end();
252 
253  print $form->buttonsSaveCancel();
254 
255  print '</form>';
256 }
257 
258 // Part to show record
259 if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
260  $res = $object->fetch_optionals();
261 
262  $head = recruitmentjobpositionPrepareHead($object);
263  print dol_get_fiche_head($head, 'card', $langs->trans("RecruitmentJobPosition"), -1, $object->picto);
264 
265  $formconfirm = '';
266 
267  // Confirmation to delete
268  if ($action == 'delete') {
269  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('DeleteRecruitmentJobPosition'), $langs->trans('ConfirmDeleteObject'), 'confirm_delete', '', 0, 1);
270  }
271  // Confirmation to delete line
272  if ($action == 'deleteline') {
273  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id.'&lineid='.$lineid, $langs->trans('DeleteLine'), $langs->trans('ConfirmDeleteLine'), 'confirm_deleteline', '', 0, 1);
274  }
275  // Clone confirmation
276  if ($action == 'clone') {
277  // Create an array for form
278  $formquestion = array();
279  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('ToClone'), $langs->trans('ConfirmCloneAsk', $object->ref), 'confirm_clone', $formquestion, 'yes', 1);
280  }
281  if ($action == 'closeas') {
282  $text = "";
283  //Form to close proposal (signed or not)
284  $formquestion = array(
285  array('type' => 'select', 'name' => 'status', 'label' => '<span class="fieldrequired">'.$langs->trans("CloseAs").'</span>', 'values' => array(3=>$object->LibStatut($object::STATUS_RECRUITED), 9=>$object->LibStatut($object::STATUS_CANCELED))),
286  array('type' => 'text', 'name' => 'note_private', 'label' => $langs->trans("Note"), 'value' => '') // Field to complete private note (not replace)
287  );
288 
289  /*if (isModEnabled('notification'))
290  {
291  require_once DOL_DOCUMENT_ROOT.'/core/class/notify.class.php';
292  $notify = new Notify($db);
293  $formquestion = array_merge($formquestion, array(
294  array('type' => 'onecolumn', 'value' => $notify->confirmMessage('RECRUITMENTJOBPOSITION_CLOSE_SIGNED', $object->socid, $object)),
295  ));
296  }*/
297 
298  $formconfirm = $form->formconfirm($_SERVER["PHP_SELF"].'?id='.$object->id, $langs->trans('Close'), $text, 'confirm_closeas', $formquestion, '', 1, 250);
299  }
300 
301  // Call Hook formConfirm
302  $parameters = array('formConfirm' => $formconfirm, 'lineid' => $lineid);
303  $reshook = $hookmanager->executeHooks('formConfirm', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
304  if (empty($reshook)) {
305  $formconfirm .= $hookmanager->resPrint;
306  } elseif ($reshook > 0) {
307  $formconfirm = $hookmanager->resPrint;
308  }
309 
310  // Print form confirm
311  print $formconfirm;
312 
313 
314  // Object card
315  // ------------------------------------------------------------
316  $linkback = '<a href="'.dol_buildpath('/recruitment/recruitmentjobposition_list.php', 1).'?restore_lastsearch_values=1'.(!empty($socid) ? '&socid='.$socid : '').'">'.$langs->trans("BackToList").'</a>';
317 
318  $morehtmlref = '<div class="refidno">';
319  /*
320  // Ref customer
321  $morehtmlref.=$form->editfieldkey("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', 0, 1);
322  $morehtmlref.=$form->editfieldval("RefCustomer", 'ref_client', $object->ref_client, $object, 0, 'string', '', null, null, '', 1);
323  // Thirdparty
324  $morehtmlref.='<br>'.$langs->trans('ThirdParty') . ' : ' . (is_object($object->thirdparty) ? $object->thirdparty->getNomUrl(1) : '');
325  */
326  // Project
327  if (!empty($conf->project->enabled)) {
328  $langs->load("projects");
329  $morehtmlref .= $langs->trans('Project').' ';
330  if ($permissiontoadd) {
331  if ($action != 'classify') {
332  $morehtmlref .= '<a class="editfielda" href="'.$_SERVER['PHP_SELF'].'?action=classify&token='.newToken().'&id='.$object->id.'">'.img_edit($langs->transnoentitiesnoconv('SetProject')).'</a>';
333  }
334  $morehtmlref .= ' : ';
335  if ($action == 'classify') {
336  //$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
337  $morehtmlref .= '<form method="post" action="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'">';
338  $morehtmlref .= '<input type="hidden" name="action" value="classin">';
339  $morehtmlref .= '<input type="hidden" name="token" value="'.newToken().'">';
340  $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project, 'projectid', $maxlength, 0, 1, 0, 1, 0, 0, '', 1);
341  $morehtmlref .= '<input type="submit" class="button valignmiddle" value="'.$langs->trans("Modify").'">';
342  $morehtmlref .= '</form>';
343  } else {
344  $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');
345  }
346  } else {
347  if (!empty($object->fk_project)) {
348  $proj = new Project($db);
349  $proj->fetch($object->fk_project);
350  $morehtmlref .= ': '.$proj->getNomUrl();
351  } else {
352  $morehtmlref .= '';
353  }
354  }
355  }
356  $morehtmlref .= '</div>';
357 
358 
359  dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
360 
361 
362  print '<div class="fichecenter">';
363  print '<div class="fichehalfleft">';
364  print '<div class="underbanner clearboth"></div>';
365  print '<table class="border centpercent tableforfield">'."\n";
366 
367  // Common attributes
368  $keyforbreak = 'description'; // We change column just after this field
369  unset($object->fields['fk_project']); // Hide field already shown in banner
370  //unset($object->fields['fk_soc']); // Hide field already shown in banner
371  include DOL_DOCUMENT_ROOT.'/core/tpl/commonfields_view.tpl.php';
372 
373  // Other attributes. Fields from hook formObjectOptions and Extrafields.
374  include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_view.tpl.php';
375 
376  print '</table>';
377  print '</div>';
378  print '</div>';
379 
380  print '<div class="clearboth"></div>';
381 
382  print dol_get_fiche_end();
383 
384 
385  // Buttons for actions
386 
387  if ($action != 'presend' && $action != 'editline') {
388  print '<div class="tabsAction">'."\n";
389  $parameters = array();
390  $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook
391  if ($reshook < 0) {
392  setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
393  }
394 
395  if (empty($reshook)) {
396  // Send
397  if (empty($user->socid)) {
398  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').'</a>'."\n";
399  }
400 
401  // Back to draft
402  if ($object->status == $object::STATUS_VALIDATED) {
403  if ($permissiontoadd) {
404  print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_setdraft&token='.newToken().'&confirm=yes">'.$langs->trans("SetToDraft").'</a>';
405  }
406  }
407 
408  // Modify
409  if ($permissiontoadd) {
410  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").'</a>'."\n";
411  } else {
412  print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Modify').'</a>'."\n";
413  }
414 
415  // Validate
416  if ($object->status == $object::STATUS_DRAFT) {
417  if ($permissiontoadd) {
418  if (empty($object->table_element_line) || (is_array($object->lines) && count($object->lines) > 0)) {
419  print '<a class="butAction" href="'.$_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&token='.newToken().'&confirm=yes">'.$langs->trans("Validate").'</a>';
420  } else {
421  $langs->load("errors");
422  print '<a class="butActionRefused" href="" title="'.$langs->trans("ErrorAddAtLeastOneLineFirst").'">'.$langs->trans("Validate").'</a>';
423  }
424  }
425  }
426 
427  // Close as recruited/canceled
428  if ($object->status == $object::STATUS_VALIDATED) {
429  if ($usercanclose) {
430  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=closeas&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
431  print '>'.$langs->trans('Close').'</a>';
432  } else {
433  print '<a class="butActionRefused classfortooltip" href="#" title="'.dol_escape_htmltag($langs->trans("NotEnoughPermissions")).'">'.$langs->trans('Close').'</a>';
434  }
435  }
436 
437  // Clone
438  if ($permissiontoadd) {
439  print dolGetButtonAction($langs->trans("ToClone"), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.(!empty($object->socid) ? '&socid='.$object->socid : "").'&action=clone&object=recruitmentjobposition', 'clone', $permissiontoadd);
440  }
441 
442  /*
443  if ($permissiontoadd) {
444  if ($object->status == $object::STATUS_ENABLED) {
445  print '<a class="butActionDelete" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=disable&token='.newToken().'">'.$langs->trans("Disable").'</a>'."\n";
446  } else {
447  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=enable&token='.newToken().'">'.$langs->trans("Enable").'</a>'."\n";
448  }
449  }*/
450  if ($permissiontoadd) {
451  if ($object->status == $object::STATUS_CANCELED) {
452  print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?id='.$object->id.'&action=confirm_reopen&confirm=yes">'.$langs->trans("Re-Open").'</a>'."\n";
453  }
454  }
455 
456  // Delete
457  print dolGetButtonAction($langs->trans("Delete"), '', 'delete', $_SERVER["PHP_SELF"].'?id='.$object->id.'&action=delete&token='.newToken(), 'delete', $permissiontodelete);
458  }
459  print '</div>'."\n";
460  }
461 
462 
463  // Select mail models is same action as presend
464  if (GETPOST('modelselected')) {
465  $action = 'presend';
466  }
467 
468  if ($action != 'presend') {
469  print '<div class="fichecenter"><div class="fichehalfleft">';
470  print '<a name="builddoc"></a>'; // ancre
471 
472  $includedocgeneration = 1;
473 
474  // Documents
475  if ($includedocgeneration) {
476  $objref = dol_sanitizeFileName($object->ref);
477  $relativepath = $objref.'/'.$objref.'.pdf';
478  $filedir = $conf->recruitment->dir_output.'/'.$object->element.'/'.$objref;
479  $urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
480  $genallowed = $user->rights->recruitment->recruitmentjobposition->read; // If you can read, you can build the PDF to read content
481  $delallowed = $user->rights->recruitment->recruitmentjobposition->write; // If you can create/edit, you can remove a file on card
482  print $formfile->showdocuments('recruitment:RecruitmentJobPosition', $object->element.'/'.$objref, $filedir, $urlsource, $genallowed, $delallowed, $object->model_pdf, 1, 0, 0, 28, 0, '', '', '', $langs->defaultlang);
483  }
484 
485  // Show links to link elements
486  $linktoelem = $form->showLinkToObjectBlock($object, null, array('recruitmentjobposition'));
487  $somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
488 
489  // Show link to public job page
490  if ($object->status != RecruitmentJobPosition::STATUS_DRAFT) {
491  print '<br><!-- Link to go on public job page -->'."\n";
492  // Load translation files required by the page
493  $langs->loadLangs(array('recruitment'));
494 
495  $out = img_picto('', 'globe').' <span class="opacitymedium">'.$langs->trans("PublicUrl").'</span><br>';
496 
497  $url = getPublicJobPositionUrl(0, $object->ref);
498  $out .= '<div class="urllink"><input type="text" id="recruitmentjobpositionurl" class="quatrevingtpercent" value="'.$url.'">';
499  $out .= '<a href="'.$url.'" target="_blank" rel="noopener noreferrer">'.img_picto('', 'globe').'</a></div>';
500  $out .= ajax_autoselect("recruitmentjobpositionurl", 0);
501 
502  print $out;
503  }
504 
505  print '</div><div class="fichehalfright">';
506 
507  $MAXEVENT = 10;
508 
509  $morehtmlcenter = dolGetButtonTitle($langs->trans('SeeAll'), '', 'fa fa-bars imgforviewmode', DOL_URL_ROOT.'/recruitment/recruitmentjobposition_agenda.php?id='.$object->id);
510 
511  // List of actions on element
512  include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
513  $formactions = new FormActions($db);
514  $somethingshown = $formactions->showactions($object, $object->element.'@recruitment', (is_object($object->thirdparty) ? $object->thirdparty->id : 0), 1, '', $MAXEVENT, '', $morehtmlcenter);
515 
516  print '</div></div>';
517  }
518 
519  //Select mail models is same action as presend
520  if (GETPOST('modelselected')) {
521  $action = 'presend';
522  }
523 
524  // Presend form
525  $modelmail = 'recruitmentjobposition';
526  $defaulttopic = 'InformationMessage';
527  $diroutput = $conf->recruitment->dir_output;
528  $trackid = 'recruitmentjobposition'.$object->id;
529 
530  include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
531 }
532 
533 // End of page
534 llxFooter();
535 $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(preg_match('/set_([a-z0-9_\-]+)/i', $action, $reg)) if(preg_match('/del_([a-z0-9_\-]+)/i', $action, $reg)) if($action=='set') elseif($action=='specimen') elseif($action=='setmodel') elseif($action=='del') elseif($action=='setdoc') $formactions
View.
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 manage building of HTML components.
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 building of HTML components.
Class to manage projects.
Class for RecruitmentJobPosition.
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.
load_fiche_titre($titre, $morehtmlright='', $picto='generic', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
dolGetButtonTitle($label, $helpText='', $iconClass='fa fa-file', $url='', $id='', $status=1, $params=array())
Function dolGetButtonTitle : this kind of buttons are used in title in list.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
ajax_autoselect($htmlname, $addlink='', $textonlink='Link')
Make content of an input box selected when we click into input field.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dolGetButtonAction($label, $text='', $actionType='default', $url='', $id='', $userRight=1, $params=array())
Function dolGetButtonAction.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_sanitizeFileName($str, $newstr='_', $unaccent=1)
Clean a string to use it as a file name.
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') {
getPublicJobPositionUrl($mode, $ref='', $localorexternal=0)
Return string with full Url.
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.