diff --git a/web/modules/custom/hoeringsportal_data/hoeringsportal_data.routing.yml b/web/modules/custom/hoeringsportal_data/hoeringsportal_data.routing.yml index 2988b902..17e97a64 100644 --- a/web/modules/custom/hoeringsportal_data/hoeringsportal_data.routing.yml +++ b/web/modules/custom/hoeringsportal_data/hoeringsportal_data.routing.yml @@ -38,14 +38,6 @@ hoeringsportal_data.api_controller_geojson_hearings: requirements: _permission: 'access content' -hoeringsportal_data.api_controller_geojson_tickets: - path: '/api/geojson/tickets' - defaults: - _controller: '\Drupal\hoeringsportal_data\Controller\Api\GeoJSON\TicketController::index' - _title: 'Tickets' - requirements: - _permission: 'access content' - hoeringsportal_data.api_controller_geojson_public_meeting_dates: path: '/api/geojson/public_meetings/dates' defaults: diff --git a/web/modules/custom/hoeringsportal_data/src/Controller/Api/DefaultController.php b/web/modules/custom/hoeringsportal_data/src/Controller/Api/DefaultController.php index 9c47bf9b..b82dd2cd 100644 --- a/web/modules/custom/hoeringsportal_data/src/Controller/Api/DefaultController.php +++ b/web/modules/custom/hoeringsportal_data/src/Controller/Api/DefaultController.php @@ -18,7 +18,6 @@ public function index() { 'geojson' => [ 'hearings' => $this->generateUrl('hoeringsportal_data.api_controller_geojson_hearings'), 'public_meeting_dates' => $this->generateUrl('hoeringsportal_data.api_controller_geojson_public_meeting_dates'), - 'tickets' => $this->generateUrl('hoeringsportal_data.api_controller_geojson_tickets'), 'v2' => [ 'hearings' => $this->generateUrl('hoeringsportal_data.api_geojson_v2_hearings'), ], diff --git a/web/modules/custom/hoeringsportal_data/src/Controller/Api/GeoJSON/TicketController.php b/web/modules/custom/hoeringsportal_data/src/Controller/Api/GeoJSON/TicketController.php deleted file mode 100644 index 0de75cfe..00000000 --- a/web/modules/custom/hoeringsportal_data/src/Controller/Api/GeoJSON/TicketController.php +++ /dev/null @@ -1,42 +0,0 @@ -getTickets(); - $features = array_values(array_map([$this->helper(), 'serializeGeoJsonTicket'], $entities)); - $response = $this->createGeoJsonResponse($features); - - return $response; - } - - /** - * Get tickets. - */ - private function getTickets() { - $hearings = $this->helper()->getHearings(); - - $tickets = []; - foreach ($hearings as $hearing) { - foreach ($this->helper()->getHearingTickets($hearing) as $ticket) { - $tickets[] = (object) [ - 'data' => $ticket, - 'hearing' => $hearing, - ]; - } - } - - return $tickets; - } - -} diff --git a/web/modules/custom/hoeringsportal_data/src/Helper/GeoJsonHelper.php b/web/modules/custom/hoeringsportal_data/src/Helper/GeoJsonHelper.php index 6027d5e7..7ff301cf 100644 --- a/web/modules/custom/hoeringsportal_data/src/Helper/GeoJsonHelper.php +++ b/web/modules/custom/hoeringsportal_data/src/Helper/GeoJsonHelper.php @@ -255,32 +255,6 @@ public function serializeGeoJsonPublicMeetingDate(object $date) { return $serialized; } - /** - * Serialize Ticket as GeoJSON. - */ - public function serializeGeoJsonTicket(object $ticket) { - $serialized = $this->serializeGeoJsonHearing($ticket->hearing); - - $properties = &$serialized['properties']; - - $data = $ticket->data; - $fields = $data->fields; - $properties = [ - 'ticket_id' => $data->id, - 'ticket_hearing_id' => (int) $ticket->hearing->id(), - 'ticket_message' => $fields->message ?? NULL, - 'ticket_person_name' => $data->person->name ?? NULL, - 'ticket_organization' => $fields->organization ?? NULL, - 'ticket_pdf_download_url' => $fields->pdf_download_url ?? NULL, - 'ticket_url' => $this->generateUrl('hoeringsportal_deskpro.hearing.ticket_view', [ - 'node' => $ticket->hearing->id(), - 'ticket' => $data->id, - ]), - ]; - - return $serialized; - } - /** * Get hearing tickets count. *