26require_once
'../main.inc.php';
27require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formcompany.class.php';
28require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
29require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formprojet.class.php';
30require_once DOL_DOCUMENT_ROOT.
'/projet/class/project.class.php';
31require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
32require_once DOL_DOCUMENT_ROOT.
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php';
35$langs->loadLangs(array(
"recruitment",
"other"));
40$action =
GETPOST(
'action',
'aZ09');
41$confirm =
GETPOST(
'confirm',
'alpha');
42$cancel =
GETPOST(
'cancel',
'aZ09');
43$contextpage =
GETPOST(
'contextpage',
'aZ') ?
GETPOST(
'contextpage',
'aZ') :
'recruitmentjobpositioncard';
44$backtopage =
GETPOST(
'backtopage',
'alpha');
45$backtopageforcancel =
GETPOST(
'backtopageforcancel',
'alpha');
51$diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
52$hookmanager->initHooks(array(
'recruitmentjobpositioncard',
'globalcard'));
55$extrafields->fetch_name_optionals_label(
$object->table_element);
57$search_array_options = $extrafields->getOptionalsFromPost(
$object->table_element,
'',
'search_');
60$search_all =
GETPOST(
"search_all",
'alpha');
62foreach (
$object->fields as $key => $val) {
63 if (
GETPOST(
'search_'.$key,
'alpha')) {
64 $search[$key] =
GETPOST(
'search_'.$key,
'alpha');
68if (empty($action) && empty($id) && empty($ref)) {
73include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
76$permissiontoread = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'read');
77$permissiontoadd = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
78$permissiontodelete = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'delete') || ($permissiontoadd && isset(
$object->status) &&
$object->status == $object::STATUS_DRAFT);
79$permissionnote = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
80$permissiondellink = $user->hasRight(
'recruitment',
'recruitmentjobposition',
'write');
81$upload_dir = $conf->recruitment->multidir_output[isset(
$object->entity) ?
$object->entity : 1];
86$isdraft = ((
$object->status == $object::STATUS_DRAFT) ? 1 : 0);
87$result =
restrictedArea($user,
'recruitment',
$object->id,
'recruitment_recruitmentjobposition',
'recruitmentjobposition',
'',
'rowid', $isdraft);
95$reshook = $hookmanager->executeHooks(
'doActions', $parameters, $object, $action);
100if (empty($reshook)) {
103 $backurlforlist = DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_list.php';
105 if (empty($backtopage) || ($cancel && empty($id))) {
106 if (empty($backtopage) || ($cancel && strpos($backtopage,
'__ID__'))) {
107 if (empty($id) && (($action !=
'add' && $action !=
'create') || $cancel)) {
108 $backtopage = $backurlforlist;
110 $backtopage = DOL_URL_ROOT.
'/recruitment/recruitmentjobposition_card.php?id='.(
$id > 0 ?
$id :
'__ID__');
114 $triggermodname =
'RECRUITMENT_RECRUITMENTJOBPOSITION_MODIFY';
117 include DOL_DOCUMENT_ROOT.
'/core/actions_addupdatedelete.inc.php';
120 include DOL_DOCUMENT_ROOT.
'/core/actions_dellink.inc.php';
123 include DOL_DOCUMENT_ROOT.
'/core/actions_printing.inc.php';
129 include DOL_DOCUMENT_ROOT.
'/core/actions_builddoc.inc.php';
131 if ($action ==
'set_thirdparty' && $permissiontoadd) {
132 $object->setValueFrom(
'fk_soc',
GETPOSTINT(
'fk_soc'),
'',
null,
'date',
'', $user,
'RECRUITMENTJOBPOSITION_MODIFY');
134 if ($action ==
'classin' && $permissiontoadd) {
139 $triggersendname =
'RECRUITMENTJOBPOSITION_SENTBYMAIL';
140 $autocopy =
'MAIN_MAIL_AUTOCOPY_RECRUITMENTJOBPOSITION_TO';
141 $trackid =
'recruitmentjobposition'.$object->id;
142 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
152$form =
new Form($db);
156$title = $langs->trans(
"JobPositionApplications");
161if (
$object->id > 0 && (empty($action) || ($action !=
'edit' && $action !=
'create'))) {
162 $res =
$object->fetch_optionals();
170 if ($action ==
'delete') {
171 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'DeleteRecruitmentJobPosition'), $langs->trans(
'ConfirmDeleteObject'),
'confirm_delete',
'', 0, 1);
174 if ($action ==
'deleteline') {
175 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id.
'&lineid='.$lineid, $langs->trans(
'DeleteLine'), $langs->trans(
'ConfirmDeleteLine'),
'confirm_deleteline',
'', 0, 1);
178 if ($action ==
'clone') {
180 $formquestion = array();
181 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'ToClone'), $langs->trans(
'ConfirmCloneAsk',
$object->ref),
'confirm_clone', $formquestion,
'yes', 1);
185 if ($action ==
'xxx') {
186 $formquestion = array();
197 $formconfirm = $form->formconfirm($_SERVER[
"PHP_SELF"].
'?id='.
$object->id, $langs->trans(
'XXX'), $text,
'confirm_xxx', $formquestion, 0, 1, 220);
201 $parameters = array(
'formConfirm' => $formconfirm,
'lineid' => $lineid);
202 $reshook = $hookmanager->executeHooks(
'formConfirm', $parameters, $object, $action);
203 if (empty($reshook)) {
204 $formconfirm .= $hookmanager->resPrint;
205 } elseif ($reshook > 0) {
206 $formconfirm = $hookmanager->resPrint;
215 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
217 $morehtmlref =
'<div class="refidno">';
226 if (isModEnabled(
'project')) {
227 $langs->load(
"projects");
228 $morehtmlref .= $langs->trans(
'Project').
' ';
229 if ($permissiontoadd) {
230 if ($action !=
'classify') {
231 $morehtmlref .=
'<a class="editfielda" href="'.$_SERVER[
'PHP_SELF'].
'?action=classify&token='.
newToken().
'&id='.
$object->id.
'">'.
img_edit($langs->transnoentitiesnoconv(
'SetProject')).
'</a>';
233 $morehtmlref .=
' : ';
234 if ($action ==
'classify') {
236 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.
$object->id.
'">';
237 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
238 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
239 $morehtmlref .= $formproject->select_projects(
$object->socid,
$object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
240 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
241 $morehtmlref .=
'</form>';
243 $morehtmlref .= $form->form_project($_SERVER[
'PHP_SELF'].
'?id='.
$object->id,
$object->socid,
$object->fk_project,
'none', 0, 0, 0, 1,
'',
'maxwidth300');
246 if (!empty(
$object->fk_project)) {
248 $proj->fetch(
$object->fk_project);
249 $morehtmlref .=
': '.$proj->getNomUrl();
255 $morehtmlref .=
'</div>';
258 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
261 print
'<div class="fichecenter">';
262 print
'<div class="fichehalfleft">';
263 print
'<div class="underbanner clearboth"></div>';
264 print
'<table class="border centpercent tableforfield">'.
"\n";
267 $keyforbreak =
'description';
268 unset(
$object->fields[
'fk_project']);
270 include DOL_DOCUMENT_ROOT.
'/core/tpl/commonfields_view.tpl.php';
273 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_view.tpl.php';
279 print
'<div class="clearboth"></div>';
283 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($head='', $title='', $help_url='', $target='', $disablejs=0, $disablehead=0, $arrayofjs='', $arrayofcss='', $morequerystring='', $morecssonbody='', $replacemainareaby='', $disablenofollow=0, $disablenoindex=0)
Empty header.
Class to manage projects.
Class for RecruitmentJobPosition.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
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.
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.