26if (!defined(
'NOLOGIN')) {
29if (!defined(
'NOCSRFCHECK')) {
30 define(
"NOCSRFCHECK", 1);
32if (!defined(
'NOIPCHECK')) {
33 define(
'NOIPCHECK',
'1');
35if (!defined(
'NOBROWSERNOTIF')) {
36 define(
'NOBROWSERNOTIF',
'1');
40require
'../../main.inc.php';
41require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentjobposition.class.php';
42require_once DOL_DOCUMENT_ROOT.
'/recruitment/class/recruitmentcandidature.class.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
44require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
45require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
47require_once DOL_DOCUMENT_ROOT .
'/core/lib/public.lib.php';
48require_once DOL_DOCUMENT_ROOT.
'/core/class/extrafields.class.php';
59$langs->loadLangs(array(
"companies",
"other",
"recruitment"));
62$action =
GETPOST(
'action',
'aZ09');
63$cancel =
GETPOST(
'cancel',
'alpha');
64$email =
GETPOST(
'email',
'alpha');
65$firstname =
GETPOST(
'firstname',
'alpha');
66$lastname =
GETPOST(
'lastname',
'alpha');
67$birthday =
GETPOST(
'birthday',
'alpha');
68$phone =
GETPOST(
'phone',
'alpha');
69$message =
GETPOST(
'message',
'alpha');
70$requestedremuneration =
GETPOST(
'requestedremuneration',
'alpha');
75 unset($_SESSION[
'email_customer']);
77if (isset($_SESSION[
'email_customer'])) {
78 $email = $_SESSION[
'email_customer'];
84 print $langs->trans(
'ErrorBadParameters').
" - ref missing";
92$urlwithroot = DOL_MAIN_URL_ROOT;
93$backtopage = $urlwithroot.
'/public/recruitment/index.php';
96if (!isModEnabled(
"recruitment")) {
101$user->loadDefaultValues();
111 if (!empty($backtopage)) {
112 header(
"Location: ".$backtopage);
117if ($action ==
"dosubmit") {
122 array_push(
$object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Ref")));
125 if (!strlen($email)) {
127 array_push(
$object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Email")));
132 array_push(
$object->errors, $langs->trans(
"ErrorEmailInvalid"));
136 if (!strlen($lastname)) {
138 array_push(
$object->errors, $langs->trans(
"ErrorFieldRequired", $langs->transnoentities(
"Lastname")));
143 $sql =
"SELECT rrc.rowid FROM ".MAIN_DB_PREFIX.
"recruitment_recruitmentcandidature as rrc";
144 $sql .=
" WHERE rrc.email = '". $db->escape($email).
"'";
146 $resql = $db->query($sql);
148 $num = $db->num_rows($resql);
151 setEventMessages($langs->trans(
"ErrorRecruitmmentCandidatureAlreadyExists", $email),
null,
'errors');
162 $candidature->firstname =
GETPOST(
'firstname',
'alpha');
163 $candidature->lastname =
GETPOST(
'lastname',
'alpha');
164 $candidature->email =
GETPOST(
'email',
'alpha');
165 $candidature->phone =
GETPOST(
'phone',
'alpha');
166 $candidature->date_birth =
GETPOST(
'birthday',
'alpha');
167 $candidature->requestedremuneration =
GETPOST(
'requestedremuneration',
'alpha');
168 $candidature->description =
GETPOST(
'message',
'alpha');
169 $candidature->fk_recruitmentjobposition =
$object->id;
174 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
178 $errmsg .= implode(
'<br>', $candidature->errors);
182 $extrafields->fetch_name_optionals_label($candidature->table_element);
183 $ret = $extrafields->setOptionalsFromPost(
null, $candidature);
186 $errmsg .= $candidature->error;
190 $result = $candidature->create($user);
193 $errmsg .= implode(
'<br>', $candidature->errors);
197 $candidature->validate($user);
200 $errmsg .= implode(
'<br>', $candidature->errors);
208 header(
"Location: " . $backtopage);
217$triggersendname =
'CANDIDATURE_SENTBYMAIL';
219$autocopy =
'MAIN_MAIL_AUTOCOPY_CANDIDATURE_TO';
220$trackid =
'recruitmentcandidature'.$object->id;
221include DOL_DOCUMENT_ROOT.
'/core/actions_sendmails.inc.php';
229$form =
new Form($db);
234 $head =
'<link rel="stylesheet" type="text/css" href="' .
getDolGlobalString(
'MAIN_RECRUITMENT_CSS_URL').
'?lang='.$langs->defaultlang.
'">'.
"\n";
237$conf->dol_hide_topmenu = 1;
238$conf->dol_hide_leftmenu = 1;
240if (!
$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) {
241 $langs->load(
"errors");
242 print
'<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
248$arrayofcss = array();
250$replacemainarea = (empty(
$conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
251llxHeader($head, $langs->trans(
"PositionToBeFilled"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea, 1, 1);
254print
'<span id="dolpaymentspan"></span>'.
"\n";
255print
'<div class="center">'.
"\n";
256print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
257print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
258print
'<input type="hidden" name="action" value="dosubmit">'.
"\n";
259print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
260print
'<input type="hidden" name="suffix" value="'.GETPOST(
"suffix",
'alpha').
'">'.
"\n";
261print
'<input type="hidden" name="securekey" value="'.$SECUREKEY.
'">'.
"\n";
262print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
264print
'<!-- Form to view job -->'.
"\n";
268$logosmall = $mysoc->logo_small;
270$paramlogo =
'ONLINE_RECRUITMENT_LOGO_'.$suffix;
280if (!empty($logosmall) && is_readable(
$conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
281 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.
$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
282 $urllogofull =
$dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.
$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
283} elseif (!empty($logo) && is_readable(
$conf->mycompany->dir_output.
'/logos/'.$logo)) {
284 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.
$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
289 print
'<div class="backgreypublicpayment">';
290 print
'<div class="logopublicpayment">';
291 if (!empty($mysoc->url)) {
292 print
'<a href="'.$mysoc->url.
'" target="_blank" rel="noopener">';
294 print
'<img id="dolpaymentlogo" src="'.$urllogofull.
'">';
295 if (!empty($mysoc->url)) {
300 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>';
306 print
'<div class="backimagepublicrecruitment">';
307 print
'<img id="idRECRUITMENT_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'RECRUITMENT_IMAGE_PUBLIC_INTERFACE').
'">';
312print
'<table id="dolpaymenttable" summary="Job position offer" class="center">'.
"\n";
318 if (preg_match(
'/^\((.*)\)$/',
$conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) {
319 $text .= $langs->trans($reg[1]).
"<br>\n";
323 $text =
'<tr><td align="center"><br>'.$text.
'<br></td></tr>'.
"\n";
326 $text .=
'<tr><td class="textpublicpayment" colspan=2><br>'.$langs->trans(
"JobOfferToBeFilled", $mysoc->name);
327 $text .=
' - <strong>'.$mysoc->name.
'</strong>';
328 $text .=
' - <span class="nowraponall"><span class="fa fa-calendar secondary"></span> '.dol_print_date(
$object->date_creation).
'</span>';
329 $text .=
'</td></tr>'.
"\n";
330 $text .=
'<tr><td class="textpublicpayment" colspan=2><h1 class="paddingleft paddingright">'.$object->label.
'</h1><br></td></tr>'.
"\n";
335print
'<tr><td class="left" colspan=2>';
337print
'<div with="100%" id="tablepublicpayment">';
338print
'<div class="opacitymedium">'.$langs->trans(
"ThisIsInformationOnJobPosition").
' :</div>'.
"\n";
346print $langs->trans(
"Label").
' : ';
347print
'<b>'.dol_escape_htmltag(
$object->label).
'</b><br>';
350print $langs->trans(
"DateExpected").
' : ';
352if (
$object->date_planned > $now) {
355 print $langs->trans(
"ASAP");
360print $langs->trans(
"Remuneration").
' : ';
366$tmpuser =
new User($db);
367$tmpuser->fetch(
$object->fk_user_recruiter);
369print $langs->trans(
"ContactForRecruitment").
' : ';
370$emailforcontact =
$object->email_recruiter;
371if (empty($emailforcontact)) {
372 $emailforcontact = $tmpuser->email ??
'';
373 if (empty($emailforcontact)) {
374 $emailforcontact = $mysoc->email ??
'';
377print
'<b class="wordbreak">';
378print $tmpuser->getFullName($langs);
379print
' '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0,
'envelope');
384 print
info_admin($langs->trans(
"JobClosedTextCandidateFound"), 0, 0,
'0',
'warning');
387 print
info_admin($langs->trans(
"JobClosedTextCanceled"), 0, 0,
'0',
'warning');
396print
'<input type="hidden" name="ref" value="'.$object->ref.
'">';
402if ($action !=
'dosubmit') {
403 if ($found && !$error) {
405 print
'</td></tr>'.
"\n";
406 print
'<tr><td class="titlefieldcreate fieldrequired left">'.$langs->trans(
"Lastname").
'</td><td class="left">';
407 print
'<input type="text" class="flat minwidth400 --success" name="lastname" maxlength="128" value="'.$lastname.
'">';
408 print
'</td></tr>'.
"\n";
410 print
'<tr><td class="titlefieldcreate left">'.$langs->trans(
"Firstname").
'</td><td class="left">';
411 print
'<input type="text" class="flat minwidth400 --success" name="firstname" maxlength="128" value="'.$firstname.
'">';
412 print
'</td></tr>'.
"\n";
414 print
'<tr><td class="titlefieldcreate fieldrequired left">'.$langs->trans(
"Email").
'</td><td class="left">';
415 print
img_picto(
"",
"email").
'<input type="text" class="flat minwidth100 --success" name="email" value="'.$email.
'">';
416 print
'</td></tr>'.
"\n";
418 print
'<tr><td class="titlefieldcreate left">'.$langs->trans(
"Phone").
'</td><td class="left">';
419 print
img_picto(
"",
"phone").
'<input type="text" class="flat minwidth100 --success" name="phone" value="'.$phone.
'">';
420 print
'</td></tr>'.
"\n";
422 print
'<tr><td class="titlefieldcreate left minwidth300">'.$langs->trans(
"DateOfBirth").
'</td><td class="left">';
423 print $form->selectDate($birthday,
'birthday', 0, 0, 1,
"", 1, 0);
424 print
'</td></tr>'.
"\n";
426 print
'<tr><td class="titlefieldcreate left">'.$langs->trans(
"RequestedRemuneration").
'</td><td class="left">';
427 print
'<input type="text" class="flat minwidth100 --success" name="requestedremuneration" value="'.$requestedremuneration.
'">';
428 print
'</td></tr>'.
"\n";
432 $parameters[
'tpl_context'] =
'public';
433 $parameters[
'tdclass'] =
'left';
434 $extrafields->fetch_name_optionals_label(
"recruitment_recruitmentcandidature");
435 include DOL_DOCUMENT_ROOT.
'/core/tpl/extrafields_add.tpl.php';
437 print
'<tr><td class="titlefieldcreate left">'.$langs->trans(
"Message").
'</td><td class="left">';
438 print
'<textarea class="flat quatrevingtpercent" rows="'.ROWS_5.
'" name="message">'.$message.
'</textarea>';
439 print
'</td></tr>'.
"\n";
441 print
'<tr><td colspan=2>';
442 print $form->buttonsSaveCancel(
'Submit',
'Cancel');
443 print
'</td></tr>'.
"\n";
451print
'</td></tr>'.
"\n";
453print
'</table>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
global $dolibarr_main_url_root
llxFooter($comment='', $zone='private', $disabledoutputofmessages=0)
Empty footer.
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 for RecruitmentCandidature.
Class for RecruitmentJobPosition.
const STATUS_RECRUITED
Recruited.
const STATUS_CANCELED
Canceled.
Class to manage Dolibarr users.
htmlPrintOnlineFooter($fromcompany, $langs, $addformmessage=0, $suffix='', $object=null)
Show footer of company in HTML public pages.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_error_email($prefixcode, $errormessage='', $errormessages=array(), $morecss='error', $email='')
Show a public email and error code to contact if technical error.
getUserRemoteIP($trusted=0)
Return the real IP of remote user.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
isValidEmail($address, $acceptsupervisorkey=0, $acceptuserkey=0)
Return true if email syntax is ok.
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
info_admin($text, $infoonimgalt=0, $nodiv=0, $admin='1', $morecss='hideonsmartphone', $textfordropdown='', $picto='')
Show information in HTML for admin users or standard users.
dol_htmloutput_errors($mesgstring='', $mesgarray=array(), $keepembedded=0)
Print formatted error messages to output (Used to show messages on html output).
getEntity($element, $shared=1, $currentobject=null)
Get list of entity id to use.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
checkNbPostsForASpeceificIp($object, $nb_post_max)
Check if the object exceeded the number of posts for a specific ip in the same week.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.