Merge pull request #22454 from hregis/fixme_this_update_override_initial_message

FIX avoid override initial message ($this instead $object)
This commit is contained in:
Laurent Destailleur 2022-10-08 00:06:58 +02:00 committed by GitHub
commit 7a122c718a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2756,8 +2756,8 @@ class Ticket extends CommonObject
$result = $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames); $result = $this->sendTicketMessageByEmail($subject, $message, '', $sendto, $listofpaths, $listofmimes, $listofnames);
if ($result) { if ($result) {
// update last_msg_sent date // update last_msg_sent date
$object->date_last_msg_sent = dol_now(); $this->date_last_msg_sent = dol_now();
$object->update($user); $this->update($user);
} }
} }
} }
@ -2766,7 +2766,7 @@ class Ticket extends CommonObject
} }
// Set status to "answered" if not set yet, but only if internal user // Set status to "answered" if not set yet, but only if internal user
if ($object->fk_statut < 3 && !$user->socid) { if ($object->status < 3 && !$user->socid) {
$object->setStatut(3); $object->setStatut(3);
} }
return 1; return 1;