24 if (!defined(
'NOLOGIN')) {
27 if (!defined(
'NOCSRFCHECK')) {
28 define(
"NOCSRFCHECK", 1);
30 if (!defined(
'NOIPCHECK')) {
31 define(
'NOIPCHECK',
'1');
33 if (!defined(
'NOBROWSERNOTIF')) {
34 define(
'NOBROWSERNOTIF',
'1');
37 require
'../../main.inc.php';
38 require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
39 require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
40 require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
41 require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
42 require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
45 $langs->loadLangs(array(
"companies",
"other",
"recruitment"));
48 $action =
GETPOST(
'action',
'aZ09');
49 $cancel =
GETPOST(
'cancel',
'alpha');
53 $limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
54 $sortfield =
GETPOST(
'sortfield',
'aZ09comma');
55 $sortorder =
GETPOST(
'sortorder',
'aZ09comma');
57 if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
60 $offset = $limit * $page;
61 $pageprev = $page - 1;
62 $pagenext = $page + 1;
65 unset($_SESSION[
'email_customer']);
67 if (isset($_SESSION[
'email_customer'])) {
68 $email = $_SESSION[
'email_customer'];
76 $urlwithroot = DOL_MAIN_URL_ROOT;
79 if (empty($conf->recruitment->enabled)) {
96 if (!empty($conf->global->MAIN_RECRUITMENT_CSS_URL)) {
97 $head =
'<link rel="stylesheet" type="text/css" href="'.$conf->global->MAIN_RECRUITMENT_CSS_URL.
'?lang='.$langs->defaultlang.
'">'.
"\n";
100 $conf->dol_hide_topmenu = 1;
101 $conf->dol_hide_leftmenu = 1;
103 if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) {
104 $langs->load(
"errors");
105 print
'<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
110 $arrayofjs = array();
111 $arrayofcss = array();
113 $replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
114 llxHeader($head, $langs->trans(
"PositionToBeFilled"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea, 1, 1);
117 print
'<span id="dolpaymentspan"></span>'.
"\n";
118 print
'<div class="center">'.
"\n";
119 print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
120 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
121 print
'<input type="hidden" name="action" value="dosign">'.
"\n";
122 print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
123 print
'<input type="hidden" name="suffix" value="'.GETPOST(
"suffix",
'alpha').
'">'.
"\n";
124 print
'<input type="hidden" name="securekey" value="'.$SECUREKEY.
'">'.
"\n";
125 print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
127 print
'<!-- Form to view jobs -->'.
"\n";
131 $logosmall = $mysoc->logo_small;
132 $logo = $mysoc->logo;
133 $paramlogo =
'ONLINE_RECRUITMENT_LOGO_'.$suffix;
134 if (!empty($conf->global->$paramlogo)) {
135 $logosmall = $conf->global->$paramlogo;
136 } elseif (!empty($conf->global->ONLINE_RECRUITMENT_LOGO)) {
137 $logosmall = $conf->global->ONLINE_RECRUITMENT_LOGO_;
143 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
144 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
145 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
146 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
147 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
148 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
152 print
'<div class="backgreypublicpayment">';
153 print
'<div class="logopublicpayment">';
154 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'">';
156 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
157 print
'<div class="poweredbypublicpayment opacitymedium right"><a class="poweredbyhref" href="https://www.dolibarr.org?utm_medium=website&utm_source=poweredby" target="dolibarr" rel="noopener">'.$langs->trans(
"PoweredBy").
'<br><img class="poweredbyimg" src="'.DOL_URL_ROOT.
'/theme/dolibarr_logo.svg" width="80px"></a></div>';
162 if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) {
163 print
'<div class="backimagepublicrecruitment">';
164 print
'<img id="idPROJECT_IMAGE_PUBLIC_SUGGEST_BOOTH" src="'.$conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE.
'">';
169 $results = $object->fetchAll($sortfield, $sortorder, 0, 0, array(
'status' => 1));
171 if (is_array($results)) {
172 if (empty($results)) {
174 print $langs->trans(
"NoPositionOpen");
176 print
'<br><br><br>';
177 print
'<span class="opacitymedium">'.$langs->trans(
"WeAreRecruiting").
'</span>';
178 print
'<br><br><br>';
179 print
'<br class="hideonsmartphone">';
181 foreach ($results as $job) {
184 print
'<table id="dolpaymenttable" summary="Job position offer" class="center">'.
"\n";
188 if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) {
190 if (preg_match(
'/^\((.*)\)$/', $conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) {
191 $text .= $langs->trans($reg[1]).
"<br>\n";
193 $text .= $conf->global->RECRUITMENT_NEWFORM_TEXT.
"<br>\n";
195 $text =
'<tr><td align="center"><br>'.$text.
'<br></td></tr>'.
"\n";
198 $text .=
'<tr><td class="textpublicpayment"><br>'.$langs->trans(
"JobOfferToBeFilled", $mysoc->name);
199 $text .=
' - <strong>'.$mysoc->name.
'</strong>';
200 $text .=
' - <span class="nowraponall"><span class="fa fa-calendar secondary"></span> '.dol_print_date($object->date_creation).
'</span>';
201 $text .=
'</td></tr>'.
"\n";
202 $text .=
'<tr><td class="textpublicpayment"><h1 class="paddingleft paddingright">'.$object->label.
'</h1></td></tr>'.
"\n";
207 print
'<tr><td class="left">';
209 print
'<div with="100%" id="tablepublicpayment">';
210 print
'<div class="opacitymedium">'.$langs->trans(
"ThisIsInformationOnJobPosition").
' :</div>'.
"\n";
218 print $langs->trans(
"Label").
' : ';
219 print
'<b>'.dol_escape_htmltag($object->label).
'</b><br>';
222 print $langs->trans(
"DateExpected").
' : ';
224 if ($object->date_planned > $now) {
227 print $langs->trans(
"ASAP");
232 print $langs->trans(
"Remuneration").
' : ';
238 $tmpuser =
new User($db);
239 $tmpuser->fetch($object->fk_user_recruiter);
241 print $langs->trans(
"ContactForRecruitment").
' : ';
242 $emailforcontact = $object->email_recruiter;
243 if (empty($emailforcontact)) {
244 $emailforcontact = $tmpuser->email;
245 if (empty($emailforcontact)) {
246 $emailforcontact = $mysoc->email;
249 print
'<b class="wordbreak">';
250 print $tmpuser->getFullName(-1);
251 print
' '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0,
'envelope');
255 if ($object->status == RecruitmentJobPosition::STATUS_RECRUITED) {
256 print
info_admin($langs->trans(
"JobClosedTextCandidateFound"), 0, 0, 0,
'warning');
258 if ($object->status == RecruitmentJobPosition::STATUS_CANCELED) {
259 print
info_admin($langs->trans(
"JobClosedTextCanceled"), 0, 0, 0,
'warning');
266 $text = $object->description;
268 print
'<input type="hidden" name="ref" value="'.$object->ref.
'">';
274 if ($action !=
'dosubmit') {
275 if ($found && !$error) {
284 print
'</td></tr>'.
"\n";
286 print
'</table>'.
"\n";
288 print
'<br><br class="hideonsmartphone"><br class="hideonsmartphone"><br class="hideonsmartphone">'.
"\n";
295 print
'</form>'.
"\n";
300 htmlPrintOnlinePaymentFooter($mysoc, $langs);