Skip to content

Commit

Permalink
bugfix: bad location was displayed in assigned events tab/rtticketvie…
Browse files Browse the repository at this point in the history
…w form (event location was always customer register location address, no matter what we choose in event location)
  • Loading branch information
interduo committed Jul 22, 2024
1 parent 4d9366d commit 8cf9950
Showing 1 changed file with 9 additions and 17 deletions.
26 changes: 9 additions & 17 deletions lib/LMSManagers/LMSHelpdeskManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,30 +760,22 @@ public function GetQueueNameByTicketId($id)

public function GetEventsByTicketId($id)
{
$events = $this->db->GetAll('SELECT events.id as id, title, description, note, date, begintime, endtime, '
. 'userid, customerid, private, closed, closeddate, closeduserid, events.type, ticketid, va.location, '
. $this->db->Concat('customers.lastname', "' '", 'customers.name').' AS customername, '
. $this->db->Concat('users.firstname', "' '", 'users.lastname').' AS username, '
. $this->db->Concat('u.firstname', "' '", 'u.lastname').' AS closedusername, vn.name AS node_name, '
. $this->db->Concat('c.city', "', '", 'c.address') . ' AS customerlocation, vn.location AS node_location '
. 'FROM events '
. 'LEFT JOIN customers ON (customerid = customers.id) '
. 'LEFT JOIN users ON (userid = users.id) '
. 'LEFT JOIN users u ON (closeduserid = u.id) '
. 'LEFT JOIN vaddresses va ON va.id = events.address_id '
. 'LEFT JOIN vnodes as vn ON (nodeid = vn.id) '
. 'LEFT JOIN customerview c ON (events.customerid = c.id) '
. 'WHERE ticketid = ? ORDER BY events.id ASC', array($id));

if (is_array($events)) {
global $LMS;
$events = $this->db->GetAll(
'SELECT id FROM events WHERE ticketid = ? ORDER BY id ASC',
array($id)
);

if (!empty($events)) {
foreach ($events as $idx => $row) {
$events[$idx]['userlist'] = $this->db->GetAll("SELECT vu.name,userid AS ul FROM eventassignments AS e LEFT JOIN vusers vu ON vu.id = e.userid WHERE eventid = $row[id]");
$events[$idx] = $LMS->GetEvent($row);
}
}

return $events;
}


public function GetQueueName($id)
{
return $this->db->GetOne('SELECT name FROM rtqueues WHERE id=?', array($id));
Expand Down

0 comments on commit 8cf9950

Please sign in to comment.