From ad0becdc978a27f1b83622c8075a7b653fa54c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hu=CC=88bner?= Date: Mon, 24 Apr 2017 19:17:08 +0200 Subject: [PATCH 1/4] Add button to check authorities. --- .../Resources/views/Incident/show.html.twig | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/AppBundle/Resources/views/Incident/show.html.twig b/src/AppBundle/Resources/views/Incident/show.html.twig index 745095c..d1e086e 100644 --- a/src/AppBundle/Resources/views/Incident/show.html.twig +++ b/src/AppBundle/Resources/views/Incident/show.html.twig @@ -131,6 +131,18 @@
+
+

+ Zuständigkeit prüfen +

+ +

+ + Zuständigkeit prüfen + +

+
+

Details From 62cd762847bf51604ae00d413b07c8048cda736f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hu=CC=88bner?= Date: Mon, 24 Apr 2017 19:25:46 +0200 Subject: [PATCH 2/4] Add Authority entity. --- src/AppBundle/Entity/Authority.php | 219 +++++++++++++++++++++++++++++ 1 file changed, 219 insertions(+) create mode 100644 src/AppBundle/Entity/Authority.php diff --git a/src/AppBundle/Entity/Authority.php b/src/AppBundle/Entity/Authority.php new file mode 100644 index 0000000..5f837e5 --- /dev/null +++ b/src/AppBundle/Entity/Authority.php @@ -0,0 +1,219 @@ +id; + } + + public function getTitle(): ?string + { + return $this->title; + } + + public function setTitle(string $title): Authority + { + $this->title = $title; + + return $this; + } + + public function getDescription(): ?string + { + return $this->description; + } + + public function setDescription(string $description): Authority + { + $this->description = $description; + + return $this; + } + + public function getAddress(): ?string + { + return $this->address; + } + + public function setAddress(string $address): Authority + { + $this->address = $address; + + return $this; + } + + public function getStreet(): ?string + { + return $this->street; + } + + public function setStreet(string $street): Authority + { + $this->street = $street; + return $this; + } + + public function getHouseNumber(): ?string + { + return $this->houseNumber; + } + + public function setHouseNumber(string $houseNumber): Authority + { + $this->houseNumber = $houseNumber; + + return $this; + } + + public function getZipCode(): ?string + { + return $this->zipCode; + } + + public function setZipCode(string $zipCode): Authority + { + $this->zipCode = $zipCode; + + return $this; + } + + public function getCity(): ?string + { + return $this->city; + } + + public function setCity(string $city): Authority + { + $this->city = $city; + + return $this; + } + + public function getPolygon(): ?string + { + return $this->polygon; + } + + public function setPolygon(string $polygon): Authority + { + $this->polygon = $polygon; + + return $this; + } + + public function getLatitude(): ?float + { + return $this->latitude; + } + + public function setLatitude(float $latitude): CoordinateInterface + { + $this->latitude = $latitude; + + return $this; + } + + public function getLongitude(): ?float + { + return $this->longitude; + } + + public function setLongitude(float $longitude): CoordinateInterface + { + $this->longitude = $longitude; + return $this; + } + + public function getPin(): string + { + return $this->latitude . ',' . $this->longitude; + } +} From 87f9d2c52add2ff7a697e4c3c83de0d4daf16409 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hu=CC=88bner?= Date: Mon, 24 Apr 2017 19:28:38 +0200 Subject: [PATCH 3/4] Add basic authority admin. --- src/AppBundle/Admin/AuthorityAdmin.php | 48 ++++++++++++++++++++++++ src/AppBundle/Resources/config/admin.xml | 10 +++++ 2 files changed, 58 insertions(+) create mode 100644 src/AppBundle/Admin/AuthorityAdmin.php diff --git a/src/AppBundle/Admin/AuthorityAdmin.php b/src/AppBundle/Admin/AuthorityAdmin.php new file mode 100644 index 0000000..8e31ead --- /dev/null +++ b/src/AppBundle/Admin/AuthorityAdmin.php @@ -0,0 +1,48 @@ +add('title') + ->add('description') + ; + } + + // Fields to be shown on filter forms + protected function configureDatagridFilters(DatagridMapper $datagridMapper) + { + $datagridMapper + ->add('title') + ; + } + + // Fields to be shown on lists + protected function configureListFields(ListMapper $listMapper) + { + $listMapper + ->addIdentifier('title') + ; + } + + // Fields to be shown on show action + protected function configureShowFields(ShowMapper $showMapper) + { + $showMapper + ->add('title') + ; + } +} diff --git a/src/AppBundle/Resources/config/admin.xml b/src/AppBundle/Resources/config/admin.xml index 584af6d..28b5f1b 100644 --- a/src/AppBundle/Resources/config/admin.xml +++ b/src/AppBundle/Resources/config/admin.xml @@ -24,5 +24,15 @@ AppBundle + + + + + AppBundle\Entity\Authority + + + AppBundle + + From 0ef2e3573c28e7ae7ca0040cdbde7f694182f62a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20Hu=CC=88bner?= Date: Mon, 24 Apr 2017 19:32:29 +0200 Subject: [PATCH 4/4] Add some more fields to admin. --- src/AppBundle/Admin/AuthorityAdmin.php | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/AppBundle/Admin/AuthorityAdmin.php b/src/AppBundle/Admin/AuthorityAdmin.php index 8e31ead..bb1e0ad 100644 --- a/src/AppBundle/Admin/AuthorityAdmin.php +++ b/src/AppBundle/Admin/AuthorityAdmin.php @@ -7,10 +7,6 @@ use Sonata\AdminBundle\Form\FormMapper; use Sonata\AdminBundle\Datagrid\ListMapper; use Sonata\AdminBundle\Datagrid\DatagridMapper; -use Symfony\Component\Form\Extension\Core\Type\CheckboxType; -use Symfony\Component\Form\Extension\Core\Type\EmailType; -use Symfony\Component\Form\Extension\Core\Type\PasswordType; -use Symfony\Component\Form\Extension\Core\Type\TextType; class AuthorityAdmin extends AbstractAdmin { @@ -19,6 +15,13 @@ protected function configureFormFields(FormMapper $formMapper) $formMapper ->add('title') ->add('description') + ->add('street') + ->add('houseNumber') + ->add('zipCode') + ->add('city') + ->add('latitude') + ->add('longitude') + ->add('polygon') ; }