28 if (!$res && !empty(
$_SERVER[
"CONTEXT_DOCUMENT_ROOT"])) $res = @include
$_SERVER[
"CONTEXT_DOCUMENT_ROOT"].
"/main.inc.php";
30 $tmp = empty(
$_SERVER[
'SCRIPT_FILENAME']) ?
'' :
$_SERVER[
'SCRIPT_FILENAME']; $tmp2 = realpath(__FILE__); $i = strlen($tmp) - 1; $j = strlen($tmp2) - 1;
31 while ($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i] == $tmp2[$j]) { $i--; $j--; }
32 if (!$res && $i > 0 && file_exists(substr($tmp, 0, ($i + 1)).
"/main.inc.php")) $res = @include substr($tmp, 0, ($i + 1)).
"/main.inc.php";
33 if (!$res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php")) $res = @include dirname(substr($tmp, 0, ($i + 1))).
"/main.inc.php";
35 if (!$res && file_exists(
"../main.inc.php")) $res = @include
"../main.inc.php";
36 if (!$res && file_exists(
"../../main.inc.php")) $res = @include
"../../main.inc.php";
37 if (!$res && file_exists(
"../../../main.inc.php")) $res = @include
"../../../main.inc.php";
38 if (!$res) die(
"Include of main fails");
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/lib/files.lib.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/lib/images.lib.php';
43 require_once DOL_DOCUMENT_ROOT.
'/core/class/html.formfile.class.php';
45 dol_include_once(
'/recruitment/lib/recruitment_recruitmentjobposition.lib.php');
48 $langs->loadLangs(array(
"recruitment",
"companies",
"other",
"mails"));
51 $action =
GETPOST(
'action',
'aZ09');
57 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
58 $sortfield =
GETPOST(
"sortfield",
'alpha');
59 $sortorder =
GETPOST(
"sortorder",
'alpha');
61 if (empty($page) || $page == -1) { $page = 0; }
62 $offset = $liste_limit * $page;
63 $pageprev = $page - 1;
64 $pagenext = $page + 1;
65 if (!$sortorder) $sortorder =
"ASC";
66 if (!$sortfield) $sortfield =
"name";
72 $diroutputmassaction = $conf->recruitment->dir_output.
'/temp/massgeneration/'.$user->id;
73 $hookmanager->initHooks(array(
'recruitmentjobpositiondocument',
'globalcard'));
75 $extrafields->fetch_name_optionals_label($object->table_element);
78 include DOL_DOCUMENT_ROOT.
'/core/actions_fetchobject.inc.php';
80 if ($id > 0 || !empty($ref)) $upload_dir = $conf->recruitment->multidir_output[$object->entity ? $object->entity : $conf->entity].
"/recruitmentjobposition/".
get_exdir(0, 0, 0, 1, $object);
87 $permissiontoadd = $user->rights->recruitment->recruitmentjobposition->write;
95 include_once DOL_DOCUMENT_ROOT.
'/core/actions_linkedfiles.inc.php';
102 $form =
new Form($db);
104 $title = $langs->trans(
"RecruitmentJobPosition").
' - '.$langs->trans(
"Files");
120 $filearray =
dol_dir_list($upload_dir,
"files", 0,
'',
'(\.meta|_preview.*\.png)$', $sortfield, (strtolower($sortorder) ==
'desc' ?SORT_DESC:SORT_ASC), 1);
122 foreach ($filearray as $key => $file)
124 $totalsize += $file[
'size'];
129 $linkback =
'<a href="'.dol_buildpath(
'/recruitment/recruitmentjobposition_list.php', 1).
'?restore_lastsearch_values=1'.(!empty($socid) ?
'&socid='.$socid :
'').
'">'.$langs->trans(
"BackToList").
'</a>';
131 $morehtmlref =
'<div class="refidno">';
140 if (!empty($conf->projet->enabled))
142 $langs->load(
"projects");
143 $morehtmlref .= $langs->trans(
'Project').
' ';
144 if ($permissiontoadd)
146 if ($action !=
'classify')
148 $morehtmlref .=
' : ';
149 if ($action ==
'classify') {
151 $morehtmlref .=
'<form method="post" action="'.$_SERVER[
'PHP_SELF'].
'?id='.$object->id.
'">';
152 $morehtmlref .=
'<input type="hidden" name="action" value="classin">';
153 $morehtmlref .=
'<input type="hidden" name="token" value="'.newToken().
'">';
154 $morehtmlref .= $formproject->select_projects($object->socid, $object->fk_project,
'projectid', $maxlength, 0, 1, 0, 1, 0, 0,
'', 1);
155 $morehtmlref .=
'<input type="submit" class="button valignmiddle" value="'.$langs->trans(
"Modify").
'">';
156 $morehtmlref .=
'</form>';
158 $morehtmlref .= $form->form_project(
$_SERVER[
'PHP_SELF'].
'?id='.$object->id, $object->socid, $object->fk_project,
'none', 0, 0, 0, 1);
161 if (!empty($object->fk_project)) {
163 $proj->fetch($object->fk_project);
164 $morehtmlref .=
': '.$proj->getNomUrl();
170 $morehtmlref .=
'</div>';
172 dol_banner_tab($object,
'ref', $linkback, 1,
'ref',
'ref', $morehtmlref);
174 print '<div class="fichecenter">';
176 print '<div class="underbanner clearboth"></div>';
177 print '<table class="border centpercent tableforfield">';
180 print '<tr><td class="titlefield">'.$langs->trans(
"NbOfAttachedFiles").
'</td><td colspan="3">'.count($filearray).
'</td></tr>';
183 print '<tr><td>'.$langs->trans(
"TotalSizeOfAttachedFiles").
'</td><td colspan="3">'.$totalsize.
' '.$langs->trans(
"bytes").
'</td></tr>';
191 $modulepart =
'recruitment';
192 $permission = $user->rights->recruitment->recruitmentjobposition->write;
193 $permtoedit = $user->rights->recruitment->recruitmentjobposition->write;
194 $param =
'&id='.$object->id;
197 $relativepathwithnofile =
'recruitmentjobposition/'.dol_sanitizeFileName($object->ref).
'/';
199 include_once DOL_DOCUMENT_ROOT.
'/core/tpl/document_actions_post_headers.tpl.php';
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.
recruitmentjobpositionPrepareHead($object)
Prepare array of tabs for RecruitmentJobPosition.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname.
Class to manage projects.
get_exdir($num, $level, $alpha, $withoutslash, $object, $modulepart= '')
Return a path to have a the directory according to object where files are stored. ...
accessforbidden($message= '', $printheader=1, $printfooter=1, $showonlymessage=0, $params=null)
Show a message to say access is forbidden and stop program Calling this function terminate execution ...
dol_dir_list($path, $types="all", $recursive=0, $filter="", $excludefilter=null, $sortcriteria="name", $sortorder=SORT_ASC, $mode=0, $nohook=0, $relativename="", $donotfollowsymlinks=0)
Scan a directory and return a list of files/directories.
Class for RecruitmentJobPosition.
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
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.