From 6de894487cf21ff7d795b2a9d33594fc2d08235f Mon Sep 17 00:00:00 2001 From: Caluera Date: Sun, 10 Oct 2021 14:06:31 +0200 Subject: [PATCH] added expiration date and helper to resolveTicket --- lib/Service/TicketService.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/Service/TicketService.php b/lib/Service/TicketService.php index 55d3787..03f5a48 100644 --- a/lib/Service/TicketService.php +++ b/lib/Service/TicketService.php @@ -79,12 +79,20 @@ class TicketService { $title = array_get($matrixTicketContent, "title", "Untitled"); $description = array_get($matrixTicketContent, "description", ""); $lastModified = $this->matrix->getLastEventDate($ticket->getMatrixRoom()); + $matrixHelperUser = $ticket->getMatrixHelperUser(); + $matrixHelperUserName = $matrixHelperUser ? "Helfer Name" : "nicht zugewiesen"; + //FIXME : set $maxHelpTime somewhere as an option or at least available for other functions + $maxHelpTime = 7 * 24 * 60 * 60 * 1000; + $expirationDate = $lastModified + $maxHelpTime; return array( 'ticketId' => $ticketId, 'status' => $ticket->getStatus(), 'lastModified' => $lastModified, 'title' => $title, 'description' => $description, + 'matrixHelperUser' => $matrixHelperUser, + 'matrixHelferName' => $matrixHelperUserName, + 'expirationDate' => $expirationDate ); } catch (MatrixException | RoomNotFoundException $e) { return array(