-
- - Last modified: {{ record.modifiedAt.format('Y-m-d') }} - at {{ record.modifiedAt.format('H:i:s') }} -
-Editor: {{ record.editor }}
-diff --git a/src/Controller/BibliographyController.php b/src/Controller/BibliographyController.php index 9bbb1a2..03793f9 100644 --- a/src/Controller/BibliographyController.php +++ b/src/Controller/BibliographyController.php @@ -17,8 +17,24 @@ use DateTimeImmutable; class BibliographyController extends AbstractController { - #[Route('/bibliography/{id<\d+>}', name: 'app_bibliography')] - public function index(Bibliography $bibliography, EntityManagerInterface $em): Response + #[Route('/bibliography', name: 'app_bibliography')] + public function index(EntityManagerInterface $em): Response + { + $repo = $em->getRepository(Bibliography::class); + $records = $repo->findBy([], ['id' => 'DESC']); + $count = count($records); + + $records = array_slice($records, 0, 15); + + return $this->render('bibliography/index.html.twig', [ + 'controller_name' => 'BibliographyController', + 'records' => $records, + 'count' => $count, + ]); + } + + #[Route('/bibliography/{id<\d+>}', name: 'app_bibliography_view')] + public function view(Bibliography $bibliography, EntityManagerInterface $em): Response { $repo = $em->getRepository(Collection::class); $collections = $repo->findAllByBibliography($bibliography->getId()); @@ -33,28 +49,12 @@ class BibliographyController extends AbstractController $bibliography->setEditableStatus($isEditable); - return $this->render('bibliography/index.html.twig', [ + return $this->render('bibliography/view.html.twig', [ 'controller_name' => 'BibliographyController', 'record' => $bibliography, ]); } - #[Route('/bibliography', name: 'app_bibliography_landing')] - public function landing(EntityManagerInterface $em): Response - { - $repo = $em->getRepository(Bibliography::class); - $records = $repo->findBy([], ['id' => 'DESC']); - $count = count($records); - - $records = array_slice($records, 0, 15); - - return $this->render('bibliography/landing.html.twig', [ - 'controller_name' => 'BibliographyController', - 'records' => $records, - 'count' => $count, - ]); - } - #[Route('/bibliography/search', name: 'app_bibliography_search')] public function search(): Response { @@ -96,7 +96,7 @@ class BibliographyController extends AbstractController $this->addFlash('notice', 'Record deleted successfully'); } - return $this->redirectToRoute('app_bibliography_landing'); + return $this->redirectToRoute('app_bibliography'); } /** @@ -137,6 +137,6 @@ class BibliographyController extends AbstractController $this->addFlash('notice', 'Record copied successfully'); - return $this->redirectToRoute('app_bibliography', ['id' => $copy->getId()]); + return $this->redirectToRoute('app_bibliography_view', ['id' => $copy->getId()]); } } diff --git a/src/Controller/CollectionController.php b/src/Controller/CollectionController.php index bf73644..3cb7c0a 100644 --- a/src/Controller/CollectionController.php +++ b/src/Controller/CollectionController.php @@ -15,8 +15,24 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class CollectionController extends AbstractController { - #[Route('/collection/{id<\d+>}', name: 'app_collection')] - public function index(Collection $collection, EntityManagerInterface $em): Response + #[Route('/collection', name: 'app_collection')] + public function index(EntityManagerInterface $em): Response + { + $repo = $em->getRepository(Collection::class); + $records = $repo->findBy([], ['modifiedAt' => 'DESC']); + $count = count($records); + + $records = array_slice($records, 0, 15); + + return $this->render('collection/index.html.twig', [ + 'controller_name' => 'CollectionController', + 'records' => $records, + 'count' => $count, + ]); + } + + #[Route('/collection/{id<\d+>}', name: 'app_collection_view')] + public function view(Collection $collection, EntityManagerInterface $em): Response { $repo = $em->getRepository(Bibliography::class); $bibliographies = $repo->findAllByCollection($collection->getId()); @@ -26,28 +42,12 @@ class CollectionController extends AbstractController $isEditable = $repo->hasCreatorEditor($collection->getCreator()); $collection->setEditableStatus($isEditable); - return $this->render('collection/index.html.twig', [ + return $this->render('collection/view.html.twig', [ 'controller_name' => 'CollectionController', 'record' => $collection, ]); } - #[Route('/collection', name: 'app_collection_landing')] - public function landing(EntityManagerInterface $em): Response - { - $repo = $em->getRepository(Collection::class); - $records = $repo->findBy([], ['modifiedAt' => 'DESC']); - $count = count($records); - - $records = array_slice($records, 0, 15); - - return $this->render('collection/landing.html.twig', [ - 'controller_name' => 'CollectionController', - 'records' => $records, - 'count' => $count, - ]); - } - #[Route('/collection/delete/{id<\d+>}', name: 'app_collection_del')] public function delete(Collection $collection, EntityManagerInterface $em): Response { @@ -66,7 +66,7 @@ class CollectionController extends AbstractController $this->addFlash('notice', 'Record deleted successfully'); - return $this->redirectToRoute('app_collection_landing'); + return $this->redirectToRoute('app_collection'); } /** * @todo Move clone logic to __clone() in Entity or Repository @@ -108,6 +108,6 @@ class CollectionController extends AbstractController $this->addFlash('notice', 'Record copied successfully'); - return $this->redirectToRoute('app_collection', ['id' => $copy->getId()]); + return $this->redirectToRoute('app_collection_view', ['id' => $copy->getId()]); } } diff --git a/src/Controller/CollectorController.php b/src/Controller/CollectorController.php index 1dd677e..a9d8449 100644 --- a/src/Controller/CollectorController.php +++ b/src/Controller/CollectorController.php @@ -15,8 +15,8 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class CollectorController extends AbstractController { - #[Route('/collector/{id<\d+>}', name: 'app_collector')] - public function index(Collector $collector, EntityManagerInterface $em): Response + #[Route('/collector/{id<\d+>}', name: 'app_collector_view')] + public function view(Collector $collector, EntityManagerInterface $em): Response { $repo = $em->getRepository(Bibliography::class); $bibliographies = $repo->findAllByCollector($collector->getId()); @@ -26,14 +26,14 @@ class CollectorController extends AbstractController $isEditable = $repo->hasCreatorEditor($collector->getCreator()); $collector->setEditableStatus($isEditable); - return $this->render('collector/index.html.twig', [ + return $this->render('collector/view.html.twig', [ 'controller_name' => 'CollectorController', 'record' => $collector, ]); } - #[Route('/collector', name: 'app_collector_landing')] - public function landing(EntityManagerInterface $em): Response + #[Route('/collector', name: 'app_collector')] + public function index(EntityManagerInterface $em): Response { $repo = $em->getRepository(Collector::class); $records = $repo->findBy([], ['modifiedAt' => 'DESC']); @@ -41,7 +41,7 @@ class CollectorController extends AbstractController $records = array_slice($records, 0, 15); - return $this->render('collector/landing.html.twig', [ + return $this->render('collector/index.html.twig', [ 'controller_name' => 'CollectorController', 'records' => $records, 'count' => $count, @@ -64,7 +64,7 @@ class CollectorController extends AbstractController $this->addFlash('notice', 'Record deleted successfully'); - return $this->redirectToRoute('app_collector_landing'); + return $this->redirectToRoute('app_collector'); } /** * @todo Move clone logic to __clone() in Entity or Repository @@ -100,6 +100,6 @@ class CollectorController extends AbstractController $this->addFlash('notice', 'Record copied successfully'); - return $this->redirectToRoute('app_collector', ['id' => $copy->getId()]); + return $this->redirectToRoute('app_collector_view', ['id' => $copy->getId()]); } } diff --git a/src/Controller/ConservationPlaceController.php b/src/Controller/ConservationPlaceController.php index 0f077ab..f518404 100644 --- a/src/Controller/ConservationPlaceController.php +++ b/src/Controller/ConservationPlaceController.php @@ -14,8 +14,24 @@ use Symfony\Component\Security\Core\Exception\AccessDeniedException; class ConservationPlaceController extends AbstractController { - #[Route('/conservation_place/{id<\d+>}', name: 'app_conservation_place')] - public function index(ConservationPlace $conservationPlace, EntityManagerInterface $em): Response + #[Route('/conservation_place', name: 'app_conservation_place')] + public function index(EntityManagerInterface $em): Response + { + $repo = $em->getRepository(ConservationPlace::class); + $records = $repo->findBy([], ['id' => 'DESC']); + $count = count($records); + + $records = array_slice($records, 0, 15); + + return $this->render('conservation_place/index.html.twig', [ + 'controller_name' => 'ConservationPlaceController', + 'records' => $records, + 'count' => $count, + ]); + } + + #[Route('/conservation_place/{id<\d+>}', name: 'app_conservation_place_view')] + public function view(ConservationPlace $conservationPlace, EntityManagerInterface $em): Response { $repo = $em->getRepository(ConservationPlace::class); @@ -24,28 +40,12 @@ class ConservationPlaceController extends AbstractController $conservationPlace->setLat((float) $coords['lat']); $conservationPlace->setLng((float) $coords['lng']); - return $this->render('conservation_place/index.html.twig', [ + return $this->render('conservation_place/view.html.twig', [ 'controller_name' => 'ConservationPlaceController', 'record' => $conservationPlace, ]); } - #[Route('/conservation_place', name: 'app_conservation_place_landing')] - public function landing(EntityManagerInterface $em): Response - { - $repo = $em->getRepository(ConservationPlace::class); - $records = $repo->findBy([], ['id' => 'DESC']); - $count = count($records); - - $records = array_slice($records, 0, 15); - - return $this->render('conservation_place/landing.html.twig', [ - 'controller_name' => 'ConservationPlaceController', - 'records' => $records, - 'count' => $count, - ]); - } - #[Route('/conservation_place/delete/{id<\d+>}', name: 'app_conservation_place_del')] public function delete(ConservationPlace $conservationPlace, EntityManagerInterface $em): Response { @@ -64,7 +64,7 @@ class ConservationPlaceController extends AbstractController $this->addFlash('notice', 'Record deleted successfully'); - return $this->redirectToRoute('app_conservation_place_landing'); + return $this->redirectToRoute('app_conservation_place'); } /** * @todo Move clone logic to __clone() in Entity or Repository @@ -106,6 +106,6 @@ class ConservationPlaceController extends AbstractController $this->addFlash('notice', 'Record copied successfully'); - return $this->redirectToRoute('app_conservation_place', ['id' => $copy->getId()]); + return $this->redirectToRoute('app_conservation_place_view', ['id' => $copy->getId()]); } } diff --git a/src/Controller/SiteController.php b/src/Controller/SiteController.php new file mode 100644 index 0000000..091c2e7 --- /dev/null +++ b/src/Controller/SiteController.php @@ -0,0 +1,63 @@ +getRepository(Site::class); + $sites = $repo->findBy([], ['id' => 'DESC']); + $count = count($sites); + $sites = array_slice($sites, 0, 15); + + return $this->render('site/index.html.twig', [ + 'controller_name' => 'SiteController', + 'records' => $sites, + 'count' => $count, + ]); + } + #[Route('/site/{id<\d+>}', name: 'app_site_view')] + public function view(Site $site, EntityManagerInterface $em): Response + { + $repo = $em->getRepository(Site::class); + $coords = $repo->coordinates($site->getId()); + + $site->setLat($coords['lat']); + $site->setLng($coords['lng']); + + return $this->render('site/view.html.twig', [ + 'controller_name' => 'SiteController', + 'record' => $site, + ]); + } + /** + * @todo Implement... + */ + #[Route('/site/copy/{id<\d+>}', name: 'app_site_copy')] + public function copy(Site $site, EntityManagerInterface $em): Response + { + return $this->render('site/index.html.twig', [ + 'controller_name' => 'SiteController', + 'record' => $site, + ]); + } + /** + * @todo Implement... + */ + #[Route('/site/delete/{id<\d+>}', name: 'app_site_del')] + public function delete(Site $site, EntityManagerInterface $em): Response + { + return $this->render('site/index.html.twig', [ + 'controller_name' => 'SiteController', + 'record' => $site, + ]); + } +} diff --git a/src/Entity/Site.php b/src/Entity/Site.php index 854301b..46b22b6 100644 --- a/src/Entity/Site.php +++ b/src/Entity/Site.php @@ -11,7 +11,7 @@ use App\RecordStatus; use Doctrine\Common\Collections\Collection as DoctrineCollection; #[ORM\Entity(repositoryClass: SiteRepository::class)] -#[ORM\Table(name: 'conservation_place')] +#[ORM\Table(name: 'site')] class Site implements RecordInterface { #[ORM\Id] diff --git a/src/Repository/SiteRepository.php b/src/Repository/SiteRepository.php index b39b25a..10960b5 100644 --- a/src/Repository/SiteRepository.php +++ b/src/Repository/SiteRepository.php @@ -82,15 +82,14 @@ class SiteRepository extends ServiceEntityRepository $sql = ' SELECT - ST_X(coord_cons) as lng, - ST_Y(coord_cons) as lat - FROM sito s - WHERE cp.id = :id + ST_X(coord_sito) as lng, + ST_Y(coord_sito) as lat + FROM site s + WHERE s.id = :id '; $result = $conn->executeQuery($sql, ['id' => $id]); - return $result->fetchAssociative(); } } diff --git a/templates/bibliography/index.html.twig b/templates/bibliography/index.html.twig index 039e6d7..381524b 100644 --- a/templates/bibliography/index.html.twig +++ b/templates/bibliography/index.html.twig @@ -1,22 +1,11 @@ {% extends 'data_entry.html.twig' %} -{% block title %}Bibliography - {{ record.citation }} | ArCOA{% endblock %} +{% block title %}Bibliography | ArCOA{% endblock %} {% block rightpanel %}
{{ count }} result(s) found
+ID | +Citation | +Status | +Editor | +Reference | +Last modified | +Actions | +||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ record.id }} | ++ + {{ record.citation }} + + | +{{ record.status }} | +{{ record.owner }} | +{{ record.reference }} | +
+ {{ record.modifiedAt.format('Y-m-d') }} + {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} + |
+
+
-
-
-
-
- Some stuff...
-
-
+ |
+
-
- {% endif %}
-
{{ count }} result(s) found
-ID | -Citation | -Status | -Editor | -Reference | -Last modified | -Actions | -
---|---|---|---|---|---|---|
{{ record.id }} | -- - {{ record.citation }} - - | -{{ record.status }} | -{{ record.owner }} | -{{ record.reference }} | -
- {{ record.modifiedAt.format('Y-m-d') }} - {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} - |
- - | - -
Delete record?
-Record ID | {{ record.id }} |
---|---|
Status | {{ record.getStatus() }} |
Editor(s) | {{ record.editor }} |
Citation | {{ record.citation }} |
Reference | {{ record.reference }} |
Editorial notes | {{ record.notes }} |
Delete record?
+Record ID | {{ record.id }} |
---|---|
Status | {{ record.getStatus() }} |
Editor(s) | {{ record.editor }} |
Collection name | {{ record.title }} |
Chronology | {{ record.chronology }} |
Start date | {{ record.startDate }} |
End date | {{ record.endDate }} |
Description | {{ record.description }} |
Short description | {{ record.shortDescription }} |
External identifier(s) | {{ record.externalIdentifier }} |
External link(s) | {{ record.link }} |
Subject headings | {{ record.subjectHeadings }} |
ArCOA URI | arcoa.cnr.it/collection/{{ record.id }} |
Editorial notes | {{ record.notes }} |
Bibliographies
-ID | Status | Citation | Editor | Reference |
---|---|---|---|---|
{{ biblio.id }} | -{{ biblio.citation }} | -{{ biblio.status }} | -{{ biblio.editor }} | -{{ biblio.reference }} | -
{{ count }} result(s) found
+ID | +Title | +Status | +Editor | +Chronology | +Last modified | +Actions | +
---|---|---|---|---|---|---|
{{ record.id }} | ++ + {{ record.title }} + + | +{{ record.status }} | +{{ record.owner }} | +{{ record.chronology }} | +
+ {{ record.modifiedAt.format('Y-m-d') }} + {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} + |
+ + | + +
{{ count }} result(s) found
-ID | -Title | -Status | -Editor | -Chronology | -Last modified | -Actions | -
---|---|---|---|---|---|---|
{{ record.id }} | -- - {{ record.title }} - - | -{{ record.status }} | -{{ record.owner }} | -{{ record.chronology }} | -
- {{ record.modifiedAt.format('Y-m-d') }} - {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} - |
- - | - -
Delete record?
-Record ID | {{ record.id }} |
---|---|
Status | {{ record.getStatus() }} |
Editor(s) | {{ record.editor }} |
Collection name | {{ record.title }} |
Chronology | {{ record.chronology }} |
Start date | {{ record.startDate }} |
End date | {{ record.endDate }} |
Description | {{ record.description }} |
Short description | {{ record.shortDescription }} |
External identifier(s) | {{ record.externalIdentifier }} |
External link(s) | {{ record.link }} |
Subject headings | {{ record.subjectHeadings }} |
ArCOA URI | arcoa.cnr.it/collection/{{ record.id }} |
Editorial notes | {{ record.notes }} |
Bibliographies
+ID | Status | Citation | Editor | Reference |
---|---|---|---|---|
{{ biblio.id }} | +{{ biblio.citation }} | +{{ biblio.status }} | +{{ biblio.editor }} | +{{ biblio.reference }} | +
Delete record?
+{{ count }} result(s) found
+ID | +Name | +Status | +Editor | +Places / areas of activity | +Last modified | +Actions | +||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ record.id }} | ++ + {{ record.name }} + + | +{{ record.status }} | +{{ record.owner }} | +{{ record.places }} | +
+ {{ record.modifiedAt.format('Y-m-d') }} + {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} + |
+
+
-
-
-
-
- {% if record.bibliographies %}
-
-
+ Bibliographies -
|
+
-
- {% endif %}
-
Delete record?
-Delete record?
+Record ID | {{ record.id }} |
---|---|
Status | {{ record.getStatus() }} |
Editor(s) | {{ record.editor }} |
Name | {{ record.name }} |
Date of birth | {{ record.birthDate }} |
Date of death | {{ record.deathDate }} |
Places / areas of activity | {{ record.places }} |
Description | {{ record.description }} |
Short description | {{ record.shortDescription }} |
External identifier(s) | {{ record.externalIdentifier }} |
External link(s) | {{ record.link }} |
Subject headings | {{ record.subjectHeadings }} |
ArCOA URI | arcoa.cnr.it/collector/{{ record.id }} |
Editorial notes | {{ record.notes }} |
Bibliographies
+ID | Status | Citation | Editor | Reference |
---|---|---|---|---|
{{ biblio.id }} | +{{ biblio.citation }} | +{{ biblio.status }} | +{{ biblio.editor }} | +{{ biblio.reference }} | +
Delete record?
+{{ count }} result(s) found
+ID | +Place | +Status | +Editor | +Municipality | +Last modified | +Actions | +||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ record.id }} | ++ + {{ record.place }} + + | +{{ record.status }} | +{{ record.owner }} | +{{ record.municipality }} | +
+ {{ record.modifiedAt.format('Y-m-d') }} + {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} + |
+
+
-
-
-
-
- Some stuff...
-
-
+ |
+
-
- {% endif %}
-
Interactive map
-{{ count }} result(s) found
-ID | -Place | -Status | -Editor | -Municipality | -Last modified | -Actions | -
---|---|---|---|---|---|---|
{{ record.id }} | -- - {{ record.place }} - - | -{{ record.status }} | -{{ record.owner }} | -{{ record.municipality }} | -
- {{ record.modifiedAt.format('Y-m-d') }} - {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} - |
- - | - -
Delete record?
-Record ID | {{ record.id }} |
---|---|
Status | {{ record.getStatus() }} |
Editor(s) | {{ record.editor }} |
Conservation place | ++ {{ record.place }} + | +
Region | {{ record.region }} |
Province | {{ record.province }} |
Municipality | {{ record.municipality }} |
Coordinates | +
+ {{ record.lat }}, {{ record.lng }}
+ |
+
Description | {{ record.description }} |
Short description | {{ record.shortDescription }} |
External identifier(s) | {{ record.externalIdentifier }} |
External link(s) | {{ record.link }} |
Subject headings | {{ record.subjectHeadings }} |
ArCOA URI | arcoa.cnr.it/conservation_place/{{ record.id }} |
Editorial notes | {{ record.notes }} |
Delete record?
+Interactive map
+ID | -Name | +Modern name | Status | Editor | -Places / areas of activity | +Country | Last modified | Actions | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
{{ record.id }} | +{{ record.id }} | - - {{ record.name }} + + {{ record.name }} | {{ record.status }} | {{ record.owner }} | -{{ record.places }} | +{{ record.country }} |
{{ record.modifiedAt.format('Y-m-d') }} {{ record.editor }} at {{ record.modifiedAt.format('H:i:s') }} @@ -72,7 +72,7 @@ -
+
+
+
+
+
+{% endblock %}
\ No newline at end of file
Site+{{ record.name }}+ + {% for message in app.flashes('notice') %} +
+
+ {% endfor %}
+
+
+
+
+ {% if app.user and not is_granted('ROLE_READER') %}
+
+
+
+
+ {% endif %}
+
+ {% if is_granted('ROLE_REVISOR') or
+ is_granted('ROLE_ADMIN') or
+ record.editableStatus %}
+
+
+
+
+
+
+ Some stuff...
+
+
+
+
+
+
+ Delete record? +
+
+
+
+
+ Interactive map + |