27if (!defined(
'NOLOGIN')) {
30if (!defined(
'NOCSRFCHECK')) {
31 define(
"NOCSRFCHECK", 1);
33if (!defined(
'NOBROWSERNOTIF')) {
34 define(
'NOBROWSERNOTIF',
'1');
36if (!defined(
'NOIPCHECK')) {
37 define(
'NOIPCHECK',
'1');
41require
'../../main.inc.php';
48require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
49require_once DOL_DOCUMENT_ROOT.
"/core/lib/files.lib.php";
50require_once DOL_DOCUMENT_ROOT.
"/opensurvey/class/opensurveysondage.class.php";
51require_once DOL_DOCUMENT_ROOT.
"/opensurvey/lib/opensurvey.lib.php";
52require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
55$action =
GETPOST(
'action',
'aZ09');
58 $numsondage =
GETPOST(
'sondage',
'alpha');
62$result =
$object->fetch(
'', $numsondage);
64$nblines =
$object->fetch_lines();
79$nbcolonnes = substr_count(
$object->sujet,
',') + 1;
81$listofvoters = explode(
',', $_SESSION[
"savevoter"] ??
'');
86if (
GETPOST(
'ajoutcomment',
'alpha')) {
87 if (!$canbemodified) {
91 $comment =
GETPOST(
"comment",
'alphanohtml');
92 $comment_user =
GETPOST(
'commentuser',
'alphanohtml');
96 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Comment")),
null,
'errors');
100 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
103 if (!in_array($comment_user, $listofvoters)) {
104 setEventMessages($langs->trans(
"UserMustBeSameThanUserUsedToVote"),
null,
'errors');
109 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
114 if ($nb_post_max > 0) {
115 $sql =
"SELECT COUNT(id_comment) as nb_comments";
116 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_comments";
117 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
118 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
119 $resql =
$db->query($sql);
121 $num =
$db->num_rows($resql);
125 $obj =
$db->fetch_object($resql);
126 $nb_post_ip = $obj->nb_comments;
131 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
132 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
137 $resql =
$object->addComment($comment, $comment_user, $user_ip);
147 if (!$canbemodified) {
152 if (
GETPOST(
'nom',
'alphanohtml')) {
154 for ($i = 0; $i < $nbcolonnes; $i++) {
155 if (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'1') {
156 $nouveauchoix .=
"1";
157 } elseif (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'2') {
158 $nouveauchoix .=
"2";
160 $nouveauchoix .=
"0";
165 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
170 if ($nb_post_max > 0) {
171 $sql =
"SELECT COUNT(id_users) as nb_records";
172 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
173 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
174 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
175 $resql =
$db->query($sql);
177 $num =
$db->num_rows($resql);
181 $obj =
$db->fetch_object($resql);
182 $nb_post_ip = $obj->nb_records;
188 $nom = substr(
GETPOST(
"nom",
'alphanohtml'), 0, 64);
191 $sql =
'SELECT id_users, nom as name';
192 $sql .=
' FROM '.MAIN_DB_PREFIX.
'opensurvey_user_studs';
193 $sql .=
" WHERE id_sondage = '".$db->escape($numsondage).
"' AND nom = '".
$db->escape($nom).
"' ORDER BY id_users";
194 $resql =
$db->query($sql);
199 $num_rows =
$db->num_rows($resql);
204 } elseif ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
205 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
209 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.
'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)';
210 $sql .=
" VALUES ('".$db->escape($nom).
"', '".
$db->escape($numsondage).
"','".
$db->escape($nouveauchoix).
"', '".
$db->escape($user_ip).
"', '".
$db->idate($now).
"')";
211 $resql =
$db->query($sql);
215 $_SESSION[
"savevoter"] = $nom.
','.(empty($_SESSION[
"savevoter"]) ?
'' : $_SESSION[
"savevoter"]);
216 $listofvoters = explode(
',', $_SESSION[
"savevoter"]);
221 $userstatic->fetch(
$object->fk_user_creat);
223 $email = $userstatic->email;
230 include_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
232 $application = (
$conf->global->MAIN_APPLICATION_TITLE ?
$conf->global->MAIN_APPLICATION_TITLE :
'Dolibarr ERP/CRM');
235 $link =
'<a href="'.$link.
'">'.$link.
'</a>';
236 $body = str_replace(
'\n',
'<br>', $langs->transnoentities(
'EmailSomeoneVoted', $nom, $link));
239 $cmailfile =
new CMailFile(
"[".$application.
"] ".$langs->trans(
"Poll").
': '.
$object->title, $email,
$conf->global->MAIN_MAIL_EMAIL_FROM, $body,
null,
null,
null,
'',
'', 0, -1);
240 $result = $cmailfile->sendfile();
248 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
254$testmodifier =
false;
255$testligneamodifier =
false;
258for ($i = 0; $i < $nblines; $i++) {
259 if (GETPOSTISSET(
'modifierligne'.$i)) {
260 $ligneamodifier = $i;
261 $testligneamodifier =
true;
265 if (GETPOSTISSET(
'validermodifier'.$i)) {
267 $testmodifier =
true;
273 for ($i = 0; $i < $nbcolonnes; $i++) {
274 if (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'1') {
275 $nouveauchoix .=
"1";
276 } elseif (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'2') {
277 $nouveauchoix .=
"2";
279 $nouveauchoix .=
"0";
283 if (!$canbemodified) {
287 $idtomodify =
GETPOST(
"idtomodify".$modifier);
288 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"opensurvey_user_studs";
289 $sql .=
" SET reponses = '".$db->escape($nouveauchoix).
"'";
290 $sql .=
" WHERE id_users = '".$db->escape($idtomodify).
"'";
292 $resql =
$db->query($sql);
301 if (!$canbemodified) {
305 $resql =
$object->deleteComment($idcomment);
317$arrayofcss = array(
'/opensurvey/css/style.css');
322 $langs->load(
"errors");
323 print $langs->trans(
"ErrorRecordNotFound");
332$toutsujet = explode(
",",
$object->sujet);
333$listofanswers = array();
334foreach ($toutsujet as $value) {
335 $tmp = explode(
'@', $value);
336 $listofanswers[] = array(
'label' => $tmp[0],
'format' => (!empty($tmp[1]) ? $tmp[1] :
'checkbox'));
338$toutsujet = str_replace(
"°",
"'", $toutsujet);
341print
'<div class="survey_intro">';
342print
'<div class="survey_invitation">'.$langs->trans(
"YouAreInivitedToVote").
'</div>';
343print
'<div class="small">';
344print
'<span class="opacitymedium">'.$langs->trans(
"OpenSurveyHowTo").
'</span><br>';
345if (empty(
$object->allow_spy)) {
346 print
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPrivate").
'</span><br>';
348 print $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPublic").
'</span>', $langs->trans(
"CanSeeOthersVote")).
'<br>';
354if (empty(
$object->description)) {
355 print
'<div class="corps">'.
"\n";
361$titre = str_replace(
"\\",
"",
$object->title);
362print
'<div class="survey_title">'.img_picto(
'',
'poll',
'class="size15x paddingright"').
' <strong>'.
dol_htmlentities($titre).
'</strong></div>';
364if (!empty(
$object->description)) {
365 print
'<br><div class="corps">'.
"\n";
376if (!$canbemodified) {
377 print
'<br><center><div class="center warning">'.$langs->trans(
'SurveyExpiredInfo').
'</div></center>';
384print
'<div class="cadre"> '.
"\n";
385print
'<br><br>'.
"\n";
388print
'<div class="div-table-responsive">';
389print
'<table class="resultats">'.
"\n";
395 print
'<td></td>'.
"\n";
399 $nbofsujet = count($toutsujet);
400 for ($i = 0; $i < $nbofsujet; $i++) {
401 if (isset($toutsujet[$i + 1]) &&
date(
'Y', intval($toutsujet[$i])) ==
date(
'Y', intval($toutsujet[$i + 1]))) {
404 print
'<td colspan='.$colspan.
' class="annee">'.
date(
'Y', intval($toutsujet[$i])).
'</td>'.
"\n";
411 print
'<td></td>'.
"\n";
415 for ($i = 0; $i < $nbofsujet; $i++) {
416 $cur = intval($toutsujet[$i]);
418 if (!isset($toutsujet[$i + 1])) {
421 $next = intval($toutsujet[$i + 1]);
427 print
'<td colspan='.$colspan.
' class="mois">'.
dol_print_date($cur,
"%B").
'</td>'.
"\n";
434 print
'<td></td>'.
"\n";
438 for ($i = 0; $i < $nbofsujet; $i++) {
439 $cur = intval($toutsujet[$i]);
440 if (!isset($toutsujet[$i + 1])) {
443 $next = intval($toutsujet[$i + 1]);
448 print
'<td colspan="'.$colspan.
'" class="jour">'.
dol_print_date($cur,
"%a %d").
'</td>'.
"\n";
456 if (strpos(
$object->sujet,
'@') !==
false) {
458 print
'<td></td>'.
"\n";
460 for ($i = 0; isset($toutsujet[$i]); $i++) {
461 $heures = explode(
'@', $toutsujet[$i]);
462 if (isset($heures[1])) {
463 print
'<td class="heure">'.dol_htmlentities($heures[1]).
'</td>'.
"\n";
465 print
'<td class="heure"></td>'.
"\n";
474 print
'<td></td>'.
"\n";
476 for ($i = 0; isset($toutsujet[$i]); $i++) {
477 $tmp = explode(
'@', $toutsujet[$i]);
478 print
'<td class="sujet">'.dol_escape_htmltag($tmp[0]).
'</td>'.
"\n";
486$currentusername =
'';
488$sumagainst = array();
490$sql =
"SELECT id_users, nom as name, id_sondage, reponses";
491$sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
492$sql .=
" WHERE id_sondage = '".$db->escape($numsondage).
"'";
493$resql =
$db->query($sql);
498$num =
$db->num_rows($resql);
499while ($compteur < $num) {
500 $obj =
$db->fetch_object($resql);
502 $ensemblereponses = $obj->reponses;
505 $mod_ok = (in_array($obj->name, $listofvoters));
507 if (!$mod_ok && !
$object->allow_spy) {
515 print
'<td class="nom">'.img_picto($obj->name,
'user',
'class="pictofixedwidth"').dol_htmlentities($obj->name).
'</td>'.
"\n";
518 if (!$testligneamodifier) {
519 for ($i = 0; $i < $nbcolonnes; $i++) {
520 $car = substr($ensemblereponses, $i, 1);
523 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
524 if (((
string) $car) ==
"1") {
525 print
'<td class="ok">OK</td>'.
"\n";
527 print
'<td class="non">KO</td>'.
"\n";
530 if (!isset($sumfor[$i])) {
533 if (((
string) $car) ==
"1") {
537 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
538 if (((
string) $car) ==
"1") {
539 print
'<td class="ok">'.$langs->trans(
"Yes").
'</td>'.
"\n";
540 } elseif (((
string) $car) ==
"0") {
541 print
'<td class="non">'.$langs->trans(
"No").
'</td>'.
"\n";
543 print
'<td class="vide"> </td>'.
"\n";
546 if (!isset($sumfor[$i])) {
549 if (!isset($sumagainst[$i])) {
552 if (((
string) $car) ==
"1") {
555 if (((
string) $car) ==
"0") {
559 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
560 if (((
string) $car) ==
"1") {
561 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
562 } elseif (((
string) $car) ==
"0") {
563 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
565 print
'<td class="vide"> </td>'.
"\n";
568 if (!isset($sumfor[$i])) {
571 if (!isset($sumagainst[$i])) {
574 if (((
string) $car) ==
"1") {
577 if (((
string) $car) ==
"0") {
584 if ($compteur == $ligneamodifier) {
585 for ($i = 0; $i < $nbcolonnes; $i++) {
586 $car = substr($ensemblereponses, $i, 1);
587 print
'<td class="vide">';
588 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
589 print
'<input type="checkbox" name="choix'.$i.
'" value="1" ';
595 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
596 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
597 print $form->selectarray(
"choix".$i, $arraychoice, $car);
599 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
600 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"Against"),
'1' => $langs->trans(
"For"));
601 print $form->selectarray(
"choix".$i, $arraychoice, $car);
606 for ($i = 0; $i < $nbcolonnes; $i++) {
607 $car = substr($ensemblereponses, $i, 1);
608 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
609 if (((
string) $car) ==
"1") {
610 print
'<td class="ok">OK</td>'.
"\n";
612 print
'<td class="non">KO</td>'.
"\n";
615 if (!isset($sumfor[$i])) {
618 if (((
string) $car) ==
"1") {
622 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
623 if (((
string) $car) ==
"1") {
624 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
625 } elseif (((
string) $car) ==
"0") {
626 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
628 print
'<td class="vide"> </td>'.
"\n";
631 if (!isset($sumfor[$i])) {
634 if (!isset($sumagainst[$i])) {
637 if (((
string) $car) ==
"1") {
640 if (((
string) $car) ==
"0") {
644 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
645 if (((
string) $car) ==
"1") {
646 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
647 } elseif (((
string) $car) ==
"0") {
648 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
650 print
'<td class="vide"> </td>'.
"\n";
653 if (!isset($sumfor[$i])) {
656 if (!isset($sumagainst[$i])) {
659 if (((
string) $car) ==
"1") {
662 if (((
string) $car) ==
"0") {
671 if ($compteur != $ligneamodifier && $mod_ok) {
672 $currentusername = $obj->name;
673 print
'<td class="casevide"><input type="submit" class="button small" name="modifierligne'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Edit")).
'"></td>'.
"\n";
677 for ($i = 0; $i < $nblines; $i++) {
678 if (GETPOSTISSET(
"modifierligne".$i)) {
679 if ($compteur == $i) {
680 print
'<td class="casevide">';
681 print
'<input type="hidden" name="idtomodify'.$compteur.
'" value="'.$obj->id_users.
'">';
682 print
'<input type="submit" class="button button-save small" name="validermodifier'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Save")).
'">';
693if ($ligneamodifier < 0 && (!isset($_SESSION[
'nom']))) {
695 print
'<td class="nom">'.
"\n";
696 if (isset($_SESSION[
'nom'])) {
697 print
'<input type=hidden name="nom" value="'.$_SESSION[
'nom'].
'">'.$_SESSION[
'nom'].
"\n";
699 print
'<input type="text" name="nom" placeholder="'.dol_escape_htmltag($langs->trans(
"Name")).
'" maxlength="64" class=" minwidth175" value="">'.
"\n";
704 for ($i = 0; $i < $nbcolonnes; $i++) {
705 print
'<td class="vide">';
706 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
707 print
'<input type="checkbox" name="choix'.$i.
'" value="1"';
708 if (GETPOSTISSET(
'choix'.$i) &&
GETPOST(
'choix'.$i) ==
'1') {
713 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
714 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
715 print $form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
717 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
718 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"Against"),
'1' => $langs->trans(
"For"));
719 print $form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
725 print
'<td><input type="image" class="borderimp classfortooltip" title="'.dolPrintHTML($langs->trans(
"AddTheVote")).
'" name="boutonp" value="'.$langs->trans(
"Vote").
'" src="'.
img_picto(
'',
'edit_add',
'', 0, 1).
'"></td>'.
"\n";
731$meilleurecolonne =
null;
732for ($i = 0; $i < $nbcolonnes; $i++) {
733 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
736 if (isset($sumfor[$i])) {
738 $meilleurecolonne = $sumfor[$i];
740 if (!isset($meilleurecolonne) || $sumfor[$i] > $meilleurecolonne) {
741 $meilleurecolonne = $sumfor[$i];
749 print
'<td class="center">'.$langs->trans(
"Total").
'</td>'.
"\n";
750 for ($i = 0; $i < $nbcolonnes; $i++) {
751 $showsumfor = isset($sumfor[$i]) ? $sumfor[$i] :
'';
752 $showsumagainst = isset($sumagainst[$i]) ? $sumagainst[$i] :
'';
753 if (empty($showsumfor)) {
756 if (empty($showsumagainst)) {
761 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
764 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
765 print $langs->trans(
"Yes").
': '.$showsumfor.
'<br>'.$langs->trans(
"No").
': '.$showsumagainst;
767 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
768 print $langs->trans(
"For").
': '.$showsumfor.
'<br>'.$langs->trans(
"Against").
': '.$showsumagainst;
774 if ($nbofcheckbox >= 2) {
776 print
'<td class="somme"></td>'.
"\n";
777 for ($i = 0; $i < $nbcolonnes; $i++) {
779 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst')) && isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
780 print
'<td class="somme"><img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"></td>'.
"\n";
782 print
'<td class="somme"></td>'.
"\n";
788print
'</table>'.
"\n";
794 $toutsujet = explode(
",",
$object->sujet);
795 $toutsujet = str_replace(
"°",
"'", $toutsujet);
800 for ($i = 0; $i < $nbcolonnes; $i++) {
801 if (isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
802 $meilleursujet .= ($meilleursujet ?
", " :
"");
804 if (strpos($toutsujet[$i],
'@') !==
false) {
805 $toutsujetdate = explode(
"@", $toutsujet[$i]);
808 $meilleursujet .=
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'daytext').
' ('.
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'%A').
')';
811 $tmps = explode(
'@', $toutsujet[$i]);
820 $meilleursujet = str_replace(
"°",
"'", $meilleursujet);
823 if ($nbofcheckbox >= 2) {
824 $vote_str = $langs->trans(
'votes');
825 print
'<p class="affichageresultats">'.
"\n";
827 if (isset($meilleurecolonne) && $compteursujet ==
"1") {
828 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoice').
": <b>".$meilleursujet.
"</b> - <b>".$meilleurecolonne.
"</b> ".$vote_str.
".\n";
829 } elseif (isset($meilleurecolonne)) {
830 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoices').
": <b>".$meilleursujet.
"</b> - <b>".$meilleurecolonne.
"</b> ".$vote_str.
".\n";
833 print
'</p><br>'.
"\n";
841$comments =
$object->getComments();
844 print
'<br>'.img_picto(
'',
'note',
'class="pictofixedwidth"').
'<span class="bold opacitymedium">'.$langs->trans(
"CommentsOfVoters").
':</span><br>'.
"\n";
846 foreach ($comments as $obj) {
850 print
'<div class="comment"><span class="usercomment">';
851 if (in_array($obj->usercomment, $listofvoters)) {
852 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?deletecomment='.$obj->id_comment.
'&sondage='.$numsondage.
'"> '.
img_picto(
'',
'delete',
'', 0, 0, 0,
'',
'nomarginleft').
'</a> ';
855 print
img_picto(
'',
'user',
'class="pictofixedwidth"').dol_htmlentities($obj->usercomment).
':</span> <span class="comment">'.
dol_nl2br(
dol_htmlentities($obj->comment)).
"</span></div>";
860if (
$object->allow_comments && $currentusername) {
861 print
'<br><div class="addcomment"><span class="opacitymedium">'.$langs->trans(
"AddACommentForPoll").
"</span><br>\n";
863 print
'<textarea name="comment" rows="'.ROWS_2.
'" class="quatrevingtpercent">'.
dol_escape_htmltag(
GETPOST(
'comment',
'alphanohtml'), 0, 1).
'</textarea><br>'.
"\n";
864 print $langs->trans(
"Name").
': ';
865 print
'<input type="text" name="commentuser" maxlength="64" value="'.dol_escape_htmltag(GETPOSTISSET(
'commentuser') ?
GETPOST(
'commentuser',
'alphanohtml') : (empty($_SESSION[
'nom']) ? $currentusername : $_SESSION[
'nom'])).
'"> '.
"\n";
866 print
'<input type="submit" class="button smallpaddingimp" name="ajoutcomment" value="'.dol_escape_htmltag($langs->trans(
"AddComment")).
'"><br>'.
"\n";
867 print
'</form>'.
"\n";
874print
'<a name="bas"></a>'.
"\n";
if(! $sortfield) if(! $sortorder) $object
Class to send emails (with attachments or not) Usage: $mailfile = new CMailFile($subject,...
Put here description of your class.
const STATUS_CLOSED
Closed.
Class to manage Dolibarr users.
dol_get_last_hour($date, $gm='tzserver')
Return GMT time for last hour of a given GMT date (it replaces hours, min and second part to 23:59:59...
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_now($mode='gmt')
Return date for now.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='', $noduplicate=0, $attop=0)
Set event messages in dol_events session object.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=0, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2, $allowothertags=array())
Show picto whatever it's its name (generic function)
GETPOSTINT($paramname, $method=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
dol_htmlentities($string, $flags=ENT_QUOTES|ENT_SUBSTITUTE, $encoding='UTF-8', $double_encode=false)
Replace htmlentities functions.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs=null, $encodetooutput=false, $decorate=0)
Output date in a string format according to outputlangs (or langs if not defined).
getUserRemoteIP($trusted=0)
Return the real IP of remote user.
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...
isModEnabled($module)
Is Dolibarr module enabled.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0, $cleanalsojavascript=0)
Returns text escaped for inclusion in HTML alt or title or value tags, or into values of HTML input f...
llxFooterSurvey()
Show footer for new member.
getUrlSondage($id, $admin=false)
Function for generating URLs for surveys.
llxHeaderSurvey($title, $head="", $disablejs=0, $disablehead=0, $arrayofjs=[], $arrayofcss=[], $numsondage='')
Show header for new member.
print $langs trans('Date')." left Ref Label right Qty right Price right TotalHT right TotalTTC right right right right right right right right right centpercent right TotalHT right n right VAT right n right TotalVAT right n No sujeto a RE IRPF right TotalLT1 right n right TotalLT2 right n right TotalTTC right n takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency takeposcustomercurrency right TotalTTC takeposcustomercurrency right takeposcustomercurrency n right Paid right PaymentTypeShortLIQ right SELECT p pos_change as p datep as date
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.