From a090b21aec2531fedc1e0f91f0a32e52d6f17d5d Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Sun, 1 May 2022 12:12:44 +0200 Subject: [PATCH] NEW Add a public page with all list of open job positions --- htdocs/langs/en_US/recruitment.lang | 2 + htdocs/public/recruitment/index.php | 153 ++++++++++++++++++++++++---- htdocs/public/recruitment/view.php | 5 +- htdocs/theme/md/style.css.php | 20 +++- 4 files changed, 158 insertions(+), 22 deletions(-) diff --git a/htdocs/langs/en_US/recruitment.lang b/htdocs/langs/en_US/recruitment.lang index 6b0e8117254..888f6fe5225 100644 --- a/htdocs/langs/en_US/recruitment.lang +++ b/htdocs/langs/en_US/recruitment.lang @@ -74,3 +74,5 @@ JobClosedTextCanceled=The job position is closed. ExtrafieldsJobPosition=Complementary attributes (job positions) ExtrafieldsApplication=Complementary attributes (job applications) MakeOffer=Make an offer +WeAreRecruiting=We are recruiting. This is a list of open positions to be filled... +NoPositionOpen=No positions open at the moment diff --git a/htdocs/public/recruitment/index.php b/htdocs/public/recruitment/index.php index 1736deef246..286b5af55ba 100644 --- a/htdocs/public/recruitment/index.php +++ b/htdocs/public/recruitment/index.php @@ -47,10 +47,19 @@ $langs->loadLangs(array("companies", "other", "recruitment")); // Get parameters $action = GETPOST('action', 'aZ09'); $cancel = GETPOST('cancel', 'alpha'); -$email = GETPOST('email', 'alpha'); $backtopage = ''; -$ref = GETPOST('ref', 'alpha'); +// Load variable for pagination +$limit = GETPOST('limit', 'int') ? GETPOST('limit', 'int') : $conf->liste_limit; +$sortfield = GETPOST('sortfield', 'aZ09comma'); +$sortorder = GETPOST('sortorder', 'aZ09comma'); +$page = GETPOSTISSET('pageplusone') ? (GETPOST('pageplusone') - 1) : GETPOST("page", 'int'); +if (empty($page) || $page < 0 || GETPOST('button_search', 'alpha') || GETPOST('button_removefilter', 'alpha')) { + $page = 0; +} // If $page is not defined, or '' or -1 or if we click on clear filters +$offset = $limit * $page; +$pageprev = $page - 1; +$pagenext = $page + 1; if (GETPOST('btn_view')) { unset($_SESSION['email_customer']); @@ -61,15 +70,6 @@ if (isset($_SESSION['email_customer'])) { $object = new RecruitmentJobPosition($db); -if (!$action) { - if (!$ref) { - print $langs->trans('ErrorBadParameters')." - ref missing"; - exit; - } else { - $object->fetch('', $ref); - } -} - // Define $urlwithroot //$urlwithouturlroot=preg_replace('/'.preg_quote(DOL_URL_ROOT,'/').'$/i','',trim($dolibarr_main_url_root)); //$urlwithroot=$urlwithouturlroot.DOL_URL_ROOT; // This is to use external domain name found into config file @@ -111,7 +111,7 @@ $arrayofjs = array(); $arrayofcss = array(); $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); +llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1, 1); print ''."\n"; @@ -151,8 +151,7 @@ if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumb if ($urllogo) { print '
'; print '
'; - print ''; + print ''; print '
'; if (empty($conf->global->MAIN_HIDE_POWERED_BY)) { print ''; @@ -167,10 +166,130 @@ if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) { } -// TODO List of jobs -print '
'; -print $langs->trans("FeatureNotYetAvailable"); +$results = $object->fetchAll($sortfield, $sortorder, 0, 0, array('status' => 1)); +if (is_array($results)) { + if (empty($results)) { + print '
'; + print $langs->trans("NoPositionOpen"); + } else { + print '


'; + print ''.$langs->trans("WeAreRecruiting").''; + print '


'; + print '
'; + + foreach ($results as $job) { + $object = $job; + + print ''."\n"; + + // Output introduction text + $text = ''; + if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) { + $reg = array(); + if (preg_match('/^\((.*)\)$/', $conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) { + $text .= $langs->trans($reg[1])."
\n"; + } else { + $text .= $conf->global->RECRUITMENT_NEWFORM_TEXT."
\n"; + } + $text = ''."\n"; + } + if (empty($text)) { + $text .= ''."\n"; + $text .= ''."\n"; + } + print $text; + + // Output payment summary form + print ''."\n"; + + print '

