25require_once
'../main.inc.php';
26require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
34$langs->loadLangs(array(
"recruitment",
"other"));
39$action =
GETPOST(
'action',
'aZ09');
40$confirm =
GETPOST(
'confirm',
'alpha');
41$cancel =
GETPOST(
'cancel',
'aZ09');
42$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'recruitmentjobpositioncard';
43$backtopage =
GETPOST(
'backtopage',
'alpha');
44$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
50$diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
51$hookmanager->initHooks(array(
'recruitmentjobpositioncard',
'globalcard'));
54$extrafields->fetch_name_optionals_label(
$object->table_element);
56$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
59$search_all =
GETPOST(
"search_all",
'alpha');
61foreach (
$object->fields as $key => $val) {
62 if (
GETPOST(
'search_'.$key,
'alpha')) {
63 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
67if (empty($action) && empty($id) && empty($ref)) {
72include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
75$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
76$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
77$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
78$permissionnote = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
79$permissiondellink = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
80$upload_dir = $conf->recruitment->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
85$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
86$result =
restrictedArea($user,
'recruitment',
$object->id,
'recruitment_recruitmentjobposition',
'recruitmentjobposition',
'',
'rowid', $isdraft);
94$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
102 $backurlforlist = DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_list.php';
104 if (empty($backtopage) || ($cancel && empty($id))) {
105 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
106 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
107 $backtopage = $backurlforlist;
109 $backtopage = DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_card.php?id='.($id > 0 ? $id :
'__ID__');
113 $triggermodname =
'RECRUITMENT_RECRUITMENTJOBPOSITION_MODIFY';
116 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
119 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
122 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
128 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
130 if ($action ==
'set_thirdparty' && $permissiontoadd) {
131 $object->setValueFrom(
'fk_soc',
GETPOSTINT(
'fk_soc'),
'',
'',
'date',
'', $user,
'RECRUITMENTJOBPOSITION_MODIFY');
133 if ($action ==
'classin' && $permissiontoadd) {
138 $triggersendname =
'RECRUITMENTJOBPOSITION_SENTBYMAIL';
139 $autocopy =
'MAIN_MAIL_AUTOCOPY_RECRUITMENTJOBPOSITION_TO';
140 $trackid =
'recruitmentjobposition'.$object->id;
141 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
151$form =
new Form($db);
155$title = $langs->trans(
"JobPositionApplications");
160if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
161 $res =
$object->fetch_optionals();
169 if ($action ==
'delete') {
170 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteRecruitmentJobPosition'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
173 if ($action ==
'deleteline') {
174 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
177 if ($action ==
'clone') {
179 $formquestion = array();
180 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
184 if ($action ==
'xxx') {
185 $formquestion = array();
196 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'XXX'), $text,
'confirm_xxx', $formquestion, 0, 1, 220);
200 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
201 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
202 if (empty($reshook)) {
203 $formconfirm .= $hookmanager->resPrint;
204 } elseif ($reshook > 0) {
205 $formconfirm = $hookmanager->resPrint;
214 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
216 $morehtmlref =
'<div class="refidno">';
225 if (isModEnabled(
'project')) {
226 $langs->load(
"projects");
227 $morehtmlref .= $langs->trans(
'Project').
' ';
228 if ($permissiontoadd) {
229 if ($action !=
'classify') {
230 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
232 $morehtmlref .=
' : ';
233 if ($action ==
'classify') {
235 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
236 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
237 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
238 $morehtmlref .= $formproject->select_projects(
$object->socid,
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
239 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
240 $morehtmlref .=
'</form>';
242 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
245 if (!empty(
$object->fk_project)) {
247 $proj->fetch(
$object->fk_project);
248 $morehtmlref .=
': '.$proj->getNomUrl();
254 $morehtmlref .=
'</div>';
257 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
260 print
'<div class="fichecenter">';
261 print
'<div class="fichehalfleft">';
262 print
'<div class="underbanner clearboth"></div>';
263 print
'<table class="border centpercent tableforfield">'.
"\n";
266 $keyforbreak =
'description';
267 unset(
$object->fields[
'fk_project']);
269 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
272 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
278 print
'<div class="clearboth"></div>';
282 print
'<br>'.$langs->trans(
"FeatureNotYetAvailable");
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Class to manage projects.
Class for RecruitmentJobPosition.
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.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0)
Set event messages in dol_events session object.
img_edit($titlealt='default', $float=0, $other='')
Show logo edit/modify fiche.
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.