Skip to content

Commit

Permalink
Merge branch '20.0' of [email protected]:Dolibarr/dolibarr.git into 20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Oct 3, 2024
1 parent f09ef5d commit 4c695be
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions htdocs/ticket/class/ticket.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1710,8 +1710,8 @@ public function markAsRead($user, $notrigger = 0)
$this->oldcopy = dol_clone($this, 2);

$this->db->begin();
$oldStatus = $this->fk_statut;
$this->fk_statut = Ticket::STATUS_READ;

$this->status = Ticket::STATUS_READ;

$sql = "UPDATE ".MAIN_DB_PREFIX."ticket";
$sql .= " SET fk_statut = ".Ticket::STATUS_READ.", date_read = '".$this->db->idate(dol_now())."'";
Expand All @@ -1727,7 +1727,6 @@ public function markAsRead($user, $notrigger = 0)
// Call trigger
$result = $this->call_trigger('TICKET_MODIFY', $user);
if ($result < 0) {
$this->fk_statut = $oldStatus;
$error++;
}
// End call triggers
Expand All @@ -1737,14 +1736,16 @@ public function markAsRead($user, $notrigger = 0)
$this->db->commit();
return 1;
} else {
$this->fk_statut = $oldStatus;
$this->status = $this->oldcopy->status;

$this->db->rollback();
$this->error = implode(',', $this->errors);
dol_syslog(get_class($this)."::markAsRead ".$this->error, LOG_ERR);
return -1;
}
} else {
$this->fk_statut = $oldStatus;
$this->status = $this->oldcopy->status;

$this->db->rollback();
$this->error = $this->db->lasterror();
dol_syslog(get_class($this)."::markAsRead ".$this->error, LOG_ERR);
Expand Down

0 comments on commit 4c695be

Please sign in to comment.