Add public page of job position offers
This commit is contained in:
parent
3e586d3b26
commit
c79d617a50
@ -1041,4 +1041,6 @@ SwitchInEditModeToAddTranslation=Switch in edit mode to add translations for thi
|
||||
NotUsedForThisCustomer=Not used for this customer
|
||||
AmountMustBePositive=Amount must be positive
|
||||
ByStatus=By status
|
||||
InformationMessage=Information
|
||||
InformationMessage=Information
|
||||
ASAP=As Soon As Possible
|
||||
|
||||
@ -27,8 +27,10 @@ ModuleRecruitmentDesc = Manage and follow recruitment campaigns for new job posi
|
||||
#
|
||||
RecruitmentSetup = Recruitment setup
|
||||
Settings = Settings
|
||||
RecruitmentSetupPage = Recruitment setup page
|
||||
RecruitmentSetupPage = Enter here the setup of main options for the recruitment module
|
||||
RecruitmentArea=Recruitement area
|
||||
PublicInterfaceRecruitmentDesc=Public interface is public URLs to show and answer to open jobs. There is one different link for each open job.
|
||||
EnablePublicRecruitmentPages=Enable public recruitment pages
|
||||
|
||||
#
|
||||
# About page
|
||||
@ -43,8 +45,10 @@ DateExpected=Expected date
|
||||
FutureManager=Future manager
|
||||
ResponsibleOfRecruitement=Responsible of recruitment
|
||||
IfJobIsLocatedAtAPartner=If job is located at a partner place
|
||||
PositionToBeFilled=Position to be filled
|
||||
PositionsToBeFilled=Positions to be filled
|
||||
ListOfPositionsToBeFilled=List of positions to be filled
|
||||
NewPositionToBeFilled=New position to be filled
|
||||
PositionToBeFilled=Job offer to be filled
|
||||
PositionsToBeFilled=Job offers to be filled
|
||||
ListOfPositionsToBeFilled=List of job offers to be filled
|
||||
NewPositionToBeFilled=New job offers to be filled
|
||||
|
||||
JobOfferToBeFilled=Job offer to be filled
|
||||
ThisIsInformationOnJobPosition=Information of the job position to be filled
|
||||
@ -45,6 +45,7 @@ $langs->loadLangs(array("main", "other", "dict", "bills", "companies", "errors",
|
||||
// Security check
|
||||
// No check on module enabled. Done later according to $validpaymentmethod
|
||||
|
||||
// Get parameters
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
|
||||
// Input are:
|
||||
@ -70,9 +71,6 @@ if (!$action)
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
// 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
|
||||
@ -132,7 +130,7 @@ $conf->dol_hide_leftmenu = 1;
|
||||
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
|
||||
|
||||
// Check link validity
|
||||
// Check link validity for param 'source'
|
||||
if (!empty($source) && in_array($ref, array('member_ref', 'contractline_ref', 'invoice_ref', 'order_ref', '')))
|
||||
{
|
||||
$langs->load("errors");
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?php
|
||||
/* Copyright (C) 2013-2016 Jean-François FERRY <hello@librethic.io>
|
||||
* Copyright (C) 2018 Frédéric France <frederic.france@netlogic.fr>
|
||||
/* Copyright (C) 2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
@ -22,18 +21,9 @@
|
||||
* \brief Public file to show on job
|
||||
*/
|
||||
|
||||
if (!defined('NOCSRFCHECK')) {
|
||||
define('NOCSRFCHECK', '1');
|
||||
}
|
||||
// Do not check anti CSRF attack test
|
||||
if (!defined('NOREQUIREMENU')) {
|
||||
define('NOREQUIREMENU', '1');
|
||||
}
|
||||
// If there is no need to load and show top and left menu
|
||||
if (!defined("NOLOGIN")) {
|
||||
define("NOLOGIN", '1');
|
||||
}
|
||||
// If this page is public (can be called outside logged session)
|
||||
if (!defined('NOLOGIN')) define("NOLOGIN", 1); // This means this output page does not require to be logged.
|
||||
if (!defined('NOCSRFCHECK')) define("NOCSRFCHECK", 1); // We accept to go on this page from external web site.
|
||||
if (!defined('NOIPCHECK')) define('NOIPCHECK', '1'); // Do not check IP defined into conf $dolibarr_main_restrict_ip
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/recruitment/class/recruitmentjobposition.class.php';
|
||||
@ -45,9 +35,10 @@ require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
|
||||
$langs->loadLangs(array("companies", "other", "recruitment"));
|
||||
|
||||
// Get parameters
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$action = GETPOST('action', 'aZ09');
|
||||
$cancel = GETPOST('cancel', 'alpha');
|
||||
$email = GETPOST('email', 'alpha');
|
||||
$backtopage = '';
|
||||
|
||||
$ref = GETPOST('ref', 'alpha');
|
||||
|
||||
@ -60,6 +51,22 @@ 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
|
||||
$urlwithroot = DOL_MAIN_URL_ROOT; // This is to use same domain name than current. For Paypal payment, we can use internal URL like localhost.
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -141,7 +148,11 @@ include DOL_DOCUMENT_ROOT.'/core/actions_sendmails.inc.php';
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
$head = '';
|
||||
if (!empty($conf->global->MAIN_RECRUITMENT_CSS_URL)) $head = '<link rel="stylesheet" type="text/css" href="'.$conf->global->MAIN_RECRUITMENT_CSS_URL.'?lang='.$langs->defaultlang.'">'."\n";
|
||||
|
||||
$conf->dol_hide_topmenu = 1;
|
||||
$conf->dol_hide_leftmenu = 1;
|
||||
|
||||
if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) {
|
||||
print '<div class="error">'.$langs->trans('PublicInterfaceForbidden').'</div>';
|
||||
@ -150,170 +161,148 @@ if (!$conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) {
|
||||
}
|
||||
|
||||
$arrayofjs = array();
|
||||
$arrayofcss = array('/ticket/css/styles.css.php');
|
||||
$arrayofcss = array();
|
||||
|
||||
llxHeaderRecruitment($langs->trans("Jobs"), "", 0, 0, $arrayofjs, $arrayofcss);
|
||||
$replacemainarea = (empty($conf->dol_hide_leftmenu) ? '<div>' : '').'<div>';
|
||||
llxHeader($head, $langs->trans("PositionToBeFilled"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea);
|
||||
|
||||
print '<div class="ticketpublicarea">';
|
||||
|
||||
if ($action == "view" || $action == "presend" || $action == "close" || $action == "confirm_public_close") {
|
||||
if ($display_ticket)
|
||||
{
|
||||
// Confirmation close
|
||||
if ($action == 'close') {
|
||||
print $form->formconfirm($_SERVER["PHP_SELF"]."?track_id=".$track_id, $langs->trans("CloseATicket"), $langs->trans("ConfirmCloseAticket"), "confirm_public_close", '', '', 1);
|
||||
}
|
||||
print '<span id="dolpaymentspan"></span>'."\n";
|
||||
print '<div class="center">'."\n";
|
||||
print '<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER["PHP_SELF"].'" method="POST">'."\n";
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
|
||||
print '<input type="hidden" name="action" value="dosign">'."\n";
|
||||
print '<input type="hidden" name="tag" value="'.GETPOST("tag", 'alpha').'">'."\n";
|
||||
print '<input type="hidden" name="suffix" value="'.GETPOST("suffix", 'alpha').'">'."\n";
|
||||
print '<input type="hidden" name="securekey" value="'.$SECUREKEY.'">'."\n";
|
||||
print '<input type="hidden" name="entity" value="'.$entity.'" />';
|
||||
print "\n";
|
||||
print '<!-- Form to sign -->'."\n";
|
||||
|
||||
print '<div id="form_view" class="margintoponly">';
|
||||
print '<table id="dolpaymenttable" summary="Payment form" class="center">'."\n";
|
||||
|
||||
print '<table class="ticketpublictable centpercent tableforfield">';
|
||||
|
||||
// Ref
|
||||
print '<tr><td class="titlefield">'.$langs->trans("Ref").'</td><td>';
|
||||
print $object->dao->ref;
|
||||
print '</td></tr>';
|
||||
|
||||
// Tracking ID
|
||||
print '<tr><td>'.$langs->trans("TicketTrackId").'</td><td>';
|
||||
print $object->dao->track_id;
|
||||
print '</td></tr>';
|
||||
|
||||
// Subject
|
||||
print '<tr><td>'.$langs->trans("Subject").'</td><td>';
|
||||
print $object->dao->subject;
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>';
|
||||
print $object->dao->getLibStatut(2);
|
||||
print '</td></tr>';
|
||||
|
||||
// Type
|
||||
print '<tr><td>'.$langs->trans("Type").'</td><td>';
|
||||
print $object->dao->type_label;
|
||||
print '</td></tr>';
|
||||
|
||||
// Category
|
||||
print '<tr><td>'.$langs->trans("Category").'</td><td>';
|
||||
print $object->dao->category_label;
|
||||
print '</td></tr>';
|
||||
|
||||
// Severity
|
||||
print '<tr><td>'.$langs->trans("Severity").'</td><td>';
|
||||
print $object->dao->severity_label;
|
||||
print '</td></tr>';
|
||||
|
||||
// Creation date
|
||||
print '<tr><td>'.$langs->trans("DateCreation").'</td><td>';
|
||||
print dol_print_date($object->dao->datec, 'dayhour');
|
||||
print '</td></tr>';
|
||||
|
||||
// Author
|
||||
print '<tr><td>'.$langs->trans("Author").'</td><td>';
|
||||
if ($object->dao->fk_user_create > 0) {
|
||||
$langs->load("users");
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($object->dao->fk_user_create);
|
||||
print $fuser->getFullName($langs);
|
||||
} else {
|
||||
print dol_escape_htmltag($object->dao->origin_email);
|
||||
}
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
// Read date
|
||||
if (!empty($object->dao->date_read)) {
|
||||
print '<tr><td>'.$langs->trans("TicketReadOn").'</td><td>';
|
||||
print dol_print_date($object->dao->date_read, 'dayhour');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// Close date
|
||||
if (!empty($object->dao->date_close)) {
|
||||
print '<tr><td>'.$langs->trans("TicketCloseOn").'</td><td>';
|
||||
print dol_print_date($object->dao->date_close, 'dayhour');
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
// User assigned
|
||||
print '<tr><td>'.$langs->trans("AssignedTo").'</td><td>';
|
||||
if ($object->dao->fk_user_assign > 0) {
|
||||
$fuser = new User($db);
|
||||
$fuser->fetch($object->dao->fk_user_assign);
|
||||
print $fuser->getFullName($langs, 1);
|
||||
}
|
||||
print '</td></tr>';
|
||||
|
||||
// Progression
|
||||
print '<tr><td>'.$langs->trans("Progression").'</td><td>';
|
||||
print ($object->dao->progress > 0 ? $object->dao->progress : '0').'%';
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '</div>';
|
||||
|
||||
print '<div style="clear: both; margin-top: 1.5em;"></div>';
|
||||
|
||||
if ($action == 'presend') {
|
||||
print load_fiche_titre($langs->trans('AddMessage'), '', 'messages@ticket');
|
||||
|
||||
/*$formticket = new FormTicket($db);
|
||||
|
||||
$formticket->action = "add_message";
|
||||
$formticket->track_id = $object->dao->track_id;
|
||||
$formticket->id = $object->dao->id;
|
||||
|
||||
$formticket->param = array('track_id' => $object->dao->track_id, 'fk_user_create' => '-1', 'returnurl' => DOL_URL_ROOT.'/public/ticket/view.php');
|
||||
|
||||
$formticket->withfile = 2;
|
||||
$formticket->withcancel = 1;
|
||||
|
||||
$formticket->showMessageForm('100%');
|
||||
*/
|
||||
print 'TODO Show message form';
|
||||
}
|
||||
|
||||
if ($action != 'presend') {
|
||||
print '<form method="post" id="form_view_list" name="form_view_list" enctype="multipart/form-data" action="'.DOL_URL_ROOT.'/public/recruitment/list.php">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
print '<input type="hidden" name="action" value="viewlist">';
|
||||
print '<input type="hidden" name="ref" value="'.$object->ref.'">';
|
||||
print '<input type="hidden" name="email" value="'.$_SESSION['email_customer'].'">';
|
||||
//print '<input type="hidden" name="search_fk_status" value="non_closed">';
|
||||
print "</form>\n";
|
||||
|
||||
print '<div class="tabsAction">';
|
||||
|
||||
// List ticket
|
||||
print '<div class="inline-block divButAction"><a class="left" style="padding-right: 50px" href="javascript:$(\'#form_view_list\').submit();">'.$langs->trans('ViewMyTicketList').'</a></div>';
|
||||
|
||||
if ($object->dao->fk_statut < Ticket::STATUS_CLOSED) {
|
||||
// New message
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=presend&mode=init&ref='.$object->ref.'">'.$langs->trans('AddMessage').'</a></div>';
|
||||
|
||||
// Close ticket
|
||||
if ($object->dao->fk_statut >= Ticket::STATUS_NOT_READ && $object->dao->fk_statut < Ticket::STATUS_CLOSED) {
|
||||
print '<div class="inline-block divButAction"><a class="butAction" href="'.$_SERVER['PHP_SELF'].'?action=close&track_id='.$object->dao->track_id.'">'.$langs->trans('CloseTicket').'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
// Message list
|
||||
print load_fiche_titre($langs->trans('JobMessagesList'), '', 'object_conversation');
|
||||
//$object->viewTicketMessages(false, true, $object->dao);
|
||||
} else {
|
||||
print '<div class="error">Not Allowed<br><a href="'.$_SERVER['PHP_SELF'].'?ref='.$object->ref.'">'.$langs->trans('Back').'</a></div>';
|
||||
// Show logo (search order: logo defined by ONLINE_SIGN_LOGO_suffix, then ONLINE_SIGN_LOGO_, then small company logo, large company logo, theme logo, common logo)
|
||||
$width = 0;
|
||||
// Define logo and logosmall
|
||||
$logosmall = $mysoc->logo_small;
|
||||
$logo = $mysoc->logo;
|
||||
$paramlogo = 'ONLINE_RECRUITMENT_LOGO_'.$suffix;
|
||||
if (!empty($conf->global->$paramlogo)) $logosmall = $conf->global->$paramlogo;
|
||||
elseif (!empty($conf->global->ONLINE_RECRUITMENT_LOGO)) $logosmall = $conf->global->ONLINE_RECRUITMENT_LOGO_;
|
||||
//print '<!-- Show logo (logosmall='.$logosmall.' logo='.$logo.') -->'."\n";
|
||||
// Define urllogo
|
||||
$urllogo = '';
|
||||
$urllogofull = '';
|
||||
if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$logosmall))
|
||||
{
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/thumbs/'.$logosmall);
|
||||
$width = 150;
|
||||
} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$logo))
|
||||
{
|
||||
$urllogo = DOL_URL_ROOT.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
$urllogofull = $dolibarr_main_url_root.'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.'&file='.urlencode('logos/'.$logo);
|
||||
$width = 150;
|
||||
}
|
||||
// Output html code for logo
|
||||
if ($urllogo)
|
||||
{
|
||||
print '<div class="backgreypublicpayment">';
|
||||
print '<div class="logopublicpayment">';
|
||||
print '<img id="dolpaymentlogo" src="'.$urllogo.'"';
|
||||
if ($width) print ' width="'.$width.'"';
|
||||
print '>';
|
||||
print '</div>';
|
||||
if (empty($conf->global->MAIN_HIDE_POWERED_BY)) {
|
||||
print '<div class="poweredbypublicpayment opacitymedium right"><a href="https://www.dolibarr.org" target="dolibarr">'.$langs->trans("PoweredBy").'<br><img src="'.DOL_URL_ROOT.'/theme/dolibarr_logo.svg" width="80px"></a></div>';
|
||||
}
|
||||
print '</div>';
|
||||
}
|
||||
|
||||
print "</div>";
|
||||
// Output introduction text
|
||||
$text = '';
|
||||
if (!empty($conf->global->RECRUITMENT_NEWFORM_TEXT))
|
||||
{
|
||||
$langs->load("recruitment");
|
||||
if (preg_match('/^\((.*)\)$/', $conf->global->RECRUITMENT_NEWFORM_TEXT, $reg)) $text .= $langs->trans($reg[1])."<br>\n";
|
||||
else $text .= $conf->global->RECRUITMENT_NEWFORM_TEXT."<br>\n";
|
||||
$text = '<tr><td align="center"><br>'.$text.'<br></td></tr>'."\n";
|
||||
}
|
||||
if (empty($text))
|
||||
{
|
||||
$text .= '<tr><td class="textpublicpayment"><br><strong>'.$langs->trans("JobOfferToBeFilled", $mysoc->name).'</strong>';
|
||||
$text .= ' - <span class="fa fa-calendar secondary"></span> '.dol_print_date($object->date_creation);
|
||||
$text .= '</td></tr>'."\n";
|
||||
$text .= '<tr><td class="textpublicpayment"><h1>'.$object->label.'</h1><br></td></tr>'."\n";
|
||||
}
|
||||
print $text;
|
||||
|
||||
// End of page
|
||||
htmlPrintOnlinePaymentFooter($mysoc, $langs, 0, $suffix, $object);
|
||||
// Output payment summary form
|
||||
print '<tr><td align="center">';
|
||||
print '<table with="100%" id="tablepublicpayment">';
|
||||
print '<tr><td align="left" colspan="2" class="opacitymedium">'.$langs->trans("ThisIsInformationOnJobPosition").' :</td></tr>'."\n";
|
||||
|
||||
$error = 0;
|
||||
$var = false;
|
||||
|
||||
// Label
|
||||
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("JobLabel");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">';
|
||||
print '<b>'.$object->label.'</b>';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
// Date
|
||||
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').'">'.$langs->trans("DateExpected");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'"><b>';
|
||||
if ($object->date_planned > $now) {
|
||||
print dol_print_date('day', $object->date_planned);
|
||||
} else {
|
||||
print $langs->trans("ASAP");
|
||||
}
|
||||
print '</b>';
|
||||
|
||||
// Description
|
||||
|
||||
$text = $object->description;
|
||||
print '<tr class="CTableRow'.($var ? '1' : '2').'"><td class="CTableRow'.($var ? '1' : '2').' tdtop">'.$langs->trans("Description");
|
||||
print '</td><td class="CTableRow'.($var ? '1' : '2').'">'.$text;
|
||||
print '<input type="hidden" name="ref" value="'.$proposal->ref.'">';
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
|
||||
|
||||
|
||||
if (!$found && !$mesg) $mesg = $langs->trans("ErrorBadParameters");
|
||||
|
||||
if ($mesg) print '<tr><td align="center" colspan="2"><br><div class="warning">'.$mesg.'</div></td></tr>'."\n";
|
||||
|
||||
print '</table>'."\n";
|
||||
print "\n";
|
||||
|
||||
if ($action != 'dosign')
|
||||
{
|
||||
if ($found && !$error) // We are in a management option and no error
|
||||
{
|
||||
} else {
|
||||
dol_print_error_email('ERRORNEWONLINESIGN');
|
||||
}
|
||||
} else {
|
||||
// Print
|
||||
}
|
||||
|
||||
print '</td></tr>'."\n";
|
||||
|
||||
print '</table>'."\n";
|
||||
print '</form>'."\n";
|
||||
print '</div>'."\n";
|
||||
print '<br>';
|
||||
|
||||
|
||||
htmlPrintOnlinePaymentFooter($mysoc, $langs);
|
||||
|
||||
llxFooter('', 'public');
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
194
htdocs/recruitment/admin/public_interface.php
Normal file
194
htdocs/recruitment/admin/public_interface.php
Normal file
@ -0,0 +1,194 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2006-2020 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2006-2012 Regis Houssin <regis.houssin@inodbox.com>
|
||||
* Copyright (C) 2011 Juanjo Menent <jmenent@2byte.es>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file htdocs/recruitment/admin/public_interface.php
|
||||
* \ingroup recruitment
|
||||
* \brief File of main public page for open job position
|
||||
*/
|
||||
|
||||
require '../../main.inc.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/admin.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment.lib.php';
|
||||
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array("admin", "recruitment"));
|
||||
|
||||
$action = GETPOST('action', 'alpha');
|
||||
|
||||
if (!$user->admin) accessforbidden();
|
||||
|
||||
$error = 0;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
if ($action == 'setRECRUITMENT_ENABLE_PUBLIC_INTERFACE') {
|
||||
if (GETPOST('value')) dolibarr_set_const($db, 'RECRUITMENT_ENABLE_PUBLIC_INTERFACE', 1, 'chaine', 0, '', $conf->entity);
|
||||
else dolibarr_set_const($db, 'RECRUITMENT_ENABLE_PUBLIC_INTERFACE', 0, 'chaine', 0, '', $conf->entity);
|
||||
}
|
||||
|
||||
if ($action == 'update') {
|
||||
$public = GETPOST('RECRUITMENT_ENABLE_PUBLIC_INTERFACE');
|
||||
|
||||
$res = dolibarr_set_const($db, "RECRUITMENT_ENABLE_PUBLIC_INTERFACE", $public, 'chaine', 0, '', $conf->entity);
|
||||
|
||||
if (!$res > 0) $error++;
|
||||
|
||||
if (!$error) {
|
||||
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
|
||||
} else {
|
||||
setEventMessages($langs->trans("Error"), null, 'errors');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* View
|
||||
*/
|
||||
|
||||
$form = new Form($db);
|
||||
|
||||
//$help_url = 'EN:Module_Foundations|FR:Module_Adhérents|ES:Módulo_Miembros';
|
||||
$help_url = '';
|
||||
llxHeader('', $langs->trans("RecruitmentSetup"), $help_url);
|
||||
|
||||
|
||||
$linkback = '<a href="'.DOL_URL_ROOT.'/admin/modules.php?restore_lastsearch_values=1">'.$langs->trans("BackToModuleList").'</a>';
|
||||
print load_fiche_titre($langs->trans("RecruitmentSetup"), $linkback, 'title_setup');
|
||||
|
||||
$head = recruitmentAdminPrepareHead();
|
||||
|
||||
|
||||
|
||||
print '<form action="'.$_SERVER["PHP_SELF"].'" method="post">';
|
||||
print '<input type="hidden" name="action" value="update">';
|
||||
print '<input type="hidden" name="token" value="'.newToken().'">';
|
||||
|
||||
dol_fiche_head($head, 'publicurl', '', -1, '');
|
||||
|
||||
|
||||
print '<span class="opacitymedium">'.$langs->trans("PublicInterfaceRecruitmentDesc").'</span><br><br>';
|
||||
|
||||
|
||||
$enabledisablehtml = $langs->trans("EnablePublicRecruitmentPages").' ';
|
||||
if (empty($conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE)) {
|
||||
// Button off, click to enable
|
||||
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setRECRUITMENT_ENABLE_PUBLIC_INTERFACE&value=1'.$param.'">';
|
||||
$enabledisablehtml .= img_picto($langs->trans("Disabled"), 'switch_off');
|
||||
$enabledisablehtml .= '</a>';
|
||||
} else {
|
||||
// Button on, click to disable
|
||||
$enabledisablehtml .= '<a class="reposition valignmiddle" href="'.$_SERVER["PHP_SELF"].'?action=setRECRUITMENT_ENABLE_PUBLIC_INTERFACE&value=0'.$param.'">';
|
||||
$enabledisablehtml .= img_picto($langs->trans("Activated"), 'switch_on');
|
||||
$enabledisablehtml .= '</a>';
|
||||
}
|
||||
print $enabledisablehtml;
|
||||
print '<input type="hidden" id="RECRUITMENT_ENABLE_PUBLIC_INTERFACE" name="RECRUITMENT_ENABLE_PUBLIC_INTERFACE" value="'.(empty($conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE) ? 0 : 1).'">';
|
||||
|
||||
|
||||
print '<br>';
|
||||
|
||||
/*
|
||||
if (!empty($conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<br>';
|
||||
|
||||
print '<table class="noborder centpercent">';
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>'.$langs->trans("Parameter").'</td>';
|
||||
print '<td class="right">'.$langs->trans("Value").'</td>';
|
||||
print "</tr>\n";
|
||||
|
||||
// Force Type
|
||||
$adht = new AdherentType($db);
|
||||
print '<tr class="oddeven drag" id="trforcetype"><td>';
|
||||
print $langs->trans("ForceMemberType");
|
||||
print '</td><td class="right">';
|
||||
$listofval = array();
|
||||
$listofval += $adht->liste_array();
|
||||
$forcetype = $conf->global->MEMBER_NEWFORM_FORCETYPE ?: -1;
|
||||
print $form->selectarray("MEMBER_NEWFORM_FORCETYPE", $listofval, $forcetype, count($listofval) > 1 ? 1 : 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Amount
|
||||
print '<tr class="oddeven" id="tramount"><td>';
|
||||
print $langs->trans("DefaultAmount");
|
||||
print '</td><td class="right">';
|
||||
print '<input type="text" id="MEMBER_NEWFORM_AMOUNT" name="MEMBER_NEWFORM_AMOUNT" size="5" value="'.(!empty($conf->global->MEMBER_NEWFORM_AMOUNT) ? $conf->global->MEMBER_NEWFORM_AMOUNT : '').'">';
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Can edit
|
||||
print '<tr class="oddeven" id="tredit"><td>';
|
||||
print $langs->trans("CanEditAmount");
|
||||
print '</td><td class="right">';
|
||||
print $form->selectyesno("MEMBER_NEWFORM_EDITAMOUNT", (!empty($conf->global->MEMBER_NEWFORM_EDITAMOUNT) ? $conf->global->MEMBER_NEWFORM_EDITAMOUNT : 0), 1);
|
||||
print "</td></tr>\n";
|
||||
|
||||
// Jump to an online payment page
|
||||
print '<tr class="oddeven" id="trpayment"><td>';
|
||||
print $langs->trans("MEMBER_NEWFORM_PAYONLINE");
|
||||
print '</td><td class="right">';
|
||||
$listofval = array();
|
||||
$listofval['-1'] = $langs->trans('No');
|
||||
$listofval['all'] = $langs->trans('Yes').' ('.$langs->trans("VisitorCanChooseItsPaymentMode").')';
|
||||
if (!empty($conf->paybox->enabled)) $listofval['paybox'] = 'Paybox';
|
||||
if (!empty($conf->paypal->enabled)) $listofval['paypal'] = 'PayPal';
|
||||
if (!empty($conf->stripe->enabled)) $listofval['stripe'] = 'Stripe';
|
||||
print $form->selectarray("MEMBER_NEWFORM_PAYONLINE", $listofval, (!empty($conf->global->MEMBER_NEWFORM_PAYONLINE) ? $conf->global->MEMBER_NEWFORM_PAYONLINE : ''), 0);
|
||||
print "</td></tr>\n";
|
||||
|
||||
print '</table>';
|
||||
|
||||
print '<div class="center">';
|
||||
print '<input type="submit" class="button" value="'.$langs->trans("Modify").'">';
|
||||
print '</div>';
|
||||
}
|
||||
*/
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
print '</form>';
|
||||
|
||||
/*
|
||||
if (!empty($conf->global->RECRUITMENT_ENABLE_PUBLIC_INTERFACE)) {
|
||||
print '<br>';
|
||||
//print $langs->trans('FollowingLinksArePublic').'<br>';
|
||||
print img_picto('', 'globe').' '.$langs->trans('BlankSubscriptionForm').':<br>';
|
||||
if ($conf->multicompany->enabled) {
|
||||
$entity_qr = '?entity='.$conf->entity;
|
||||
} else {
|
||||
$entity_qr = '';
|
||||
}
|
||||
|
||||
// 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
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
print '<a target="_blank" href="'.$urlwithroot.'/public/members/new.php'.$entity_qr.'">'.$urlwithroot.'/public/members/new.php'.$entity_qr.'</a>';
|
||||
}
|
||||
*/
|
||||
|
||||
// End of page
|
||||
llxFooter();
|
||||
$db->close();
|
||||
@ -40,7 +40,7 @@ global $langs, $user;
|
||||
|
||||
// Libraries
|
||||
require_once DOL_DOCUMENT_ROOT."/core/lib/admin.lib.php";
|
||||
require_once '../lib/recruitment.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/recruitment/lib/recruitment.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT."/recruitment/class/recruitmentjobposition.class.php";
|
||||
|
||||
// Translations
|
||||
@ -194,10 +194,10 @@ print load_fiche_titre($langs->trans($page_name), $linkback, 'title_setup');
|
||||
|
||||
// Configuration header
|
||||
$head = recruitmentAdminPrepareHead();
|
||||
dol_fiche_head($head, 'settings', '', -1, "object_recruitment");
|
||||
dol_fiche_head($head, 'settings', '', -1, '');
|
||||
|
||||
// Setup page goes here
|
||||
echo '<span class="opacitymedium">'.$langs->trans("RecruitmentSetupPage").'</span><br><br>';
|
||||
//echo '<span class="opacitymedium">'.$langs->trans("RecruitmentSetupPage").'</span><br><br>';
|
||||
|
||||
|
||||
if ($action == 'edit')
|
||||
|
||||
@ -40,12 +40,10 @@ function recruitmentAdminPrepareHead()
|
||||
$head[$h][2] = 'settings';
|
||||
$h++;
|
||||
|
||||
/*
|
||||
$head[$h][0] = dol_buildpath("/recruitment/admin/about.php", 1);
|
||||
$head[$h][1] = $langs->trans("About");
|
||||
$head[$h][2] = 'about';
|
||||
$head[$h][0] = dol_buildpath("/recruitment/admin/public_interface.php", 1);
|
||||
$head[$h][1] = $langs->trans("PublicUrl");
|
||||
$head[$h][2] = 'publicurl';
|
||||
$h++;
|
||||
*/
|
||||
|
||||
// Show more tabs from modules
|
||||
// Entries must be declared in modules descriptor with line
|
||||
|
||||
@ -88,3 +88,40 @@ function recruitmentjobpositionPrepareHead($object)
|
||||
|
||||
return $head;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return string with full Url
|
||||
*
|
||||
* @param int $mode 0=True url, 1=Url formated with colors
|
||||
* @param string $ref Ref of object
|
||||
* @param string $localorexternal 0=Url for browser, 1=Url for external access
|
||||
* @return string Url string
|
||||
*/
|
||||
function getPublicJobPositionUrl($mode, $ref = '', $localorexternal = 0)
|
||||
{
|
||||
global $conf, $dolibarr_main_url_root;
|
||||
|
||||
$ref = str_replace(' ', '', $ref);
|
||||
$out = '';
|
||||
|
||||
// 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
|
||||
//$urlwithroot=DOL_MAIN_URL_ROOT; // This is to use same domain name than current
|
||||
|
||||
$urltouse = DOL_MAIN_URL_ROOT;
|
||||
if ($localorexternal) $urltouse = $urlwithroot;
|
||||
|
||||
$out = $urltouse.'/public/recruitment/view.php?ref='.($mode ? '<font color="#666666">' : '').$ref.($mode ? '</font>' : '');
|
||||
/*if (!empty($conf->global->RECRUITMENT_SECURITY_TOKEN))
|
||||
{
|
||||
if (empty($conf->global->RECRUITMENT_SECURITY_TOKEN)) $out .= '&securekey='.$conf->global->RECRUITMENT_SECURITY_TOKEN;
|
||||
else $out .= '&securekey='.dol_hash($conf->global->RECRUITMENT_SECURITY_TOKEN, 2);
|
||||
}*/
|
||||
|
||||
// For multicompany
|
||||
if (!empty($out) && !empty($conf->multicompany->enabled)) $out .= "&entity=".$conf->entity; // Check the entity because we may have the same reference in several entities
|
||||
|
||||
return $out;
|
||||
}
|
||||
|
||||
@ -572,6 +572,22 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
||||
$linktoelem = $form->showLinkToObjectBlock($object, null, array('recruitmentjobposition'));
|
||||
$somethingshown = $form->showLinkedObjectBlock($object, $linktoelem);
|
||||
|
||||
// Show link to public job page
|
||||
if ($object->status != RecruitmentJobPosition::STATUS_DRAFT)
|
||||
{
|
||||
print '<br><!-- Link to go on public job page -->'."\n";
|
||||
// Load translation files required by the page
|
||||
$langs->loadLangs(array('recruitment'));
|
||||
|
||||
$out = img_picto('', 'globe').' '.$langs->trans("PublicUrl").'<br>';
|
||||
|
||||
$url = getPublicJobPositionUrl(0, $object->ref);
|
||||
$out .= '<input type="text" id="recruitmentjobpositionurl" class="quatrevingtpercent" value="'.$url.'">';
|
||||
$out .= '<a href="'.$url.'" target="_blank">'.img_picto('', 'globe').'</a>';
|
||||
$out .= ajax_autoselect("recruitmentjobpositionurl", 0);
|
||||
|
||||
print $out;
|
||||
}
|
||||
|
||||
print '</div><div class="fichehalfright"><div class="ficheaddleft">';
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user