40 $head[0][0] =
'card.php?id='.$object->id_sondage;
41 $head[0][1] = $langs->trans(
"Survey");
42 $head[0][2] =
'general';
45 $head[1][0] =
'results.php?id='.$object->id_sondage;
46 $head[1][1] = $langs->trans(
"SurveyResults");
47 $nbVotes =
$object->countVotes();
49 $head[$h][1] .=
'<span class="badge marginleftonlyshort">'.($nbVotes).
'</span>';
51 $head[1][2] =
'preview';
77function llxHeaderSurvey($title, $head =
"", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = [], $numsondage =
'')
79 global $conf, $langs, $mysoc;
80 global $dolibarr_main_url_root;
84 top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss, 0, 1);
86 print
'<body id="mainbody" class="publicnewmemberform">';
88 print
'<span id="dolpaymentspan"></span>'.
"\n";
89 print
'<div class="center">'.
"\n";
90 print
'<form name="formulaire" action="studs.php?sondage='.urlencode($numsondage).
'#bas" method="POST">'.
"\n";
91 print
'<input type="hidden" name="sondage" value="'.$numsondage.
'"/>';
92 print
'<input type="hidden" name="token" value="'.newToken().
'">'.
"\n";
97 $logosmall = $mysoc->logo_small;
103 if (!empty($logosmall) && is_readable($conf->mycompany->dir_output.
'/logos/thumbs/'.$logosmall)) {
104 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
105 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/thumbs/'.$logosmall);
106 } elseif (!empty($logo) && is_readable($conf->mycompany->dir_output.
'/logos/'.$logo)) {
107 $urllogo = DOL_URL_ROOT.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
108 $urllogofull = $dolibarr_main_url_root.
'/viewimage.php?modulepart=mycompany&entity='.$conf->entity.
'&file='.urlencode(
'logos/'.$logo);
113 print
'<div class="backgreypublicpayment">';
114 print
'<div class="logopublicpayment">';
115 print
'<img id="dolpaymentlogo" src="'.$urllogo.
'"';
119 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>';
125 print
'<div class="backimagepublicopensurvey">';
126 print
'<img id="idOPENSURVEY_IMAGE_PUBLIC_INTERFACE" src="' .
getDolGlobalString(
'OPENSURVEY_IMAGE_PUBLIC_INTERFACE').
'">';
130 print
'<div class="survey_borders"><br><br>';
160 global $dolibarr_main_url_root;
162 $urlwithouturlroot = preg_replace(
'/'.preg_quote(DOL_URL_ROOT,
'/').
'$/i',
'', trim($dolibarr_main_url_root));
166 $url = $urlwithouturlroot.dol_buildpath(
'/opensurvey/', 1);
168 if (!preg_match(
"|/$|", $url)) {
184 if ($tableau ===
null) {
188 return (isset($tableau[$name]) && !empty($tableau[$name]));
201 if ($admin ===
true) {
220 $chaine =
"abcdefghijklmnopqrstuvwxyz123456789";
221 mt_srand((
int) ((
float) microtime() * 1000000));
222 for ($i = 0; $i < $car; $i++) {
223 $string .= $chaine[mt_rand() % strlen($chaine)];
237 require_once DOL_DOCUMENT_ROOT.
'/opensurvey/class/opensurveysondage.class.php';
241 $allow_comments = empty($_SESSION[
'allow_comments']) ? 0 : 1;
242 $allow_spy = empty($_SESSION[
'allow_spy']) ? 0 : 1;
246 $opensurveysondage->id_sondage = $sondage;
247 $opensurveysondage->description = $_SESSION[
'description'];
248 $opensurveysondage->mail_admin = $_SESSION[
'adresse'];
249 $opensurveysondage->nom_admin = $_SESSION[
'nom'];
250 $opensurveysondage->title = $_SESSION[
'title'];
251 $opensurveysondage->date_fin = $_SESSION[
'champdatefin'];
252 $opensurveysondage->format = $_SESSION[
'formatsondage'];
253 $opensurveysondage->mailsonde = $_SESSION[
'mailsonde'];
254 $opensurveysondage->allow_comments = $allow_comments;
255 $opensurveysondage->allow_spy = $allow_spy;
256 $opensurveysondage->sujet = $_SESSION[
'toutchoix'];
258 $res = $opensurveysondage->create($user);
264 unset($_SESSION[
"title"]);
265 unset($_SESSION[
"nom"]);
266 unset($_SESSION[
"adresse"]);
267 unset($_SESSION[
"description"]);
268 unset($_SESSION[
"mailsonde"]);
269 unset($_SESSION[
'allow_comments']);
270 unset($_SESSION[
'allow_spy']);
271 unset($_SESSION[
'toutchoix']);
272 unset($_SESSION[
'totalchoixjour']);
273 unset($_SESSION[
'champdatefin']);
275 $urlback =
dol_buildpath(
'/opensurvey/card.php', 1).
'?id='.$sondage;
277 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.