25if (!defined(
'NOLOGIN')) {
28if (!defined(
'NOCSRFCHECK')) {
29 define(
"NOCSRFCHECK", 1);
31if (!defined(
'NOIPCHECK')) {
32 define(
'NOIPCHECK',
'1');
34if (!defined(
'NOBROWSERNOTIF')) {
35 define(
'NOBROWSERNOTIF',
'1');
39require
'../../main.inc.php';
40require_once DOL_DOCUMENT_ROOT.
'/opensurvey/class/opensurveysondage.class.php';
41require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
42require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
43require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
46$langs->loadLangs(array(
"companies",
"other",
"opensurveys"));
49$action =
GETPOST(
'action',
'aZ09');
50$cancel =
GETPOST(
'cancel',
'alpha');
51$SECUREKEY =
GETPOST(
"securekey");
58$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
59$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
61if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
64$offset = $limit * $page;
69 unset($_SESSION[
'email_customer']);
71if (isset($_SESSION[
'email_customer'])) {
72 $email = $_SESSION[
'email_customer'];
80$urlwithroot = DOL_MAIN_URL_ROOT;
83if (!isModEnabled(
'opensurvey')) {
101 $head =
'<link rel="stylesheet" type="text/css" href="'.getDolGlobalString(
'MAIN_OPENSURVEY_CSS_URL').
'?lang='.$langs->defaultlang.
'">'.
"\n";
104$conf->dol_hide_topmenu = 1;
105$conf->dol_hide_leftmenu = 1;
108 $langs->load(
"errors");
109 print
'<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
115$arrayofcss = array();
117$replacemainarea = (empty($conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
118llxHeader($head, $langs->trans(
"Surveys"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea, 1, 1);
121print
'<span id="dolpaymentspan"></span>'.
"\n";
122print
'<div class="center">'.
"\n";
123print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
124print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
125print
'<input type="hidden" name="action" value="dosign">'.
"\n";
126print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
127print
'<input type="hidden" name="suffix" value="'.GETPOST(
"suffix",
'alpha').
'">'.
"\n";
128print
'<input type="hidden" name="securekey" value="'.$SECUREKEY.
'">'.
"\n";
129print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
131print
'<!-- Form to view jobs -->'.
"\n";
135$logosmall = $mysoc->logo_small;
137$paramlogo =
'ONLINE_OPENSURVEY_LOGO_'.$suffix;
147if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
148 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
149 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
150} elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
151 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
152 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
156 print
'<div class="backgreypublicpayment">';
157 print
'<div class="logopublicpayment">';
158 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'">';
161 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>';
167 print
'<div class="backimagepublicrecruitment">';
168 print
'<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'OPENSURVEY_IMAGE_PUBLIC_INTERFACE').
'">';
173$results =
$object->fetchAll($sortorder, $sortfield, 0, 0,
'(status:=:1)');
176if (is_array($results)) {
177 if (empty($results)) {
179 print $langs->trans(
"NoSurvey");
181 print
'<br><br><br>';
182 print
'<span class="opacitymedium">'.$langs->trans(
"ListOfOpenSurveys").
'</span>';
183 print
'<br><br><br>';
184 print
'<br class="hideonsmartphone">';
186 foreach ($results as $survey) {
189 print
'<table id="dolpaymenttable" summary="Job position offer" class="center centpercent">'.
"\n";
192 print
'<tr><td class="left">';
194 print
'<div class="centpercent" id="tablepublicpayment">';
200 print $langs->trans(
"Label").
' : ';
201 print
'<b>'.dol_escape_htmltag(
$object->title).
'</b><br>';
204 print $langs->trans(
"DateExpected").
' : ';
206 if (
$object->date_fin > $now) {
209 print $langs->trans(
"ASAP");
216 print
'<div class="opensurveydescription centpercent">';
226 if ($action !=
'dosubmit') {
227 if ($found && !$error) {
236 print
'</td></tr>'.
"\n";
238 print
'</table>'.
"\n";
240 print
'<br><br class="hideonsmartphone"><br class="hideonsmartphone"><br class="hideonsmartphone">'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
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.
Put here description of your class.
htmlPrintOnlineFooter($fromcompany, $langs, $addformmessage=0, $suffix='', $object=null)
Show footer of company in HTML pages.
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_string_onlythesehtmltags($stringtoclean, $cleanalsosomestyles=1, $removeclassattribute=1, $cleanalsojavascript=0, $allowiframe=0, $allowed_tags=array(), $allowlink=0, $allowscript=0, $allowstyle=0)
Clean a string to keep only desirable HTML tags.
dol_now($mode='auto')
Return date for now.
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.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
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 a 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.