Update don.class.php

This commit is contained in:
Frédéric FRANCE 2020-11-22 21:13:11 +01:00 committed by GitHub
parent af2eabb24d
commit 432adaa47f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -735,8 +735,7 @@ class Don extends CommonObject
{ {
if ($this->db->affected_rows($resql)) if ($this->db->affected_rows($resql))
{ {
if (!$notrigger) if (!$notrigger) {
{
// Call trigger // Call trigger
$result = $this->call_trigger('DON_VALIDATE', $user); $result = $this->call_trigger('DON_VALIDATE', $user);
if ($result < 0) { $error++; } if ($result < 0) { $error++; }
@ -748,8 +747,8 @@ class Don extends CommonObject
$this->error = $this->db->lasterror(); $this->error = $this->db->lasterror();
} }
if (!$error) if (!$error) {
{ $this->statut = 1;
$this->db->commit(); $this->db->commit();
return 1; return 1;
} else { } else {
@ -777,10 +776,9 @@ class Don extends CommonObject
$sql .= " WHERE rowid = ".$id." AND fk_statut = 1"; $sql .= " WHERE rowid = ".$id." AND fk_statut = 1";
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql) {
{ if ($this->db->affected_rows($resql)) {
if ($this->db->affected_rows($resql)) $this->statut = 2;
{
return 1; return 1;
} else { } else {
return 0; return 0;
@ -804,10 +802,9 @@ class Don extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$id; $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = -1 WHERE rowid = ".$id;
$resql = $this->db->query($sql); $resql = $this->db->query($sql);
if ($resql) if ($resql) {
{ if ($this->db->affected_rows($resql)) {
if ($this->db->affected_rows($resql)) $this->statut = -1;
{
return 1; return 1;
} else { } else {
return 0; return 0;
@ -828,8 +825,7 @@ class Don extends CommonObject
public function reopen($user, $notrigger = 0) public function reopen($user, $notrigger = 0)
{ {
// Protection // Protection
if ($this->statut != self::STATUS_CANCELED) if ($this->statut != self::STATUS_CANCELED) {
{
return 0; return 0;
} }