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 || empty(
$object->allow_comments)) {
93 $comment =
GETPOST(
"comment",
'alphanohtml');
94 $comment_user =
GETPOST(
'commentuser',
'alphanohtml');
98 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Comment")),
null,
'errors');
100 if (!$comment_user) {
102 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
105 if (!in_array($comment_user, $listofvoters)) {
106 setEventMessages($langs->trans(
"UserMustBeSameThanUserUsedToVote"),
null,
'errors');
111 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
116 if ($nb_post_max > 0) {
117 $sql =
"SELECT COUNT(id_comment) as nb_comments";
118 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_comments";
119 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
120 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
121 $resql = $db->query($sql);
123 $num = $db->num_rows($resql);
127 $obj = $db->fetch_object($resql);
128 $nb_post_ip = $obj->nb_comments;
133 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
134 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
139 $resql =
$object->addComment($comment, $comment_user, $user_ip);
142 dol_print_error($db);
149 if (!$canbemodified) {
154 if (
GETPOST(
'nom',
'alphanohtml')) {
156 for ($i = 0; $i < $nbcolonnes; $i++) {
158 $nouveauchoix .=
"1";
160 $nouveauchoix .=
"2";
162 $nouveauchoix .=
"0";
167 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
172 if ($nb_post_max > 0) {
173 $sql =
"SELECT COUNT(id_users) as nb_records";
174 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
175 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
176 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
177 $resql = $db->query($sql);
179 $num = $db->num_rows($resql);
183 $obj = $db->fetch_object($resql);
184 $nb_post_ip = $obj->nb_records;
190 $nom = substr(
GETPOST(
"nom",
'alphanohtml'), 0, 64);
193 $sql =
'SELECT id_users, nom as name';
194 $sql .=
' FROM '.MAIN_DB_PREFIX.
'opensurvey_user_studs';
195 $sql .=
" WHERE id_sondage = '".$db->escape($numsondage).
"' AND nom = '".$db->escape($nom).
"' ORDER BY id_users";
196 $resql = $db->query($sql);
198 dol_print_error($db);
201 $num_rows = $db->num_rows($resql);
204 setEventMessages($langs->trans(
"VoteNameAlreadyExists"),
null,
'errors');
206 } elseif ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
207 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
211 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.
'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)';
212 $sql .=
" VALUES ('".$db->escape($nom).
"', '".$db->escape($numsondage).
"','".$db->escape($nouveauchoix).
"', '".$db->escape($user_ip).
"', '".$db->idate($now).
"')";
213 $resql = $db->query($sql);
217 $_SESSION[
"savevoter"] = $nom.
','.(empty($_SESSION[
"savevoter"]) ?
'' : $_SESSION[
"savevoter"]);
218 $listofvoters = explode(
',', $_SESSION[
"savevoter"]);
222 $userstatic =
new User($db);
223 $userstatic->fetch(
$object->fk_user_creat);
225 $email = $userstatic->email;
232 include_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
234 $application = (
$conf->global->MAIN_APPLICATION_TITLE ?
$conf->global->MAIN_APPLICATION_TITLE :
'Dolibarr ERP/CRM');
237 $link =
'<a href="'.$link.
'">'.$link.
'</a>';
238 $body = str_replace(
'\n',
'<br>', $langs->transnoentities(
'EmailSomeoneVoted', $nom, $link));
241 $cmailfile =
new CMailFile(
"[".$application.
"] ".$langs->trans(
"Poll").
': '.
$object->title, $email,
$conf->global->MAIN_MAIL_EMAIL_FROM, $body,
null,
null,
null,
'',
'', 0, -1);
242 $result = $cmailfile->sendfile();
246 dol_print_error($db);
250 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
256$testmodifier =
false;
257$testligneamodifier =
false;
260for ($i = 0; $i < $nblines; $i++) {
262 $ligneamodifier = $i;
263 $testligneamodifier =
true;
269 $testmodifier =
true;
275 for ($i = 0; $i < $nbcolonnes; $i++) {
277 $nouveauchoix .=
"1";
279 $nouveauchoix .=
"2";
281 $nouveauchoix .=
"0";
285 if (!$canbemodified) {
289 $idtomodify =
GETPOST(
"idtomodify".$modifier);
290 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"opensurvey_user_studs";
291 $sql .=
" SET reponses = '".$db->escape($nouveauchoix).
"'";
292 $sql .=
" WHERE id_users = '".$db->escape($idtomodify).
"'";
294 $resql = $db->query($sql);
296 dol_print_error($db);
303 if (!$canbemodified) {
307 $resql =
$object->deleteComment($idcomment);
316$form =
new Form($db);
319$arrayofcss = array(
'/opensurvey/css/style.css');
324 $langs->load(
"errors");
325 print $langs->trans(
"ErrorRecordNotFound");
334$toutsujet = explode(
",",
$object->sujet);
335$listofanswers = array();
336foreach ($toutsujet as $value) {
337 $tmp = explode(
'@', $value);
338 $listofanswers[] = array(
'label' => $tmp[0],
'format' => (!empty($tmp[1]) ? $tmp[1] :
'checkbox'));
340$toutsujet = str_replace(
"°",
"'", $toutsujet);
343print
'<div class="survey_intro">';
344print
'<div class="survey_invitation">'.$langs->trans(
"YouAreInivitedToVote").
'</div>';
345print
'<div class="small">';
346print
'<span class="opacitymedium">'.$langs->trans(
"OpenSurveyHowTo").
'</span><br>';
347if (empty(
$object->allow_spy)) {
348 print
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPrivate").
'</span><br>';
350 print $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPublic").
'</span>', $langs->trans(
"CanSeeOthersVote")).
'<br>';
356if (empty(
$object->description)) {
357 print
'<div class="corps">'.
"\n";
363$titre = str_replace(
"\\",
"",
$object->title);
364print
'<div class="survey_title">'.img_picto(
'',
'poll',
'class="size15x paddingright"').
' <strong>'.
dol_htmlentities($titre).
'</strong></div>';
366if (!empty(
$object->description)) {
367 print
'<br><div class="corps">'.
"\n";
378if (!$canbemodified) {
379 print
'<br><center><div class="center warning">'.$langs->trans(
'SurveyExpiredInfo').
'</div></center>';
386print
'<div class="cadre"> '.
"\n";
387print
'<br><br>'.
"\n";
390print
'<div class="div-table-responsive">';
391print
'<table class="resultats">'.
"\n";
397 print
'<td></td>'.
"\n";
401 $nbofsujet = count($toutsujet);
402 for ($i = 0; $i < $nbofsujet; $i++) {
403 if (isset($toutsujet[$i + 1]) &&
date(
'Y', intval($toutsujet[$i])) ==
date(
'Y', intval($toutsujet[$i + 1]))) {
406 print
'<td colspan='.$colspan.
' class="annee">'.
date(
'Y', intval($toutsujet[$i])).
'</td>'.
"\n";
413 print
'<td></td>'.
"\n";
417 for ($i = 0; $i < $nbofsujet; $i++) {
418 $cur = intval($toutsujet[$i]);
419 if (!isset($toutsujet[$i + 1])) {
422 $next = intval($toutsujet[$i + 1]);
428 print
'<td colspan='.$colspan.
' class="mois">'.
dol_print_date($cur,
"%B").
'</td>'.
"\n";
435 print
'<td></td>'.
"\n";
439 for ($i = 0; $i < $nbofsujet; $i++) {
440 $cur = intval($toutsujet[$i]);
441 if (!isset($toutsujet[$i + 1])) {
444 $next = intval($toutsujet[$i + 1]);
449 print
'<td colspan="'.$colspan.
'" class="jour">'.
dol_print_date($cur,
"%a %d").
'</td>'.
"\n";
457 if (strpos(
$object->sujet,
'@') !==
false) {
459 print
'<td></td>'.
"\n";
461 for ($i = 0; isset($toutsujet[$i]); $i++) {
462 $heures = explode(
'@', $toutsujet[$i]);
463 if (isset($heures[1])) {
464 print
'<td class="heure">'.dol_htmlentities($heures[1]).
'</td>'.
"\n";
466 print
'<td class="heure"></td>'.
"\n";
475 print
'<td></td>'.
"\n";
477 for ($i = 0; isset($toutsujet[$i]); $i++) {
478 $tmp = explode(
'@', $toutsujet[$i]);
479 print
'<td class="sujet">'.dol_escape_htmltag($tmp[0]).
'</td>'.
"\n";
487$currentusername =
'';
489$sumagainst = array();
491$sql =
"SELECT id_users, nom as name, id_sondage, reponses";
492$sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
493$sql .=
" WHERE id_sondage = '".$db->escape($numsondage).
"'";
494$resql = $db->query($sql);
496 dol_print_error($db);
499$num = $db->num_rows($resql);
500while ($compteur < $num) {
501 $obj = $db->fetch_object($resql);
503 $ensemblereponses = $obj->reponses;
506 $mod_ok = (in_array($obj->name, $listofvoters));
508 if (!$mod_ok && !
$object->allow_spy) {
516 print
'<td class="nom">'.img_picto($obj->name,
'user',
'class="pictofixedwidth"').dol_htmlentities($obj->name).
'</td>'.
"\n";
519 if (!$testligneamodifier) {
520 for ($i = 0; $i < $nbcolonnes; $i++) {
521 $car = substr($ensemblereponses, $i, 1);
524 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
525 if (((
string) $car) ==
"1") {
526 print
'<td class="ok">OK</td>'.
"\n";
528 print
'<td class="non">KO</td>'.
"\n";
531 if (!isset($sumfor[$i])) {
534 if (((
string) $car) ==
"1") {
538 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
539 if (((
string) $car) ==
"1") {
540 print
'<td class="ok">'.$langs->trans(
"Yes").
'</td>'.
"\n";
541 } elseif (((
string) $car) ==
"0") {
542 print
'<td class="non">'.$langs->trans(
"No").
'</td>'.
"\n";
544 print
'<td class="vide"> </td>'.
"\n";
547 if (!isset($sumfor[$i])) {
550 if (!isset($sumagainst[$i])) {
553 if (((
string) $car) ==
"1") {
556 if (((
string) $car) ==
"0") {
560 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
561 if (((
string) $car) ==
"1") {
562 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
563 } elseif (((
string) $car) ==
"0") {
564 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
566 print
'<td class="vide"> </td>'.
"\n";
569 if (!isset($sumfor[$i])) {
572 if (!isset($sumagainst[$i])) {
575 if (((
string) $car) ==
"1") {
578 if (((
string) $car) ==
"0") {
585 if ($compteur == $ligneamodifier) {
586 for ($i = 0; $i < $nbcolonnes; $i++) {
587 $car = substr($ensemblereponses, $i, 1);
588 print
'<td class="vide">';
589 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
590 print
'<input type="checkbox" name="choix'.$i.
'" value="1" ';
596 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
597 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
598 print $form->selectarray(
"choix".$i, $arraychoice, $car);
600 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
601 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"Against"),
'1' => $langs->trans(
"For"));
602 print $form->selectarray(
"choix".$i, $arraychoice, $car);
607 for ($i = 0; $i < $nbcolonnes; $i++) {
608 $car = substr($ensemblereponses, $i, 1);
609 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
610 if (((
string) $car) ==
"1") {
611 print
'<td class="ok">OK</td>'.
"\n";
613 print
'<td class="non">KO</td>'.
"\n";
616 if (!isset($sumfor[$i])) {
619 if (((
string) $car) ==
"1") {
623 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
624 if (((
string) $car) ==
"1") {
625 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
626 } elseif (((
string) $car) ==
"0") {
627 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
629 print
'<td class="vide"> </td>'.
"\n";
632 if (!isset($sumfor[$i])) {
635 if (!isset($sumagainst[$i])) {
638 if (((
string) $car) ==
"1") {
641 if (((
string) $car) ==
"0") {
645 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
646 if (((
string) $car) ==
"1") {
647 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
648 } elseif (((
string) $car) ==
"0") {
649 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
651 print
'<td class="vide"> </td>'.
"\n";
654 if (!isset($sumfor[$i])) {
657 if (!isset($sumagainst[$i])) {
660 if (((
string) $car) ==
"1") {
663 if (((
string) $car) ==
"0") {
672 if ($compteur != $ligneamodifier && $mod_ok) {
673 $currentusername = $obj->name;
674 print
'<td class="casevide"><input type="submit" class="button small" name="modifierligne'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Edit")).
'"></td>'.
"\n";
678 for ($i = 0; $i < $nblines; $i++) {
680 if ($compteur == $i) {
681 print
'<td class="casevide">';
682 print
'<input type="hidden" name="idtomodify'.$compteur.
'" value="'.$obj->id_users.
'">';
683 print
'<input type="submit" class="button button-save small" name="validermodifier'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Save")).
'">';
694if ($ligneamodifier < 0 && (!isset($_SESSION[
'nom']))) {
696 print
'<td class="nom">'.
"\n";
697 if (isset($_SESSION[
'nom'])) {
698 print
'<input type=hidden name="nom" value="'.$_SESSION[
'nom'].
'">'.$_SESSION[
'nom'].
"\n";
700 print
'<input type="text" name="nom" placeholder="'.dol_escape_htmltag($langs->trans(
"Name")).
'" maxlength="64" class=" minwidth175" value="">'.
"\n";
705 for ($i = 0; $i < $nbcolonnes; $i++) {
706 print
'<td class="vide">';
707 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
708 print
'<input type="checkbox" name="choix'.$i.
'" value="1"';
714 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
715 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
716 print $form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
718 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
719 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"Against"),
'1' => $langs->trans(
"For"));
720 print $form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
726 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";
732$meilleurecolonne =
null;
733for ($i = 0; $i < $nbcolonnes; $i++) {
734 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
737 if (isset($sumfor[$i])) {
739 $meilleurecolonne = $sumfor[$i];
741 if (!isset($meilleurecolonne) || $sumfor[$i] > $meilleurecolonne) {
742 $meilleurecolonne = $sumfor[$i];
750 print
'<td class="center">'.$langs->trans(
"Total").
'</td>'.
"\n";
751 for ($i = 0; $i < $nbcolonnes; $i++) {
752 $showsumfor = isset($sumfor[$i]) ? $sumfor[$i] :
'';
753 $showsumagainst = isset($sumagainst[$i]) ? $sumagainst[$i] :
'';
754 if (empty($showsumfor)) {
757 if (empty($showsumagainst)) {
762 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
765 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
766 print $langs->trans(
"Yes").
': '.$showsumfor.
'<br>'.$langs->trans(
"No").
': '.$showsumagainst;
768 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
769 print $langs->trans(
"For").
': '.$showsumfor.
'<br>'.$langs->trans(
"Against").
': '.$showsumagainst;
775 if ($nbofcheckbox >= 2) {
777 print
'<td class="somme"></td>'.
"\n";
778 for ($i = 0; $i < $nbcolonnes; $i++) {
780 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst')) && isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
781 print
'<td class="somme"><img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"></td>'.
"\n";
783 print
'<td class="somme"></td>'.
"\n";
789print
'</table>'.
"\n";
795 $toutsujet = explode(
",",
$object->sujet);
796 $toutsujet = str_replace(
"°",
"'", $toutsujet);
801 for ($i = 0; $i < $nbcolonnes; $i++) {
802 if (isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
803 $meilleursujet .= ($meilleursujet ?
", " :
"");
805 if (strpos($toutsujet[$i],
'@') !==
false) {
806 $toutsujetdate = explode(
"@", $toutsujet[$i]);
809 $meilleursujet .=
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'daytext').
' ('.
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'%A').
')';
812 $tmps = explode(
'@', $toutsujet[$i]);
821 $meilleursujet = str_replace(
"°",
"'", $meilleursujet);
824 if ($nbofcheckbox >= 2) {
825 $vote_str = $langs->trans(
'votes');
826 print
'<p class="affichageresultats">'.
"\n";
828 if (isset($meilleurecolonne) && $compteursujet ==
"1") {
829 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoice').
": <b>".$meilleursujet.
"</b> - <b>".$meilleurecolonne.
"</b> ".$vote_str.
".\n";
830 } elseif (isset($meilleurecolonne)) {
831 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoices').
": <b>".$meilleursujet.
"</b> - <b>".$meilleurecolonne.
"</b> ".$vote_str.
".\n";
834 print
'</p><br>'.
"\n";
842$comments =
$object->getComments();
845 print
'<br>'.img_picto(
'',
'note',
'class="pictofixedwidth"').
'<span class="bold opacitymedium">'.$langs->trans(
"CommentsOfVoters").
':</span><br>'.
"\n";
847 foreach ($comments as $obj) {
851 print
'<div class="comment"><span class="usercomment">';
852 if (in_array($obj->usercomment, $listofvoters)) {
853 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?deletecomment='.$obj->id_comment.
'&sondage='.$numsondage.
'"> '.img_picto(
'',
'delete',
'', 0, 0, 0,
'',
'nomarginleft').
'</a> ';
856 print img_picto(
'',
'user',
'class="pictofixedwidth"').dol_htmlentities($obj->usercomment).
':</span> <span class="comment">'.
dol_nl2br(
dol_htmlentities($obj->comment)).
"</span></div>";
861if (
$object->allow_comments && $currentusername) {
862 print
'<br><div class="addcomment"><span class="opacitymedium">'.$langs->trans(
"AddACommentForPoll").
"</span><br>\n";
864 print
'<textarea name="comment" rows="'.ROWS_2.
'" class="quatrevingtpercent">'.
dol_escape_htmltag(
GETPOST(
'comment',
'alphanohtml'), 0, 1).
'</textarea><br>'.
"\n";
865 print $langs->trans(
"Name").
': ';
866 print
'<input type="text" name="commentuser" maxlength="64" value="'.dol_escape_htmltag(
GETPOSTISSET(
'commentuser') ?
GETPOST(
'commentuser',
'alphanohtml') : (empty($_SESSION[
'nom']) ? $currentusername : $_SESSION[
'nom'])).
'"> '.
"\n";
867 print
'<input type="submit" class="button smallpaddingimp" name="ajoutcomment" value="'.dol_escape_htmltag($langs->trans(
"AddComment")).
'"><br>'.
"\n";
868 print
'</form>'.
"\n";
875print
'<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.
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.
GETPOST($paramname, $check='alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0, $nodefault=0)
Return value of a param into GET or POST supervariable.
dol_htmlentities($string, $flags=ENT_QUOTES|ENT_SUBSTITUTE, $encoding='UTF-8', $double_encode=false)
Replace htmlentities functions.
GETPOSTINT($paramname, $method=0, $nodefault=0)
Return the value of a $_GET or $_POST supervariable, converted into integer.
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.
GETPOSTISSET($paramname)
Return true if we are in a context of submitting the parameter $paramname from a POST of a form.
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)
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.