41 $head[0][0] =
'card.php?id='.$object->id_sondage;
42 $head[0][1] = $langs->trans(
"Survey");
43 $head[0][2] =
'general';
46 $head[1][0] =
'results.php?id='.$object->id_sondage;
47 $head[1][1] = $langs->trans(
"SurveyResults");
48 $nbVotes =
$object->countVotes();
50 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbVotes).
'</span>';
52 $head[1][2] =
'preview';
78function llxHeaderSurvey($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $numsondage =
'')
80 global $conf, $langs, $mysoc;
81 global $dolibarr_main_url_root;
85 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, 1);
87 print
'<body id="mainbody" class="publicnewmemberform">';
89 print
'<span id="dolpaymentspan"></span>'.
"\n";
90 print
'<div class="center">'.
"\n";
91 print
'<form name="formulaire" action="studs.php?sondage='.urlencode($numsondage).
'#bas" method="POST">'.
"\n";
92 print
'<input type="hidden" name="sondage" value="'.$numsondage.
'"/>';
93 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
98 $logosmall = $mysoc->logo_small;
104 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
105 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
106 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
107 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
108 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
109 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
114 print
'<div class="backgreypublicpayment">';
115 print
'<div class="logopublicpayment">';
116 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'"';
120 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 src="'.DOL_URL_ROOT.
'/theme/dolibarr_logo.svg" width="80px"></a></div>';
126 print
'<div class="backimagepublicopensurvey">';
127 print
'<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'OPENSURVEY_IMAGE_PUBLIC_INTERFACE').
'">';
131 print
'<div class="survey_borders"><br><br>';
161 global $dolibarr_main_url_root;
163 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
167 $url = $urlwithouturlroot.dol_buildpath(
'/opensurvey/', 1);
169 if (!preg_match(
"|/$|", $url)) {
185 if ($tableau ===
null) {
189 return (isset($tableau[$name]) && !empty($tableau[$name]));
202 if ($admin ===
true) {
221 $chaine =
"abcdefghijklmnopqrstuvwxyz123456789";
222 mt_srand((
int) ((
float) microtime() * 1000000));
223 for ($i = 0; $i < $car; $i++) {
224 $string .= $chaine[mt_rand() % strlen($chaine)];
238 require_once DOL_DOCUMENT_ROOT.
'/opensurvey/class/opensurveysondage.class.php';
242 $allow_comments = empty($_SESSION[
'allow_comments']) ? 0 : 1;
243 $allow_spy = empty($_SESSION[
'allow_spy']) ? 0 : 1;
247 $opensurveysondage->id_sondage = $sondage;
248 $opensurveysondage->description = $_SESSION[
'description'];
249 $opensurveysondage->mail_admin = $_SESSION[
'adresse'];
250 $opensurveysondage->nom_admin = $_SESSION[
'nom'];
251 $opensurveysondage->title = $_SESSION[
'title'];
252 $opensurveysondage->date_fin = $_SESSION[
'champdatefin'];
253 $opensurveysondage->format = $_SESSION[
'formatsondage'];
254 $opensurveysondage->mailsonde = $_SESSION[
'mailsonde'];
255 $opensurveysondage->allow_comments = $allow_comments;
256 $opensurveysondage->allow_spy = $allow_spy;
257 $opensurveysondage->sujet = $_SESSION[
'toutchoix'];
259 $res = $opensurveysondage->create($user);
265 unset($_SESSION[
"title"]);
266 unset($_SESSION[
"nom"]);
267 unset($_SESSION[
"adresse"]);
268 unset($_SESSION[
"description"]);
269 unset($_SESSION[
"mailsonde"]);
270 unset($_SESSION[
'allow_comments']);
271 unset($_SESSION[
'allow_spy']);
272 unset($_SESSION[
'toutchoix']);
273 unset($_SESSION[
'totalchoixjour']);
274 unset($_SESSION[
'champdatefin']);
276 $urlback =
dol_buildpath(
'/opensurvey/card.php', 1).
'?id='.$sondage;
278 header(
"Location: ".$urlback);
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $object
Put here description of your class.
printCommonFooter($zone='private')
Print common footer : conf->global->MAIN_HTML_FOOTER js for switch of menu hider js for conf->global-...
dol_htmloutput_events($disabledoutputofmessages=0)
Print formatted messages to output (Used to show messages on html output).
dol_buildpath($path, $type=0, $returnemptyifnotfound=0)
Return path of url or filesystem.
dol_print_error($db=null, $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
complete_head_from_modules($conf, $langs, $object, &$head, &$h, $type, $mode='add', $filterorigmodule='')
Complete or removed entries into a head array (used to build tabs).
getDolGlobalString($key, $default='')
Return a Dolibarr global constant string value.
top_htmlhead($head, $title='', $disablejs=0, $disablehead=0, $arrayofjs=array(), $arrayofcss=array(), $disableforlogin=0, $disablenofollow=0, $disablenoindex=0)
Output html header of a page.
llxFooterSurvey()
Show footer for new member.
get_server_name()
get_server_name
opensurvey_prepare_head(Opensurveysondage $object)
Returns an array with the tabs for the "Opensurvey poll" section It loads tabs from modules looking f...
getUrlSondage($id, $admin=false)
Fonction permettant de générer les URL pour les sondage.
llxHeaderSurvey($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[], $numsondage='')
Show header for new member.
dol_survey_random($car)
Generate a random id.
issetAndNoEmpty($name, $tableau=null)
Fonction vérifiant l'existance et la valeur non vide d'une clé d'un tableau.
ajouter_sondage()
Add a poll.