Update card.php
This commit is contained in:
parent
5c72ee47a2
commit
f8beca56b8
@ -117,7 +117,7 @@ if (empty($reshook))
|
|||||||
$object->date_fin = $expiredate;
|
$object->date_fin = $expiredate;
|
||||||
$object->allow_comments = GETPOST('cancomment', 'aZ09') == 'on' ? 1 : 0;
|
$object->allow_comments = GETPOST('cancomment', 'aZ09') == 'on' ? 1 : 0;
|
||||||
$object->allow_spy = GETPOST('canseeothersvote', 'aZ09') == 'on' ? 1 : 0;
|
$object->allow_spy = GETPOST('canseeothersvote', 'aZ09') == 'on' ? 1 : 0;
|
||||||
$object->mailsonde = GETPOST('mailsonde', 'aZ09') == 'on' ? true : false;
|
$object->mailsonde = GETPOST('mailsonde', 'aZ09') == 'on' ? 1 : 0;
|
||||||
|
|
||||||
$res = $object->update($user);
|
$res = $object->update($user);
|
||||||
if ($res < 0) {
|
if ($res < 0) {
|
||||||
@ -132,21 +132,18 @@ if (empty($reshook))
|
|||||||
{
|
{
|
||||||
$error = 0;
|
$error = 0;
|
||||||
|
|
||||||
if (!GETPOST('comment'))
|
if (!GETPOST('comment')) {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("Comment")), null, 'errors');
|
||||||
}
|
}
|
||||||
if (!GETPOST('commentuser'))
|
if (!GETPOST('commentuser')) {
|
||||||
{
|
|
||||||
$error++;
|
$error++;
|
||||||
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors');
|
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("User")), null, 'errors');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$error)
|
if (!$error) {
|
||||||
{
|
$comment = (string) GETPOST("comment", "restricthtml");
|
||||||
$comment = GETPOST("comment");
|
$comment_user = (string) GETPOST('commentuser', "restricthtml");
|
||||||
$comment_user = GETPOST('commentuser');
|
|
||||||
|
|
||||||
$resql = $object->addComment($comment, $comment_user);
|
$resql = $object->addComment($comment, $comment_user);
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user