Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
bugfix: bad location was displayed in assigned events tab/rtticketvie…
…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
commit 8e2d396ee9863592ca4151329cd4bbd791195d4d
25 changes: 8 additions & 17 deletions lib/LMSManagers/LMSHelpdeskManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -760,24 +760,15 @@ 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)) {
$event_manager = new LMSEventManager($this->db, $this->auth, $this->cache);
$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] = $event_manager->GetEvent($row);
}
}

Expand Down