diff --git a/config/routes/geofence.yaml b/config/routes/geofence.yaml index a050cc85..58a5dc3f 100644 --- a/config/routes/geofence.yaml +++ b/config/routes/geofence.yaml @@ -4,11 +4,6 @@ geofence_list: path: /geofence controller: App\Controller\GeofenceController::index -geofence_rows: - path: /geofence/rows - controller: App\Controller\GeofenceController::rows - methods: [POST] - geofence_upload_kml: path: /geofence/upload controller: App\Controller\GeofenceController::uploadKML diff --git a/src/Controller/GeofenceController.php b/src/Controller/GeofenceController.php index 7ccc4277..8c25983c 100644 --- a/src/Controller/GeofenceController.php +++ b/src/Controller/GeofenceController.php @@ -33,48 +33,6 @@ class GeofenceController extends BaseController return $this->render('geofence/list.html.twig', $params); } - public function rows(Request $req) - { - $this->denyAccessUnlessGranted('geofence.list', null, 'No access.'); - - $params = $this->initParameters('geofence_list'); - - // get query builder - $obj_rows = $this->getDoctrine() - ->getRepository(SupportedArea::class) - ->findAll(); - - // add metadata - $meta = [ - 'sort' => 'asc', - 'field' => 'id' - ]; - - // process rows - $rows = []; - foreach($obj_rows as $orow) { - // add row data - $row['id'] = $orow->getID(); - $row['name'] = $orow->getName(); - - // add row metadata - $row['meta'] = [ - 'delete_url' => '' - ]; - - if ($this->isGranted('geofence.delete')) - $row['meta']['delete_url'] = $this->generateUrl('geofence_delete', ['id' => $row['id']]); - - $rows[] = $row; - } - - // response - return $this->json([ - 'meta' => $meta, - 'data' => $rows - ]); - } - public function addForm() { $this->denyAccessUnlessGranted('geofence.add', null, 'No access.'); diff --git a/templates/geofence/list.html.twig b/templates/geofence/list.html.twig index c3c417e9..1b9598bc 100644 --- a/templates/geofence/list.html.twig +++ b/templates/geofence/list.html.twig @@ -35,16 +35,45 @@ -
@@ -60,6 +89,8 @@ {% endblock %} - -