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');
50 $email =
GETPOST(
'email',
'alpha');
56 unset($_SESSION[
'email_customer']);
58 if (isset($_SESSION[
'email_customer'])) {
59 $email = $_SESSION[
'email_customer'];
66 print $langs->trans(
'ErrorBadParameters').
" - ref missing";
69 $object->fetch(
'', $ref);
76 $urlwithroot = DOL_MAIN_URL_ROOT;
79 if (empty($conf->recruitment->enabled)) {
89 if (!empty($backtopage)) {
90 header(
"Location: ".$backtopage);
96 if ($action ==
"view" || $action ==
"presend" || $action ==
"close" || $action ==
"confirm_public_close" || $action ==
"add_message") {
98 $display_ticket =
false;
101 array_push($object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")));
104 if (!strlen($email)) {
106 array_push($object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Email")));
111 array_push($object->errors, $langs->trans(
"ErrorEmailInvalid"));
117 $ret = $object->fetch(
'', $ref);
136 if ($error || $errors) {
138 if ($action ==
"add_message") {
149 $triggersendname =
'CANDIDATURE_SENTBYMAIL';
151 $autocopy =
'MAIN_MAIL_AUTOCOPY_CANDIDATURE_TO';
152 $trackid =
'recruitmentcandidature'.$object->id;
153 include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
162 if (!empty($conf->global->MAIN_RECRUITMENT_CSS_URL)) {
163 $head =
'<link rel="stylesheet" type="text/css" href="'.$conf->global->MAIN_RECRUITMENT_CSS_URL.
'?lang='.$langs->defaultlang.
'">'.
"\n";
166 $conf->dol_hide_topmenu = 1;
167 $conf->dol_hide_leftmenu = 1;
169 if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) {
170 $langs->load(
"errors");
171 print
'<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
176 $arrayofjs = array();
177 $arrayofcss = array();
179 $replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
180 llxHeader($head, $langs->trans(
"PositionToBeFilled"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea, 1, 1);
183 print
'<span id="dolpaymentspan"></span>'.
"\n";
184 print
'<div class="center">'.
"\n";
185 print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
186 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
187 print
'<input type="hidden" name="action" value="dosign">'.
"\n";
188 print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
189 print
'<input type="hidden" name="suffix" value="'.GETPOST(
"suffix",
'alpha').
'">'.
"\n";
190 print
'<input type="hidden" name="securekey" value="'.$SECUREKEY.
'">'.
"\n";
191 print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
193 print
'<!-- Form to view job -->'.
"\n";
197 $logosmall = $mysoc->logo_small;
198 $logo = $mysoc->logo;
199 $paramlogo =
'ONLINE_RECRUITMENT_LOGO_'.$suffix;
200 if (!empty($conf->global->$paramlogo)) {
201 $logosmall = $conf->global->$paramlogo;
202 } elseif (!empty($conf->global->ONLINE_RECRUITMENT_LOGO)) {
203 $logosmall = $conf->global->ONLINE_RECRUITMENT_LOGO_;
209 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
210 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
211 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
212 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
213 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
214 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
218 print
'<div class="backgreypublicpayment">';
219 print
'<div class="logopublicpayment">';
220 if (!empty($mysoc->url)) {
221 print
'<a href="'.$mysoc->url.
'" target="_blank" rel="noopener">';
223 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'">';
224 if (!empty($mysoc->url)) {
228 if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
229 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>';
234 if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) {
235 print
'<div class="backimagepublicrecruitment">';
236 print
'<img id="idPROJECT_IMAGE_PUBLIC_SUGGEST_BOOTH" src="'.$conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE.
'">';
241 print
'<table id="dolpaymenttable" summary="Job position offer" class="center">'.
"\n";
245 if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) {
247 if (preg_match(
'/^\((.*)\)$/', $conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) {
248 $text .= $langs->trans($reg[1]).
"<br>\n";
250 $text .= $conf->global->RECRUITMENT_NEWFORM_TEXT.
"<br>\n";
252 $text =
'<tr><td align="center"><br>'.$text.
'<br></td></tr>'.
"\n";
255 $text .=
'<tr><td class="textpublicpayment"><br>'.$langs->trans(
"JobOfferToBeFilled", $mysoc->name);
256 $text .=
' - <strong>'.$mysoc->name.
'</strong>';
257 $text .=
' - <span class="nowraponall"><span class="fa fa-calendar secondary"></span> '.dol_print_date($object->date_creation).
'</span>';
258 $text .=
'</td></tr>'.
"\n";
259 $text .=
'<tr><td class="textpublicpayment"><h1 class="paddingleft paddingright">'.$object->label.
'</h1><br></td></tr>'.
"\n";
264 print
'<tr><td class="left">';
266 print
'<div with="100%" id="tablepublicpayment">';
267 print
'<div class="opacitymedium">'.$langs->trans(
"ThisIsInformationOnJobPosition").
' :</div>'.
"\n";
275 print $langs->trans(
"Label").
' : ';
276 print
'<b>'.dol_escape_htmltag($object->label).
'</b><br>';
279 print $langs->trans(
"DateExpected").
' : ';
281 if ($object->date_planned > $now) {
284 print $langs->trans(
"ASAP");
289 print $langs->trans(
"Remuneration").
' : ';
295 $tmpuser =
new User($db);
296 $tmpuser->fetch($object->fk_user_recruiter);
298 print $langs->trans(
"ContactForRecruitment").
' : ';
299 $emailforcontact = $object->email_recruiter;
300 if (empty($emailforcontact)) {
301 $emailforcontact = $tmpuser->email;
302 if (empty($emailforcontact)) {
303 $emailforcontact = $mysoc->email;
306 print
'<b class="wordbreak">';
307 print $tmpuser->getFullName(-1);
308 print
' '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0,
'envelope');
312 if ($object->status == RecruitmentJobPosition::STATUS_RECRUITED) {
313 print
info_admin($langs->trans(
"JobClosedTextCandidateFound"), 0, 0, 0,
'warning');
315 if ($object->status == RecruitmentJobPosition::STATUS_CANCELED) {
316 print
info_admin($langs->trans(
"JobClosedTextCanceled"), 0, 0, 0,
'warning');
323 $text = $object->description;
325 print
'<input type="hidden" name="ref" value="'.$object->ref.
'">';
331 if ($action !=
'dosubmit') {
332 if ($found && !$error) {
341 print
'</td></tr>'.
"\n";
343 print
'</table>'.
"\n";
345 print
'</form>'.
"\n";
350 htmlPrintOnlinePaymentFooter($mysoc, $langs);