Skip to content

Commit

Permalink
Merge pull request #11618 from ptibogxiv/patch-203
Browse files Browse the repository at this point in the history
FIX author in message / ticket API
  • Loading branch information
eldy committed Aug 9, 2019
2 parents 76b0f42 + 7a2e08a commit 13a8ef8
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions htdocs/ticket/class/api_tickets.class.php
Expand Up @@ -160,15 +160,15 @@ private function getCommon($id = 0, $track_id = '', $ref = '')
$num = count($this->ticket->cache_msgs_ticket);
$i = 0;
while ($i < $num) {
if ($this->ticket->cache_msgs_ticket[$i]['fk_user_action'] > 0) {
if ($this->ticket->cache_msgs_ticket[$i]['fk_user_author'] > 0) {
$user_action = new User($this->db);
$user_action->fetch($this->ticket->cache_msgs_ticket[$i]['fk_user_action']);
$user_action->fetch($this->ticket->cache_msgs_ticket[$i]['fk_user_author']);
}

// Now define messages
$messages[] = array(
'id' => $this->ticket->cache_msgs_ticket[$i]['id'],
'fk_user_action' => $this->ticket->cache_msgs_ticket[$i]['fk_user_action'],
'fk_user_action' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'],
'fk_user_action_socid' => $user_action->socid,
'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname),
'message' => $this->ticket->cache_msgs_ticket[$i]['message'],
Expand All @@ -195,6 +195,7 @@ private function getCommon($id = 0, $track_id = '', $ref = '')
// Now define messages
$history[] = array(
'id' => $this->ticket->cache_logs_ticket[$i]['id'],
'fk_user_author' => $this->ticket->cache_msgs_ticket[$i]['fk_user_author'],
'fk_user_action' => $this->ticket->cache_logs_ticket[$i]['fk_user_create'],
'fk_user_action_string' => dolGetFirstLastname($user_action->firstname, $user_action->lastname),
'message' => $this->ticket->cache_logs_ticket[$i]['message'],
Expand Down

0 comments on commit 13a8ef8

Please sign in to comment.