47 if (!$res && !empty($_SERVER[
"CONTEXT_DOCUMENT_ROOT"])) {
48 $res = @include $_SERVER[
"CONTEXT_DOCUMENT_ROOT"].
"/main.inc.php";
51 $tmp = empty($_SERVER[
'SCRIPT_FILENAME']) ?
'' : $_SERVER[
'SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
52 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) {
55 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) {
56 $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
58 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php")) {
59 $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php";
62 if (!$res && file_exists(
"../main.inc.php")) {
63 $res = @include
"../main.inc.php";
65 if (!$res && file_exists(
"../../main.inc.php")) {
66 $res = @include
"../../main.inc.php";
68 if (!$res && file_exists(
"../../../main.inc.php")) {
69 $res = @include
"../../../main.inc.php";
72 die(
"Include of main fails");
75 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
76 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
77 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
78 require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
80 dol_include_once(
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php');
83 $langs->loadLangs(array(
"recruitment",
"other"));
88 $action =
GETPOST(
'action',
'aZ09');
89 $confirm =
GETPOST(
'confirm',
'alpha');
90 $cancel =
GETPOST(
'cancel',
'aZ09');
91 $contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'recruitmentjobpositioncard';
92 $backtopage =
GETPOST(
'backtopage',
'alpha');
93 $backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
99 $diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
100 $hookmanager->initHooks(array(
'recruitmentjobpositioncard',
'globalcard'));
103 $extrafields->fetch_name_optionals_label($object->table_element);
105 $search_array_options = $extrafields->getOptionalsFromPost($object->table_element,
'',
'search_');
108 $search_all =
GETPOST(
"search_all",
'alpha');
110 foreach ($object->fields as $key => $val) {
111 if (
GETPOST(
'search_'.$key,
'alpha')) {
112 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
116 if (empty($action) && empty($id) && empty($ref)) {
121 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
124 $permissiontoread = $user->rights->recruitment->recruitmentjobposition->read;
125 $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write;
126 $permissiontodelete = $user->rights->recruitment->recruitmentjobposition->delete || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT);
127 $permissionnote = $user->rights->recruitment->recruitmentjobposition->write;
128 $permissiondellink = $user->rights->recruitment->recruitmentjobposition->write;
129 $upload_dir = $conf->recruitment->multidir_output[isset($object->entity) ? $object->entity : 1];
134 $isdraft = (($object->status == $object::STATUS_DRAFT) ? 1 : 0);
135 $result =
restrictedArea($user,
'recruitment', $object->id,
'recruitment_recruitmentjobposition',
'recruitmentjobposition',
'',
'rowid', $isdraft);
142 $parameters = array();
143 $reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
148 if (empty($reshook)) {
151 $backurlforlist = DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_list.php';
153 if (empty($backtopage) || ($cancel && empty($id))) {
154 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
155 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
156 $backtopage = $backurlforlist;
158 $backtopage = DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_card.php?id='.($id > 0 ? $id :
'__ID__');
162 $triggermodname =
'RECRUITMENT_RECRUITMENTJOBPOSITION_MODIFY';
165 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
168 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
171 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
177 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
179 if ($action ==
'set_thirdparty' && $permissiontoadd) {
180 $object->setValueFrom(
'fk_soc',
GETPOST(
'fk_soc',
'int'),
'',
'',
'date',
'', $user,
'RECRUITMENTJOBPOSITION_MODIFY');
182 if ($action ==
'classin' && $permissiontoadd) {
183 $object->setProject(
GETPOST(
'projectid',
'int'));
187 $triggersendname =
'RECRUITMENTJOBPOSITION_SENTBYMAIL';
188 $autocopy =
'MAIN_MAIL_AUTOCOPY_RECRUITMENTJOBPOSITION_TO';
189 $trackid =
'recruitmentjobposition'.$object->id;
190 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
204 $title = $langs->trans(
"JobPositionApplications");
209 if ($object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
210 $res = $object->fetch_optionals();
213 print
dol_get_fiche_head($head,
'candidatures', $langs->trans(
"RecruitmentCandidatures"), -1, $object->picto);
218 if ($action ==
'delete') {
219 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'DeleteRecruitmentJobPosition'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
222 if ($action ==
'deleteline') {
223 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
226 if ($action ==
'clone') {
228 $formquestion = array();
229 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk', $object->ref),
'confirm_clone', $formquestion,
'yes', 1);
233 if ($action ==
'xxx') {
234 $formquestion = array();
245 $formconfirm =
$form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.$object->id, $langs->trans(
'XXX'), $text,
'confirm_xxx', $formquestion, 0, 1, 220);
249 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
250 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
251 if (empty($reshook)) {
252 $formconfirm .= $hookmanager->resPrint;
253 } elseif ($reshook > 0) {
254 $formconfirm = $hookmanager->resPrint;
263 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
265 $morehtmlref =
'<div class="refidno">';
274 if (!empty($conf->project->enabled)) {
275 $langs->load(
"projects");
276 $morehtmlref .= $langs->trans(
'Project').
' ';
277 if ($permissiontoadd) {
278 if ($action !=
'classify') {
279 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
281 $morehtmlref .=
' : ';
282 if ($action ==
'classify') {
284 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
285 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
286 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
287 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
288 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
289 $morehtmlref .=
'</form>';
291 $morehtmlref .=
$form->form_project($_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
294 if (!empty($object->fk_project)) {
296 $proj->fetch($object->fk_project);
297 $morehtmlref .=
': '.$proj->getNomUrl();
303 $morehtmlref .=
'</div>';
306 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
309 print
'<div class="fichecenter">';
310 print
'<div class="fichehalfleft">';
311 print
'<div class="underbanner clearboth"></div>';
312 print
'<table class="border centpercent tableforfield">'.
"\n";
315 $keyforbreak =
'description';
316 unset($object->fields[
'fk_project']);
318 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
321 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
327 print
'<div class="clearboth"></div>';
331 print
'<br>'.$langs->trans(
"FeatureNotYetAvailable");
if(!function_exists('dol_getprefix')) dol_include_once($relpath, $classname= '')
Make an include_once using default root and alternate root if it fails.
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
img_edit($titlealt= 'default', $float=0, $other= '')
Show logo editer/modifier fiche.
if($cancel &&!$id) if($action== 'add'&&!$cancel) if($action== 'delete') if($id) $form
Actions.
if(!defined('NOREQUIRESOC')) if(!defined('NOREQUIRETRAN')) if(!defined('NOCSRFCHECK')) if(!defined('NOTOKENRENEWAL')) if(!defined('NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined('NOREQUIREAJAX')) llxHeader()
Empty header.
recruitmentjobpositionPrepareHead($object)
Prepare array of tabs for RecruitmentJobPosition.
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.
setEventMessages($mesg, $mesgs, $style= 'mesgs', $messagekey= '')
Set event messages in dol_events session object.
Class to manage projects.
Class for RecruitmentJobPosition.
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.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
newToken()
Return the value of token currently saved into session with name 'newtoken'.
dol_get_fiche_end($notab=0)
Return tab footer of a card.
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.
$formconfirm
if ($action == 'delbookkeepingyear') {