25 if (!defined(
'NOLOGIN')) {
28 if (!defined(
'NOCSRFCHECK')) {
29 define(
"NOCSRFCHECK", 1);
31 if (!defined(
'NOBROWSERNOTIF')) {
32 define(
'NOBROWSERNOTIF',
'1');
34 if (!defined(
'NOIPCHECK')) {
35 define(
'NOIPCHECK',
'1');
39 require
'../../main.inc.php';
40 require_once DOL_DOCUMENT_ROOT.
"/core/lib/admin.lib.php";
41 require_once DOL_DOCUMENT_ROOT.
"/core/lib/files.lib.php";
42 require_once DOL_DOCUMENT_ROOT.
"/opensurvey/class/opensurveysondage.class.php";
43 require_once DOL_DOCUMENT_ROOT.
"/opensurvey/lib/opensurvey.lib.php";
44 require_once DOL_DOCUMENT_ROOT.
'/core/lib/date.lib.php';
48 $action =
GETPOST(
'action',
'aZ09');
51 $numsondage =
GETPOST(
'sondage',
'alpha');
55 $result = $object->fetch(0, $numsondage);
57 $nblines = $object->fetch_lines();
63 if (empty($conf->opensurvey->enabled)) {
72 $nbcolonnes = substr_count($object->sujet,
',') + 1;
74 $listofvoters = explode(
',', $_SESSION[
"savevoter"]);
77 if (
GETPOST(
'ajoutcomment',
'alpha')) {
78 if (!$canbemodified) {
84 $comment =
GETPOST(
"comment",
'alphanohtml');
85 $comment_user =
GETPOST(
'commentuser',
'alphanohtml');
89 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Comment")),
null,
'errors');
93 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
96 if (!in_array($comment_user, $listofvoters)) {
97 setEventMessages($langs->trans(
"UserMustBeSameThanUserUsedToVote"),
null,
'errors');
102 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
107 if ($nb_post_max > 0) {
108 $sql =
"SELECT COUNT(id_comment) as nb_comments";
109 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_comments";
110 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
111 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
112 $resql = $db->query($sql);
114 $num = $db->num_rows(
$resql);
118 $obj = $db->fetch_object(
$resql);
119 $nb_post_ip = $obj->nb_comments;
124 if ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
125 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
130 $resql = $object->addComment($comment, $comment_user, $user_ip);
140 if (!$canbemodified) {
145 if (
GETPOST(
'nom',
'alphanohtml')) {
147 for ($i = 0; $i < $nbcolonnes; $i++) {
149 $nouveauchoix .=
"1";
151 $nouveauchoix .=
"2";
153 $nouveauchoix .=
"0";
158 $nb_post_max =
getDolGlobalInt(
"MAIN_SECURITY_MAX_POST_ON_PUBLIC_PAGES_BY_IP_ADDRESS", 200);
163 if ($nb_post_max > 0) {
164 $sql =
"SELECT COUNT(id_users) as nb_records";
165 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
166 $sql .=
" WHERE ip = '".$db->escape($user_ip).
"'";
167 $sql .=
" AND date_creation > '".$db->idate($minmonthpost).
"'";
168 $resql = $db->query($sql);
170 $num = $db->num_rows(
$resql);
174 $obj = $db->fetch_object(
$resql);
175 $nb_post_ip = $obj->nb_records;
181 $nom = substr(
GETPOST(
"nom",
'alphanohtml'), 0, 64);
184 $sql =
'SELECT id_users, nom as name';
185 $sql .=
' FROM '.MAIN_DB_PREFIX.
'opensurvey_user_studs';
186 $sql .=
" WHERE id_sondage='".$db->escape($numsondage).
"' AND nom = '".$db->escape($nom).
"' ORDER BY id_users";
187 $resql = $db->query($sql);
192 $num_rows = $db->num_rows(
$resql);
197 } elseif ($nb_post_max > 0 && $nb_post_ip >= $nb_post_max) {
198 setEventMessages($langs->trans(
"AlreadyTooMuchPostOnThisIPAdress"),
null,
'errors');
202 $sql =
'INSERT INTO '.MAIN_DB_PREFIX.
'opensurvey_user_studs (nom, id_sondage, reponses, ip, date_creation)';
203 $sql .=
" VALUES ('".$db->escape($nom).
"', '".$db->escape($numsondage).
"','".$db->escape($nouveauchoix).
"', '".$db->escape($user_ip).
"', '".$db->idate($now).
"')";
204 $resql = $db->query($sql);
208 $_SESSION[
"savevoter"] = $nom.
','.(empty($_SESSION[
"savevoter"]) ?
'' : $_SESSION[
"savevoter"]);
209 $listofvoters = explode(
',', $_SESSION[
"savevoter"]);
211 if ($object->mailsonde) {
212 if ($object->fk_user_creat) {
213 $userstatic =
new User($db);
214 $userstatic->fetch($object->fk_user_creat);
216 $email = $userstatic->email;
218 $email = $object->mail_admin;
223 include_once DOL_DOCUMENT_ROOT.
'/core/class/CMailFile.class.php';
225 $application = ($conf->global->MAIN_APPLICATION_TITLE ? $conf->global->MAIN_APPLICATION_TITLE :
'Dolibarr ERP/CRM');
227 $link = getUrlSondage($numsondage,
true);
228 $link =
'<a href="'.$link.
'">'.$link.
'</a>';
229 $body = str_replace(
'\n',
'<br>', $langs->transnoentities(
'EmailSomeoneVoted', $nom, $link));
232 $cmailfile =
new CMailFile(
"[".$application.
"] ".$langs->trans(
"Poll").
': '.$object->title, $email, $conf->global->MAIN_MAIL_EMAIL_FROM, $body,
null,
null,
null,
'',
'', 0, -1);
233 $result = $cmailfile->sendfile();
241 setEventMessages($langs->trans(
"ErrorFieldRequired", $langs->transnoentitiesnoconv(
"Name")),
null,
'errors');
247 $testmodifier =
false;
248 $testligneamodifier =
false;
249 $ligneamodifier = -1;
250 for ($i = 0; $i < $nblines; $i++) {
252 $ligneamodifier = $i;
253 $testligneamodifier =
true;
259 $testmodifier =
true;
265 for ($i = 0; $i < $nbcolonnes; $i++) {
267 $nouveauchoix .=
"1";
269 $nouveauchoix .=
"2";
271 $nouveauchoix .=
"0";
275 if (!$canbemodified) {
279 $idtomodify =
GETPOST(
"idtomodify".$modifier);
280 $sql =
'UPDATE '.MAIN_DB_PREFIX.
"opensurvey_user_studs";
281 $sql .=
" SET reponses = '".$db->escape($nouveauchoix).
"'";
282 $sql .=
" WHERE id_users = '".$db->escape($idtomodify).
"'";
284 $resql = $db->query($sql);
291 $idcomment =
GETPOST(
'deletecomment',
'int');
293 if (!$canbemodified) {
297 $resql = $object->deleteComment($idcomment);
308 $arrayofjs = array();
309 $arrayofcss = array(
'/opensurvey/css/style.css');
311 llxHeaderSurvey($object->title,
"", 0, 0, $arrayofjs, $arrayofcss, $numsondage);
313 if (empty($object->ref)) {
314 $langs->load(
"errors");
315 print $langs->trans(
"ErrorRecordNotFound");
324 $toutsujet = explode(
",", $object->sujet);
325 $listofanswers = array();
326 foreach ($toutsujet as $value) {
327 $tmp = explode(
'@', $value);
328 $listofanswers[] = array(
'label'=>$tmp[0],
'format'=>(!empty($tmp[1]) ? $tmp[1] :
'checkbox'));
330 $toutsujet = str_replace(
"°",
"'", $toutsujet);
334 print
'<div class="survey_invitation">'.$langs->trans(
"YouAreInivitedToVote").
'</div>';
335 print $langs->trans(
"OpenSurveyHowTo").
'<br>';
336 if (empty($object->allow_spy)) {
337 print
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPrivate").
'</span><br>';
339 print
$form->textwithpicto(
'<span class="opacitymedium">'.$langs->trans(
"YourVoteIsPublic").
'</span>', $langs->trans(
"CanSeeOthersVote")).
'<br>';
343 print
'<div class="corps"> '.
"\n";
346 $titre = str_replace(
"\\",
"", $object->title);
347 print
'<strong>'.dol_htmlentities($titre).
'</strong>';
350 if ($object->description) {
351 print
'<br><br>'.
"\n";
359 if (!$canbemodified) {
360 print
'<br><center><div class="quatrevingtpercent center warning">'.$langs->trans(
'SurveyExpiredInfo').
'</div></center>';
367 print
'<div class="cadre"> '.
"\n";
368 print
'<br><br>'.
"\n";
371 print
'<table class="resultats">'.
"\n";
374 if ($object->format ==
"D") {
377 print
'<td></td>'.
"\n";
381 $nbofsujet = count($toutsujet);
382 for ($i = 0; $i < $nbofsujet; $i++) {
383 if (isset($toutsujet[$i + 1]) && date(
'Y', intval($toutsujet[$i])) == date(
'Y', intval($toutsujet[$i + 1]))) {
386 print
'<td colspan='.$colspan.
' class="annee">'.date(
'Y', intval($toutsujet[$i])).
'</td>'.
"\n";
393 print
'<td></td>'.
"\n";
397 for ($i = 0; $i < $nbofsujet; $i++) {
398 $cur = intval($toutsujet[$i]);
400 if (isset($toutsujet[$i + 1]) ===
false) {
403 $next = intval($toutsujet[$i + 1]);
409 print
'<td colspan='.$colspan.
' class="mois">'.
dol_print_date($cur,
"%B").
'</td>'.
"\n";
416 print
'<td></td>'.
"\n";
420 for ($i = 0; $i < $nbofsujet; $i++) {
421 $cur = intval($toutsujet[$i]);
422 if (isset($toutsujet[$i + 1]) ===
false) {
425 $next = intval($toutsujet[$i + 1]);
430 print
'<td colspan="'.$colspan.
'" class="jour">'.
dol_print_date($cur,
"%a %e").
'</td>'.
"\n";
438 if (strpos($object->sujet,
'@') !==
false) {
440 print
'<td></td>'.
"\n";
442 for ($i = 0; isset($toutsujet[$i]); $i++) {
443 $heures = explode(
'@', $toutsujet[$i]);
444 if (isset($heures[1])) {
445 print
'<td class="heure">'.dol_htmlentities($heures[1]).
'</td>'.
"\n";
447 print
'<td class="heure"></td>'.
"\n";
456 print
'<td></td>'.
"\n";
458 for ($i = 0; isset($toutsujet[$i]); $i++) {
459 $tmp = explode(
'@', $toutsujet[$i]);
460 print
'<td class="sujet">'.dol_escape_htmltag($tmp[0]).
'</td>'.
"\n";
469 $sumagainst = array();
471 $sql =
"SELECT id_users, nom as name, id_sondage, reponses";
472 $sql .=
" FROM ".MAIN_DB_PREFIX.
"opensurvey_user_studs";
473 $sql .=
" WHERE id_sondage = '".$db->escape($numsondage).
"'";
474 $resql = $db->query($sql);
479 $num = $db->num_rows(
$resql);
480 while ($compteur < $num) {
481 $obj = $db->fetch_object(
$resql);
483 $ensemblereponses = $obj->reponses;
486 $mod_ok = (in_array($obj->name, $listofvoters));
488 if (!$mod_ok && !$object->allow_spy) {
496 print
'<td class="nom">'.dol_htmlentities($obj->name).
'</td>'.
"\n";
499 if (!$testligneamodifier) {
500 for ($i = 0; $i < $nbcolonnes; $i++) {
501 $car = substr($ensemblereponses, $i, 1);
504 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
505 if (((
string) $car) ==
"1") {
506 print
'<td class="ok">OK</td>'.
"\n";
508 print
'<td class="non">KO</td>'.
"\n";
511 if (!isset($sumfor[$i])) {
514 if (((
string) $car) ==
"1") {
518 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
519 if (((
string) $car) ==
"1") {
520 print
'<td class="ok">'.$langs->trans(
"Yes").
'</td>'.
"\n";
521 } elseif (((
string) $car) ==
"0") {
522 print
'<td class="non">'.$langs->trans(
"No").
'</td>'.
"\n";
524 print
'<td class="vide"> </td>'.
"\n";
527 if (!isset($sumfor[$i])) {
530 if (!isset($sumagainst[$i])) {
533 if (((
string) $car) ==
"1") {
536 if (((
string) $car) ==
"0") {
540 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
541 if (((
string) $car) ==
"1") {
542 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
543 } elseif (((
string) $car) ==
"0") {
544 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
546 print
'<td class="vide"> </td>'.
"\n";
549 if (!isset($sumfor[$i])) {
552 if (!isset($sumagainst[$i])) {
555 if (((
string) $car) ==
"1") {
558 if (((
string) $car) ==
"0") {
565 if ($compteur == $ligneamodifier) {
566 for ($i = 0; $i < $nbcolonnes; $i++) {
567 $car = substr($ensemblereponses, $i, 1);
568 print
'<td class="vide">';
569 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
570 print
'<input type="checkbox" name="choix'.$i.
'" value="1" ';
576 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
577 $arraychoice = array(
'2'=>
' ',
'0'=>$langs->trans(
"No"),
'1'=>$langs->trans(
"Yes"));
578 print
$form->selectarray(
"choix".$i, $arraychoice, $car);
580 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
581 $arraychoice = array(
'2'=>
' ',
'0'=>$langs->trans(
"Against"),
'1'=>$langs->trans(
"For"));
582 print
$form->selectarray(
"choix".$i, $arraychoice, $car);
587 for ($i = 0; $i < $nbcolonnes; $i++) {
588 $car = substr($ensemblereponses, $i, 1);
589 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
590 if (((
string) $car) ==
"1") {
591 print
'<td class="ok">OK</td>'.
"\n";
593 print
'<td class="non">KO</td>'.
"\n";
596 if (!isset($sumfor[$i])) {
599 if (((
string) $car) ==
"1") {
603 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
604 if (((
string) $car) ==
"1") {
605 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
606 } elseif (((
string) $car) ==
"0") {
607 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
609 print
'<td class="vide"> </td>'.
"\n";
612 if (!isset($sumfor[$i])) {
615 if (!isset($sumagainst[$i])) {
618 if (((
string) $car) ==
"1") {
621 if (((
string) $car) ==
"0") {
625 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
626 if (((
string) $car) ==
"1") {
627 print
'<td class="ok">'.$langs->trans(
"For").
'</td>'.
"\n";
628 } elseif (((
string) $car) ==
"0") {
629 print
'<td class="non">'.$langs->trans(
"Against").
'</td>'.
"\n";
631 print
'<td class="vide"> </td>'.
"\n";
634 if (!isset($sumfor[$i])) {
637 if (!isset($sumagainst[$i])) {
640 if (((
string) $car) ==
"1") {
643 if (((
string) $car) ==
"0") {
652 if ($compteur != $ligneamodifier && $mod_ok) {
653 print
'<td class="casevide"><input type="submit" class="button smallpaddingimp" name="modifierligne'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Edit")).
'"></td>'.
"\n";
657 for ($i = 0; $i < $nblines; $i++) {
659 if ($compteur == $i) {
660 print
'<td class="casevide">';
661 print
'<input type="hidden" name="idtomodify'.$compteur.
'" value="'.$obj->id_users.
'">';
662 print
'<input type="submit" class="button button-save" name="validermodifier'.$compteur.
'" value="'.
dol_escape_htmltag($langs->trans(
"Save")).
'">';
673 if ($ligneamodifier < 0 && (!isset($_SESSION[
'nom']))) {
675 print
'<td class="nom">'.
"\n";
676 if (isset($_SESSION[
'nom'])) {
677 print
'<input type=hidden name="nom" value="'.$_SESSION[
'nom'].
'">'.$_SESSION[
'nom'].
"\n";
679 print
'<input type="text" name="nom" placeholder="'.dol_escape_htmltag($langs->trans(
"Name")).
'" maxlength="64" class=" minwidth175">'.
"\n";
684 for ($i = 0; $i < $nbcolonnes; $i++) {
685 print
'<td class="vide">';
686 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
687 print
'<input type="checkbox" name="choix'.$i.
'" value="1"';
693 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
694 $arraychoice = array(
'2'=>
' ',
'0'=>$langs->trans(
"No"),
'1'=>$langs->trans(
"Yes"));
695 print
$form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
697 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
698 $arraychoice = array(
'2'=>
' ',
'0'=>$langs->trans(
"Against"),
'1'=>$langs->trans(
"For"));
699 print
$form->selectarray(
"choix".$i, $arraychoice,
GETPOST(
'choix'.$i));
705 print
'<td><input type="image" class="borderimp" name="boutonp" value="'.$langs->trans(
"Vote").
'" src="'.
img_picto(
'',
'edit_add',
'',
false, 1).
'"></td>'.
"\n";
711 for ($i = 0; $i < $nbcolonnes; $i++) {
712 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
715 if (isset($sumfor[$i])) {
717 $meilleurecolonne = $sumfor[$i];
719 if (!isset($meilleurecolonne) || $sumfor[$i] > $meilleurecolonne) {
720 $meilleurecolonne = $sumfor[$i];
725 if ($object->allow_spy) {
728 print
'<td class="center">'.$langs->trans(
"Total").
'</td>'.
"\n";
729 for ($i = 0; $i < $nbcolonnes; $i++) {
730 $showsumfor = isset($sumfor[$i]) ? $sumfor[$i] :
'';
731 $showsumagainst = isset($sumagainst[$i]) ? $sumagainst[$i] :
'';
732 if (empty($showsumfor)) {
735 if (empty($showsumagainst)) {
740 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst'))) {
743 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'yesno') {
744 print $langs->trans(
"Yes").
': '.$showsumfor.
'<br>'.$langs->trans(
"No").
': '.$showsumagainst;
746 if (!empty($listofanswers[$i][
'format']) && $listofanswers[$i][
'format'] ==
'foragainst') {
747 print $langs->trans(
"For").
': '.$showsumfor.
'<br>'.$langs->trans(
"Against").
': '.$showsumagainst;
753 if ($nbofcheckbox >= 2) {
755 print
'<td class="somme"></td>'.
"\n";
756 for ($i = 0; $i < $nbcolonnes; $i++) {
758 if (empty($listofanswers[$i][
'format']) || !in_array($listofanswers[$i][
'format'], array(
'yesno',
'foragainst')) && isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
759 print
'<td class="somme"><img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"></td>'.
"\n";
761 print
'<td class="somme"></td>'.
"\n";
767 print
'</table>'.
"\n";
770 if ($object->allow_spy) {
771 $toutsujet = explode(
",", $object->sujet);
772 $toutsujet = str_replace(
"°",
"'", $toutsujet);
777 for ($i = 0; $i < $nbcolonnes; $i++) {
778 if (isset($sumfor[$i]) && isset($meilleurecolonne) && $sumfor[$i] == $meilleurecolonne) {
779 $meilleursujet .= ($meilleursujet ?
", " :
"");
780 if ($object->format ==
"D") {
781 $meilleursujetexport = $toutsujet[$i];
782 if (strpos($toutsujet[$i],
'@') !==
false) {
783 $toutsujetdate = explode(
"@", $toutsujet[$i]);
786 $meilleursujet .=
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'daytext').
' ('.
dol_print_date((empty($toutsujet[$i]) ? 0 : $toutsujet[$i]),
'%A').
')';
789 $tmps = explode(
'@', $toutsujet[$i]);
797 $meilleursujet = substr(
"$meilleursujet", 1);
798 $meilleursujet = str_replace(
"°",
"'", $meilleursujet);
801 if ($nbofcheckbox >= 2) {
802 $vote_str = $langs->trans(
'votes');
803 print
'<p class="affichageresultats">'.
"\n";
805 if (isset($meilleurecolonne) && $compteursujet ==
"1") {
806 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoice').
": <b>".$meilleursujet.
"</b> ".$langs->trans(
'with').
" <b>".$meilleurecolonne.
"</b>".$vote_str.
".\n";
807 } elseif (isset($meilleurecolonne)) {
808 print
'<img src="'.dol_buildpath(
'/opensurvey/img/medaille.png', 1).
'"> '.$langs->trans(
'TheBestChoices').
": <b>".$meilleursujet.
"</b> ".$langs->trans(
'with').
" <b>".$meilleurecolonne.
"</b>".$vote_str.
".\n";
811 print
'</p><br>'.
"\n";
819 $comments = $object->getComments();
822 print
'<br><u><span class="bold opacitymedium">'.$langs->trans(
"CommentsOfVoters").
':</span></u><br>'.
"\n";
824 foreach ($comments as $obj) {
828 print
'<div class="comment"><span class="usercomment">';
829 if (in_array($obj->usercomment, $listofvoters)) {
830 print
'<a href="'.$_SERVER[
"PHP_SELF"].
'?deletecomment='.$obj->id_comment.
'&sondage='.$numsondage.
'"> '.
img_picto(
'',
'delete.png',
'',
false, 0, 0,
'',
'nomarginleft').
'</a> ';
838 if ($object->allow_comments) {
839 print
'<br><div class="addcomment"><span class="opacitymedium">'.$langs->trans(
"AddACommentForPoll").
"</span><br>\n";
841 print
'<textarea name="comment" rows="'.ROWS_2.
'" class="quatrevingtpercent">'.
dol_escape_htmltag(
GETPOST(
'comment',
'alphanohtml'), 0, 1).
'</textarea><br>'.
"\n";
842 print $langs->trans(
"Name").
': ';
843 print
'<input type="text" name="commentuser" maxlength="64" value="'.dol_escape_htmltag(
GETPOST(
'commentuser',
'alphanohtml')).
'"> '.
"\n";
844 print
'<input type="submit" class="button" name="ajoutcomment" value="'.dol_escape_htmltag($langs->trans(
"AddComment")).
'"><br>'.
"\n";
845 print
'</form>'.
"\n";
852 print
'<a name="bas"></a>'.
"\n";
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.
if(isModEnabled('facture') &&!empty($user->rights->facture->lire)) if((isModEnabled('fournisseur') &&empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->hasRight("fournisseur", "facture", "lire"))||(isModEnabled('supplier_invoice') && $user->hasRight("supplier_invoice", "lire"))) if(isModEnabled('don') &&!empty($user->rights->don->lire)) if(isModEnabled('tax') &&!empty($user->rights->tax->charges->lire)) if(isModEnabled('facture') &&isModEnabled('commande') && $user->hasRight("commande", "lire") &&empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) $resql
Social contributions to pay.
if($cancel &&! $id) if($action=='add' &&! $cancel) if($action=='delete') if($id) $form
Actions.
dol_time_plus_duree($time, $duration_value, $duration_unit, $ruleforendofmonth=0)
Add a delay to a date.
dol_escape_htmltag($stringtoescape, $keepb=0, $keepn=0, $noescapetags='', $escapeonlyhtmltags=0)
Returns text escaped for inclusion in HTML alt or title tags, or into values of HTML input fields.
dol_print_error($db='', $error='', $errors=null)
Displays error message system with all the information to facilitate the diagnosis and the escalation...
dol_nl2br($stringtoencode, $nl2brmode=0, $forxml=false)
Replace CRLF in string with a HTML BR tag.
setEventMessages($mesg, $mesgs, $style='mesgs', $messagekey='')
Set event messages in dol_events session object.
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_now($mode='auto')
Return date for now.
getDolGlobalInt($key, $default=0)
Return dolibarr global constant int value.
img_picto($titlealt, $picto, $moreatt='', $pictoisfullpath=false, $srconly=0, $notitle=0, $alt='', $morecss='', $marginleftonlyshort=2)
Show picto whatever it's its name (generic function)
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.
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...
getUserRemoteIP()
Return the IP of remote user.
httponly_accessforbidden($message=1, $http_response_code=403, $stringalreadysanitized=0)
Show a message to say access is forbidden and stop program.