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