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';
42require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
43require_once DOL_DOCUMENT_ROOT.
"/core/lib/files.lib.php";
44require_once DOL_DOCUMENT_ROOT.
"/opensurvey/class/opensurveysondage.class.php";
45require_once DOL_DOCUMENT_ROOT.
"/opensurvey/lib/opensurvey.lib.php";
46require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
50$action =
GETPOST(
'action',
'aZ09');
53 $numsondage =
GETPOST(
'sondage',
'alpha');
57$result =
$object->fetch(0, $numsondage);
59$nblines =
$object->fetch_lines();
65if (!isModEnabled(
'opensurvey')) {
74$nbcolonnes = substr_count(
$object->sujet,
',') + 1;
76$listofvoters = explode(
',', $_SESSION[
"savevoter"]);
79if (
GETPOST(
'ajoutcomment',
'alpha')) {
80 if (!$canbemodified) {
86 $comment =
GETPOST(
"comment",
'alphanohtml');
87 $comment_user =
GETPOST(
'commentuser',
'alphanohtml');
91 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Comment")),
null,
'errors');
95 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
98 if (!in_array($comment_user, $listofvoters)) {
99 setEventMessages($langs->trans(
"UserMustBeSameThanUserUsedToVote"),
null,
'errors');
104 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
109 if ($nb_post_max > 0) {
110 $sql =
"SELECT COUNT(id_comment) as nb_comments";
111 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_comments";
112 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
113 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
114 $resql = $db->query($sql);
116 $num = $db->num_rows($resql);
120 $obj = $db->fetch_object($resql);
121 $nb_post_ip = $obj->nb_comments;
126 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
127 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
132 $resql =
$object->addComment($comment, $comment_user, $user_ip);
142 if (!$canbemodified) {
147 if (
GETPOST(
'nom',
'alphanohtml')) {
149 for ($i = 0; $i < $nbcolonnes; $i++) {
150 if (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'1') {
151 $nouveauchoix .=
"1";
152 } elseif (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'2') {
153 $nouveauchoix .=
"2";
155 $nouveauchoix .=
"0";
160 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
165 if ($nb_post_max > 0) {
166 $sql =
"SELECT COUNT(id_users) as nb_records";
167 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
168 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
169 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
170 $resql = $db->query($sql);
172 $num = $db->num_rows($resql);
176 $obj = $db->fetch_object($resql);
177 $nb_post_ip = $obj->nb_records;
183 $nom = substr(
GETPOST(
"nom",
'alphanohtml'), 0, 64);
186 $sql =
'SELECT id_users, nom as name';
187 $sql .=
' FROM '.MAIN_DB_PREFIX.
'opensurvey_user_studs';
188 $sql .=
" WHERE id_sondage='".$db->escape($numsondage).
"' AND nom = '".$db->escape($nom).
"' ORDER BY id_users";
189 $resql = $db->query($sql);
194 $num_rows = $db->num_rows($resql);
199 } elseif ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
200 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
204 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.
'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)';
205 $sql .=
" VALUES ('".$db->escape($nom).
"', '".$db->escape($numsondage).
"','".$db->escape($nouveauchoix).
"', '".$db->escape($user_ip).
"', '".$db->idate($now).
"')";
206 $resql = $db->query($sql);
210 $_SESSION[
"savevoter"] = $nom.
','.(empty($_SESSION[
"savevoter"]) ?
'' : $_SESSION[
"savevoter"]);
211 $listofvoters = explode(
',', $_SESSION[
"savevoter"]);
215 $userstatic =
new User($db);
216 $userstatic->fetch(
$object->fk_user_creat);
218 $email = $userstatic->email;
225 include_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
227 $application = ($conf->global->MAIN_APPLICATION_TITLE ? $conf->global->MAIN_APPLICATION_TITLE :
'Dolibarr ERP/CRM');
230 $link =
'<a href="'.$link.
'">'.$link.
'</a>';
231 $body = str_replace(
'\n',
'<br>', $langs->transnoentities(
'EmailSomeoneVoted', $nom, $link));
234 $cmailfile =
new CMailFile(
"[".$application.
"] ".$langs->trans(
"Poll").
': '.
$object->title, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body,
null,
null,
null,
'',
'', 0, -1);
235 $result = $cmailfile->sendfile();
243 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
249$testmodifier =
false;
250$testligneamodifier =
false;
252for ($i = 0; $i < $nblines; $i++) {
253 if (GETPOSTISSET(
'modifierligne'.$i)) {
254 $ligneamodifier = $i;
255 $testligneamodifier =
true;
259 if (GETPOSTISSET(
'validermodifier'.$i)) {
261 $testmodifier =
true;
267 for ($i = 0; $i < $nbcolonnes; $i++) {
268 if (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'1') {
269 $nouveauchoix .=
"1";
270 } elseif (GETPOSTISSET(
"choix".$i) &&
GETPOST(
"choix".$i) ==
'2') {
271 $nouveauchoix .=
"2";
273 $nouveauchoix .=
"0";
277 if (!$canbemodified) {
281 $idtomodify =
GETPOST(
"idtomodify".$modifier);
282 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"opensurvey_user_studs";
283 $sql .=
" SET reponses = '".$db->escape($nouveauchoix).
"'";
284 $sql .=
" WHERE id_users = '".$db->escape($idtomodify).
"'";
286 $resql = $db->query($sql);
295 if (!$canbemodified) {
299 $resql =
$object->deleteComment($idcomment);
308$form =
new Form($db);
311$arrayofcss = array(
'/opensurvey/css/style.css');
316 $langs->load(
"errors");
317 print $langs->trans(
"ErrorRecordNotFound");
326$toutsujet = explode(
",",
$object->sujet);
327$listofanswers = array();
328foreach ($toutsujet as $value) {
329 $tmp = explode(
'@', $value);
330 $listofanswers[] = array(
'label' => $tmp[0],
'format' => (!empty($tmp[1]) ? $tmp[1] :
'checkbox'));
332$toutsujet = str_replace(
"°",
"'", $toutsujet);
335print
'<div class="survey_intro">';
336print
'<div class="survey_invitation">'.$langs->trans(
"YouAreInivitedToVote").
'</div>';
337print
'<span class="opacitymedium">'.$langs->trans(
"OpenSurveyHowTo").
'</span><br>';
338if (empty(
$object->allow_spy)) {
339 print
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPrivate").
'</span><br>';
341 print $form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPublic").
'</span>', $langs->trans(
"CanSeeOthersVote")).
'<br>';
346if (empty(
$object->description)) {
347 print
'<div class="corps">'.
"\n";
353$titre = str_replace(
"\\",
"",
$object->title);
354print
'<div class="survey_title">'.img_picto(
'',
'poll',
'class="size15x paddingright"').
' <strong>'.
dol_htmlentities($titre).
'</strong></div>';
356if (!empty(
$object->description)) {
357 print
'<br><div class="corps">'.
"\n";
368if (!$canbemodified) {
369 print
'<br><center><div class="quatrevingtpercent center warning">'.$langs->trans(
'SurveyExpiredInfo').
'</div></center>';
376print
'<div class="cadre"> '.
"\n";
377print
'<br><br>'.
"\n";
380print
'<div class="div-table-responsive">';
381print
'<table class="resultats">'.
"\n";
387 print
'<td></td>'.
"\n";
391 $nbofsujet = count($toutsujet);
392 for ($i = 0; $i < $nbofsujet; $i++) {
393 if (isset($toutsujet[$i + 1]) && date(
'Y', intval($toutsujet[$i])) == date(
'Y', intval($toutsujet[$i + 1]))) {
396 print
'<td colspan='.$colspan.
' class="annee">'.date(
'Y', intval($toutsujet[$i])).
'</td>'.
"\n";
403 print
'<td></td>'.
"\n";
407 for ($i = 0; $i < $nbofsujet; $i++) {
408 $cur = intval($toutsujet[$i]);
410 if (!isset($toutsujet[$i + 1])) {
413 $next = intval($toutsujet[$i + 1]);
419 print
'<td colspan='.$colspan.
' class="mois">'.
dol_print_date($cur,
"%B").
'</td>'.
"\n";
426 print
'<td></td>'.
"\n";
430 for ($i = 0; $i < $nbofsujet; $i++) {
431 $cur = intval($toutsujet[$i]);
432 if (!isset($toutsujet[$i + 1])) {
435 $next = intval($toutsujet[$i + 1]);
440 print
'<td colspan="'.$colspan.
'" class="jour">'.
dol_print_date($cur,
"%a %d").
'</td>'.
"\n";
448 if (strpos(
$object->sujet,
'@') !==
false) {
450 print
'<td></td>'.
"\n";
452 for ($i = 0; isset($toutsujet[$i]); $i++) {
453 $heures = explode(
'@', $toutsujet[$i]);
454 if (isset($heures[1])) {
455 print
'<td class="heure">'.dol_htmlentities($heures[1]).
'</td>'.
"\n";
457 print
'<td class="heure"></td>'.
"\n";
466 print
'<td></td>'.
"\n";
468 for ($i = 0; isset($toutsujet[$i]); $i++) {
469 $tmp = explode(
'@', $toutsujet[$i]);
470 print
'<td class="sujet">'.dol_escape_htmltag($tmp[0]).
'</td>'.
"\n";
478$currentusername =
'';
480$sumagainst = array();
482$sql =
"SELECT id_users, nom as name, id_sondage, reponses";
483$sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
484$sql .=
" WHERE id_sondage = '".$db->escape($numsondage).
"'";
485$resql = $db->query($sql);
490$num = $db->num_rows($resql);
491while ($compteur < $num) {
492 $obj = $db->fetch_object($resql);
494 $ensemblereponses = $obj->reponses;
497 $mod_ok = (in_array($obj->name, $listofvoters));
499 if (!$mod_ok && !
$object->allow_spy) {
507 print
'<td class="nom">'.img_picto($obj->name,
'user',
'class="pictofixedwidth"').dol_htmlentities($obj->name).
'</td>'.
"\n";
510 if (!$testligneamodifier) {
511 for ($i = 0; $i < $nbcolonnes; $i++) {
512 $car = substr($ensemblereponses, $i, 1);
515 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
516 if (((
string) $car) ==
"1") {
517 print
'<td class="ok">OK</td>'.
"\n";
519 print
'<td class="non">KO</td>'.
"\n";
522 if (!isset($sumfor[$i])) {
525 if (((
string) $car) ==
"1") {
529 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
530 if (((
string) $car) ==
"1") {
531 print
'<td class="ok">'.$langs->trans(
"Yes").
'</td>'.
"\n";
532 } elseif (((
string) $car) ==
"0") {
533 print
'<td class="non">'.$langs->trans(
"No").
'</td>'.
"\n";
535 print
'<td class="vide"> </td>'.
"\n";
538 if (!isset($sumfor[$i])) {
541 if (!isset($sumagainst[$i])) {
544 if (((
string) $car) ==
"1") {
547 if (((
string) $car) ==
"0") {
551 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
552 if (((
string) $car) ==
"1") {
553 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
554 } elseif (((
string) $car) ==
"0") {
555 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
557 print
'<td class="vide"> </td>'.
"\n";
560 if (!isset($sumfor[$i])) {
563 if (!isset($sumagainst[$i])) {
566 if (((
string) $car) ==
"1") {
569 if (((
string) $car) ==
"0") {
576 if ($compteur == $ligneamodifier) {
577 for ($i = 0; $i < $nbcolonnes; $i++) {
578 $car = substr($ensemblereponses, $i, 1);
579 print
'<td class="vide">';
580 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
581 print
'<input type="checkbox" name="choix'.$i.
'" value="1" ';
587 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
588 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
589 print $form->selectarray(
"choix".$i, $arraychoice, $car);
591 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
592 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"Against"),
'1' => $langs->trans(
"For"));
593 print $form->selectarray(
"choix".$i, $arraychoice, $car);
598 for ($i = 0; $i < $nbcolonnes; $i++) {
599 $car = substr($ensemblereponses, $i, 1);
600 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
601 if (((
string) $car) ==
"1") {
602 print
'<td class="ok">OK</td>'.
"\n";
604 print
'<td class="non">KO</td>'.
"\n";
607 if (!isset($sumfor[$i])) {
610 if (((
string) $car) ==
"1") {
614 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
615 if (((
string) $car) ==
"1") {
616 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
617 } elseif (((
string) $car) ==
"0") {
618 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
620 print
'<td class="vide"> </td>'.
"\n";
623 if (!isset($sumfor[$i])) {
626 if (!isset($sumagainst[$i])) {
629 if (((
string) $car) ==
"1") {
632 if (((
string) $car) ==
"0") {
636 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
637 if (((
string) $car) ==
"1") {
638 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
639 } elseif (((
string) $car) ==
"0") {
640 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
642 print
'<td class="vide"> </td>'.
"\n";
645 if (!isset($sumfor[$i])) {
648 if (!isset($sumagainst[$i])) {
651 if (((
string) $car) ==
"1") {
654 if (((
string) $car) ==
"0") {
663 if ($compteur != $ligneamodifier && $mod_ok) {
664 $currentusername = $obj->name;
665 print
'<td class="casevide"><input type="submit" class="button small" name="modifierligne'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Edit")).
'"></td>'.
"\n";
669 for ($i = 0; $i < $nblines; $i++) {
670 if (GETPOSTISSET(
"modifierligne".$i)) {
671 if ($compteur == $i) {
672 print
'<td class="casevide">';
673 print
'<input type="hidden" name="idtomodify'.$compteur.
'" value="'.$obj->id_users.
'">';
674 print
'<input type="submit" class="button button-save small" name="validermodifier'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Save")).
'">';
685if ($ligneamodifier < 0 && (!isset($_SESSION[
'nom']))) {
687 print
'<td class="nom">'.
"\n";
688 if (isset($_SESSION[
'nom'])) {
689 print
'<input type=hidden name="nom" value="'.$_SESSION[
'nom'].
'">'.$_SESSION[
'nom'].
"\n";
691 print
'<input type="text" name="nom" placeholder="'.dol_escape_htmltag($langs->trans(
"Name")).
'" maxlength="64" class=" minwidth175" value="">'.
"\n";
696 for ($i = 0; $i < $nbcolonnes; $i++) {
697 print
'<td class="vide">';
698 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
699 print
'<input type="checkbox" name="choix'.$i.
'" value="1"';
700 if (GETPOSTISSET(
'choix'.$i) &&
GETPOST(
'choix'.$i) ==
'1') {
705 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
706 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"No"),
'1' => $langs->trans(
"Yes"));
707 print $form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
709 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
710 $arraychoice = array(
'2' =>
' ',
'0' => $langs->trans(
"Against"),
'1' => $langs->trans(
"For"));
711 print $form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
717 print
'<td><input type="image" class="borderimp" name="boutonp" value="'.$langs->trans(
"Vote").
'" src="'.
img_picto(
'',
'edit_add',
'', 0, 1).
'"></td>'.
"\n";
723for ($i = 0; $i < $nbcolonnes; $i++) {
724 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
727 if (isset($sumfor[$i])) {
729 $meilleurecolonne = $sumfor[$i];
731 if (!isset($meilleurecolonne) || $sumfor[$i] > $meilleurecolonne) {
732 $meilleurecolonne = $sumfor[$i];
740 print
'<td class="center">'.$langs->trans(
"Total").
'</td>'.
"\n";
741 for ($i = 0; $i < $nbcolonnes; $i++) {
742 $showsumfor = isset($sumfor[$i]) ? $sumfor[$i] :
'';
743 $showsumagainst = isset($sumagainst[$i]) ? $sumagainst[$i] :
'';
744 if (empty($showsumfor)) {
747 if (empty($showsumagainst)) {
752 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
755 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
756 print $langs->trans(
"Yes").
': '.$showsumfor.
'<br>'.$langs->trans(
"No").
': '.$showsumagainst;
758 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
759 print $langs->trans(
"For").
': '.$showsumfor.
'<br>'.$langs->trans(
"Against").
': '.$showsumagainst;
765 if ($nbofcheckbox >= 2) {
767 print
'<td class="somme"></td>'.
"\n";
768 for ($i = 0; $i < $nbcolonnes; $i++) {
770 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst')) && isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
771 print
'<td class="somme"><img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"></td>'.
"\n";
773 print
'<td class="somme"></td>'.
"\n";
779print
'</table>'.
"\n";
785 $toutsujet = explode(
",",
$object->sujet);
786 $toutsujet = str_replace(
"°",
"'", $toutsujet);
791 for ($i = 0; $i < $nbcolonnes; $i++) {
792 if (isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
793 $meilleursujet .= ($meilleursujet ?
", " :
"");
795 if (strpos($toutsujet[$i],
'@') !==
false) {
796 $toutsujetdate = explode(
"@", $toutsujet[$i]);
799 $meilleursujet .=
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'daytext').
' ('.
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'%A').
')';
802 $tmps = explode(
'@', $toutsujet[$i]);
811 $meilleursujet = str_replace(
"°",
"'", $meilleursujet);
814 if ($nbofcheckbox >= 2) {
815 $vote_str = $langs->trans(
'votes');
816 print
'<p class="affichageresultats">'.
"\n";
818 if (isset($meilleurecolonne) && $compteursujet ==
"1") {
819 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoice').
": <b>".$meilleursujet.
"</b> - <b>".$meilleurecolonne.
"</b> ".$vote_str.
".\n";
820 } elseif (isset($meilleurecolonne)) {
821 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoices').
": <b>".$meilleursujet.
"</b> - <b>".$meilleurecolonne.
"</b> ".$vote_str.
".\n";
824 print
'</p><br>'.
"\n";
832$comments =
$object->getComments();
835 print
'<br>'.img_picto(
'',
'note',
'class="pictofixedwidth"').
'<span class="bold opacitymedium">'.$langs->trans(
"CommentsOfVoters").
':</span><br>'.
"\n";
837 foreach ($comments as $obj) {
841 print
'<div class="comment"><span class="usercomment">';
842 if (in_array($obj->usercomment, $listofvoters)) {
843 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?deletecomment='.$obj->id_comment.
'&sondage='.$numsondage.
'"> '.
img_picto(
'',
'delete.png',
'', 0, 0, 0,
'',
'nomarginleft').
'</a> ';
846 print
img_picto(
'',
'user',
'class="pictofixedwidth"').dol_htmlentities($obj->usercomment).
':</span> <span class="comment">'.
dol_nl2br(
dol_htmlentities($obj->comment)).
"</span></div>";
851if (
$object->allow_comments && $currentusername) {
852 print
'<br><div class="addcomment"><span class="opacitymedium">'.$langs->trans(
"AddACommentForPoll").
"</span><br>\n";
854 print
'<textarea name="comment" rows="'.ROWS_2.
'" class="quatrevingtpercent">'.
dol_escape_htmltag(
GETPOST(
'comment',
'alphanohtml'), 0, 1).
'</textarea><br>'.
"\n";
855 print $langs->trans(
"Name").
': ';
856 print
'<input type="text" name="commentuser" maxlength="64" value="'.dol_escape_htmltag(GETPOSTISSET(
'commentuser') ?
GETPOST(
'commentuser',
'alphanohtml') : (empty($_SESSION[
'nom']) ? $currentusername : $_SESSION[
'nom'])).
'"> '.
"\n";
857 print
'<input type="submit" class="button smallpaddingimp" name="ajoutcomment" value="'.dol_escape_htmltag($langs->trans(
"AddComment")).
'"><br>'.
"\n";
858 print
'</form>'.
"\n";
865print
'<a name="bas"></a>'.
"\n";
if( $user->socid > 0) if(! $user->hasRight('accounting', 'chartofaccount')) $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_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
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)
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.
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return a Dolibarr global constant int value.
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).
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_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...
getUserRemoteIP()
Return the IP of remote user.
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)
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.
httponly_accessforbidden($message='1', $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.