26if (!defined(
'NOLOGIN')) {
29if (!defined(
'NOCSRFCHECK')) {
30 define(
"NOCSRFCHECK", 1);
32if (!defined(
'NOIPCHECK')) {
33 define(
'NOIPCHECK',
'1');
35if (!defined(
'NOBROWSERNOTIF')) {
36 define(
'NOBROWSERNOTIF',
'1');
48require
'../../main.inc.php';
49require_once DOL_DOCUMENT_ROOT.
'/opensurvey/class/opensurveysondage.class.php';
50require_once DOL_DOCUMENT_ROOT.
'/core/lib/security.lib.php';
51require_once DOL_DOCUMENT_ROOT.
'/core/lib/company.lib.php';
52require_once DOL_DOCUMENT_ROOT.
'/core/lib/payments.lib.php';
55$langs->loadLangs(array(
"companies",
"other",
"opensurveys"));
58$action =
GETPOST(
'action',
'aZ09');
59$cancel =
GETPOST(
'cancel',
'alpha');
60$SECUREKEY =
GETPOST(
"securekey");
67$sortfield =
GETPOST(
'sortfield',
'aZ09comma');
68$sortorder =
GETPOST(
'sortorder',
'aZ09comma');
70if (empty($page) || $page < 0 ||
GETPOST(
'button_search',
'alpha') ||
GETPOST(
'button_removefilter',
'alpha')) {
73$offset = $limit * $page;
78 unset($_SESSION[
'email_customer']);
80if (isset($_SESSION[
'email_customer'])) {
81 $email = $_SESSION[
'email_customer'];
89$urlwithroot = DOL_MAIN_URL_ROOT;
92if (!isModEnabled(
'opensurvey')) {
110 $head =
'<link rel="stylesheet" type="text/css" href="'.getDolGlobalString(
'MAIN_OPENSURVEY_CSS_URL').
'?lang='.$langs->defaultlang.
'">'.
"\n";
113$conf->dol_hide_topmenu = 1;
114$conf->dol_hide_leftmenu = 1;
117 $langs->load(
"errors");
118 print
'<div class="error">'.$langs->trans(
'ErrorPublicInterfaceNotEnabled').
'</div>';
124$arrayofcss = array();
126$replacemainarea = (empty(
$conf->dol_hide_leftmenu) ?
'<div>' :
'').
'<div>';
127llxHeader($head, $langs->trans(
"Surveys"),
'',
'', 0, 0,
'',
'',
'',
'onlinepaymentbody', $replacemainarea, 1, 1);
130print
'<span id="dolpaymentspan"></span>'.
"\n";
131print
'<div class="center">'.
"\n";
132print
'<form id="dolpaymentform" class="center" name="paymentform" action="'.$_SERVER[
"PHP_SELF"].
'" method="POST">'.
"\n";
133print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
134print
'<input type="hidden" name="action" value="dosign">'.
"\n";
135print
'<input type="hidden" name="tag" value="'.GETPOST(
"tag",
'alpha').
'">'.
"\n";
136print
'<input type="hidden" name="suffix" value="'.GETPOST(
"suffix",
'alpha').
'">'.
"\n";
137print
'<input type="hidden" name="securekey" value="'.$SECUREKEY.
'">'.
"\n";
138print
'<input type="hidden" name="entity" value="'.$entity.
'" />';
140print
'<!-- Form to view jobs -->'.
"\n";
144$logosmall = $mysoc->logo_small;
146$paramlogo =
'ONLINE_OPENSURVEY_LOGO_'.$suffix;
156if (!empty($logosmall) && is_readable(
$conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
157 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.
$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
158 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.
$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
159} elseif (!empty($logo) && is_readable(
$conf->mycompany->dir_output.
'/logos/'.$logo)) {
160 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.
$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
161 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.
$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
165 print
'<div class="backgreypublicpayment">';
166 print
'<div class="logopublicpayment">';
167 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'">';
170 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>';
176 print
'<div class="backimagepublicrecruitment">';
177 print
'<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'OPENSURVEY_IMAGE_PUBLIC_INTERFACE').
'">';
182$results =
$object->fetchAll($sortorder, $sortfield, 0, 0,
'(status:=:1)');
185if (is_array($results)) {
186 if (empty($results)) {
188 print $langs->trans(
"NoSurvey");
190 print
'<br><br><br>';
191 print
'<span class="opacitymedium">'.$langs->trans(
"ListOfOpenSurveys").
'</span>';
192 print
'<br><br><br>';
193 print
'<br class="hideonsmartphone">';
195 foreach ($results as $survey) {
198 print
'<table id="dolpaymenttable" summary="Job position offer" class="center centpercent">'.
"\n";
201 print
'<tr><td class="left">';
203 print
'<div class="centpercent" id="tablepublicpayment">';
209 print $langs->trans(
"Label").
' : ';
210 print
'<b>'.dol_escape_htmltag(
$object->title).
'</b><br>';
213 print $langs->trans(
"DateExpected").
' : ';
215 if (
$object->date_fin > $now) {
218 print $langs->trans(
"ASAP");
225 print
'<div class="opensurveydescription centpercent">';
235 if ($action !=
'dosubmit') {
236 if ($found && !$error) {
245 print
'</td></tr>'.
"\n";
247 print
'</table>'.
"\n";
249 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.
global $conf
The following vars must be defined: $type2label $form $conf, $lang, The following vars may also be de...
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.