24if (!defined(
'NOLOGIN')) {
27if (!defined(
'NOCSRFCHECK')) {
28 define(
"NOCSRFCHECK", 1);
30if (!defined(
'NOIPCHECK')) {
31 define(
'NOIPCHECK',
'1');
33if (!defined(
'NOBROWSERNOTIF')) {
34 define(
'NOBROWSERNOTIF',
'1');
38require
'../../main.inc.php';
39require_once DOL_DOCUMENT_ROOT.
'/opensurvey/class/opensurveysondage.class.php';
40require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
45$langs->loadLangs(array(
"companies",
"other",
"opensurveys"));
48$action =
GETPOST(
'action',
'aZ09');
49$cancel =
GETPOST(
'cancel',
'alpha');
50$SECUREKEY =
GETPOST(
"securekey");
51$entity =
GETPOST(
'entity',
'int') ?
GETPOST(
'entity',
'int') : $conf->entity;
56$limit =
GETPOST(
'limit',
'int') ?
GETPOST(
'limit',
'int') : $conf->liste_limit;
57$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
58$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
59$page = GETPOSTISSET(
'pageplusone') ? (
GETPOST(
'pageplusone') - 1) :
GETPOST(
"page",
'int');
60if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
63$offset = $limit * $page;
68 unset($_SESSION[
'email_customer']);
70if (isset($_SESSION[
'email_customer'])) {
71 $email = $_SESSION[
'email_customer'];
79$urlwithroot = DOL_MAIN_URL_ROOT;
82if (!isModEnabled(
'opensurvey')) {
100 $head =
'<link rel="stylesheet" type="text/css" href="'.getDolGlobalString(
'MAIN_OPENSURVEY_CSS_URL').
'?lang='.$langs->defaultlang.
'">'.
"\n";
103$conf->dol_hide_topmenu = 1;
104$conf->dol_hide_leftmenu = 1;
107 $langs->load(
"errors");
108 print
'<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
114$arrayofcss = array();
116$replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
117llxHeader($head, $langs->trans(
"Surveys"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea, 1, 1);
120print
'<span id="dolpaymentspan"></span>'.
"\n";
121print
'<div class="center">'.
"\n";
122print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
123print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
124print
'<input type="hidden" name="action" value="dosign">'.
"\n";
125print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
126print
'<input type="hidden" name="suffix" value="'.GETPOST(
"suffix",
'alpha').
'">'.
"\n";
127print
'<input type="hidden" name="securekey" value="'.$SECUREKEY.
'">'.
"\n";
128print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
130print
'<!-- Form to view jobs -->'.
"\n";
134$logosmall = $mysoc->logo_small;
136$paramlogo =
'ONLINE_OPENSURVEY_LOGO_'.$suffix;
137if (!empty($conf->global->$paramlogo)) {
138 $logosmall = $conf->global->$paramlogo;
140 $logosmall = $conf->global->ONLINE_OPENSURVEY_LOGO_;
146if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
147 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
148 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
149} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
150 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
151 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
155 print
'<div class="backgreypublicpayment">';
156 print
'<div class="logopublicpayment">';
157 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'">';
160 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>';
166 print
'<div class="backimagepublicrecruitment">';
167 print
'<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'OPENSURVEY_IMAGE_PUBLIC_INTERFACE').
'">';
172$results = $object->fetchAll($sortfield, $sortorder, 0, 0, array(
'status' => 1));
175if (is_array($results)) {
176 if (empty($results)) {
178 print $langs->trans(
"NoSurvey");
180 print
'<br><br><br>';
181 print
'<span class="opacitymedium">'.$langs->trans(
"ListOfOpenSurveys").
'</span>';
182 print
'<br><br><br>';
183 print
'<br class="hideonsmartphone">';
185 foreach ($results as $survey) {
188 print
'<table id="dolpaymenttable" summary="Job position offer" class="center centpercent">'.
"\n";
191 print
'<tr><td class="left">';
193 print
'<div class="centpercent" id="tablepublicpayment">';
199 print $langs->trans(
"Label").
' : ';
200 print
'<b>'.dol_escape_htmltag($object->title).
'</b><br>';
203 print $langs->trans(
"DateExpected").
' : ';
205 if ($object->date_fin > $now) {
208 print $langs->trans(
"ASAP");
215 print
'<div class="opensurveydescription centpercent">';
225 if ($action !=
'dosubmit') {
226 if ($found && !$error) {
235 print
'</td></tr>'.
"\n";
237 print
'</table>'.
"\n";
239 print
'<br><br class="hideonsmartphone"><br class="hideonsmartphone"><br class="hideonsmartphone">'.
"\n";
if(!defined('NOREQUIRESOC')) if(!defined( 'NOREQUIRETRAN')) if(!defined('NOTOKENRENEWAL')) if(!defined( 'NOREQUIREMENU')) if(!defined('NOREQUIREHTML')) if(!defined( 'NOREQUIREAJAX')) llxHeader()
Empty header.
Put here description of your class.
htmlPrintOnlineFooter($fromcompany, $langs, $addformmessage=0, $suffix='', $object=null)
Show footer of company in HTML pages.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0)
Clean a string to keep only desirable HTML tags.
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.
dol_htmlentitiesbr($stringtoencode, $nl2brmode=0, $pagecodefrom='UTF-8', $removelasteolbr=1)
This function is called to encode a string into a HTML string but differs from htmlentities because a...
dol_htmlwithnojs($stringtoencode, $nouseofiframesandbox=0, $check='restricthtml')
Sanitize a HTML to remove js, dangerous content and external link.
getDolGlobalString($key, $default='')
Return dolibarr global constant string value.
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.