'.$text.'

'.$langs->trans("JobOfferToBeFilled", $mysoc->name); + $text .= '   -   '.$mysoc->name.''; + $text .= '   -   '.dol_print_date($object->date_creation).''; + $text .= '

'.$object->label.'

'; + + print '
'; + print '
'.$langs->trans("ThisIsInformationOnJobPosition").' :
'."\n"; + + $error = 0; + $found = true; + + print '
'; + + // Label + print $langs->trans("Label").' : '; + print ''.dol_escape_htmltag($object->label).'
'; + + // Date + print $langs->trans("DateExpected").' : '; + print ''; + if ($object->date_planned > $now) { + print dol_print_date($object->date_planned, 'day'); + } else { + print $langs->trans("ASAP"); + } + print '
'; + + // Remuneration + print $langs->trans("Remuneration").' : '; + print ''; + print dol_escape_htmltag($object->remuneration_suggested); + print '
'; + + // Contact + $tmpuser = new User($db); + $tmpuser->fetch($object->fk_user_recruiter); + + print $langs->trans("ContactForRecruitment").' : '; + $emailforcontact = $object->email_recruiter; + if (empty($emailforcontact)) { + $emailforcontact = $tmpuser->email; + if (empty($emailforcontact)) { + $emailforcontact = $mysoc->email; + } + } + print ''; + print $tmpuser->getFullName(-1); + print '   '.dol_print_email($emailforcontact, 0, 0, 1, 0, 0, 'envelope'); + print ''; + print '
'; + + if ($object->status == RecruitmentJobPosition::STATUS_RECRUITED) { + print info_admin($langs->trans("JobClosedTextCandidateFound"), 0, 0, 0, 'warning'); + } + if ($object->status == RecruitmentJobPosition::STATUS_CANCELED) { + print info_admin($langs->trans("JobClosedTextCanceled"), 0, 0, 0, 'warning'); + } + + print '
'; + + // Description + + $text = $object->description; + print $text; + print ''; + + print '
'."\n"; + print "\n"; + + + if ($action != 'dosubmit') { + if ($found && !$error) { // We are in a management option and no error + } else { + dol_print_error_email('ERRORNEWONLINESIGN'); + } + } else { + // Print + } + + print '
'."\n"; + + print '



'."\n"; + } + } +} else { + dol_print_error($db, $object->error, $object->errors); +} print ''."\n"; print '
'."\n"; diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 227900ebbb0..955dbd4b586 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -232,12 +232,12 @@ if (!empty($conf->global->RECRUITMENT_IMAGE_PUBLIC_INTERFACE)) { } -print ''."\n"; +print '
'."\n"; // Output introduction text $text = ''; if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT)) { - $langs->load("recruitment"); + $reg = array(); if (preg_match('/^\((.*)\)$/', $conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) { $text .= $langs->trans($reg[1])."
\n"; } else { @@ -334,6 +334,7 @@ if ($action != 'dosubmit') { print ''."\n"; print '
'."\n"; + print ''."\n"; print '
'."\n"; print '
'; diff --git a/htdocs/theme/md/style.css.php b/htdocs/theme/md/style.css.php index 61893ffaa45..d5619f362fb 100644 --- a/htdocs/theme/md/style.css.php +++ b/htdocs/theme/md/style.css.php @@ -1748,9 +1748,6 @@ select.widthcentpercentminusxx, span.widthcentpercentminusxx:not(.select2-select width: 175px; } - .poweredbyimg { - width: 48px; - } input.buttonpayment, button.buttonpayment, div.buttonpayment { min-width: 270px; } @@ -7154,6 +7151,23 @@ div.clipboardCPValue.hidewithsize { margin: 0 0 0 -8px !important; } + .logopublicpayment #dolpaymentlogo { + max-width: 260px; + } + #tablepublicpayment { + width: auto !important; + border: none !important; + } + .poweredbypublicpayment { + float: unset !important; + top: unset !important; + /* bottom: 8px; */ + right: -10px !important; + position: relative !important; + } + .poweredbyimg { + width: 48px; + } } @media only screen and (max-width: 1024px)