Update views + biblio-doc rel
This commit is contained in:
parent
17270bcd00
commit
8ba8dca0fa
@ -35,10 +35,8 @@ class DocumentController extends AbstractController
|
||||
public function view(document $document, EntityManagerInterface $em): Response
|
||||
{
|
||||
$repo = $em->getRepository(Bibliography::class);
|
||||
/*
|
||||
$bibliographies = $repo->findAllByDocument($document->getId());
|
||||
$document->setBibliographies($bibliographies);
|
||||
*/
|
||||
|
||||
$repo = $em->getRepository(document::class);
|
||||
$isEditable = $repo->hasCreatorEditor($document->getCreator());
|
||||
|
@ -29,18 +29,6 @@ class BibliographyRepository extends ServiceEntityRepository
|
||||
return in_array('ROLE_EDITOR', $creator->getRoles());
|
||||
}
|
||||
|
||||
/*
|
||||
public function delete(int $id): void
|
||||
{
|
||||
$qb = $this->createQueryBuilder('b')
|
||||
->delete(Bibliography::class, 'bib')
|
||||
->where('bib.id = :id')
|
||||
->setParameter('id', $id);
|
||||
|
||||
$qb->getQuery()->execute();
|
||||
}
|
||||
*/
|
||||
|
||||
public function findAllByCollection(int $collectionId): ?ArrayCollection
|
||||
{
|
||||
$rsm = new ResultSetMappingBuilder($this->getEntityManager());
|
||||
@ -84,4 +72,29 @@ class BibliographyRepository extends ServiceEntityRepository
|
||||
|
||||
return $bibliographies;
|
||||
}
|
||||
|
||||
public function findAllByDocument(int $documentId): ?ArrayCollection
|
||||
{
|
||||
$rsm = new ResultSetMappingBuilder($this->getEntityManager());
|
||||
$rsm->addRootEntityFromClassMetadata('App\Entity\Bibliography', 'b');
|
||||
|
||||
$query = $this->getEntityManager()->createNativeQuery(
|
||||
"SELECT
|
||||
id,
|
||||
stato,
|
||||
editor,
|
||||
cit_bib,
|
||||
rif_bib
|
||||
FROM bibliography b
|
||||
JOIN rel_riferimento_documento
|
||||
ON Bibliografia_id_bib = id
|
||||
WHERE Documento_id_doc = :docId",
|
||||
$rsm
|
||||
);
|
||||
$query->setParameter('docId', $documentId);
|
||||
|
||||
$bibliographies = new ArrayCollection($query->getResult());
|
||||
|
||||
return $bibliographies;
|
||||
}
|
||||
}
|
||||
|
@ -92,6 +92,15 @@
|
||||
Some stuff...
|
||||
</div>
|
||||
</div>
|
||||
<p class="pb-3 pt-3">
|
||||
<a class="button is-link is-outlined"
|
||||
href="{{ path('app_bibliography') }}">
|
||||
Back to index
|
||||
<span class="icon ml-2">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
<div class="modal" data-delete-record-target="modal">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
|
@ -107,6 +107,15 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<p class="pb-3 pt-3">
|
||||
<a class="button is-link is-outlined"
|
||||
href="{{ path('app_collection') }}">
|
||||
Back to index
|
||||
<span class="icon ml-2">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
<div class="modal" data-delete-record-target="modal">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
|
@ -107,6 +107,15 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<p class="pb-3 pt-3">
|
||||
<a class="button is-link is-outlined"
|
||||
href="{{ path('app_collector') }}">
|
||||
Back to index
|
||||
<span class="icon ml-2">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
<div class="modal" data-delete-record-target="modal">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
|
@ -115,6 +115,15 @@
|
||||
Some stuff...
|
||||
</div>
|
||||
</div>
|
||||
<p class="pb-3 pt-3">
|
||||
<a class="button is-link is-outlined"
|
||||
href="{{ path('app_conservation_place') }}">
|
||||
Back to index
|
||||
<span class="icon ml-2">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
<div class="modal" data-delete-record-target="modal">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
|
@ -110,6 +110,15 @@
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<p class="pb-3 pt-3">
|
||||
<a class="button is-link is-outlined"
|
||||
href="{{ path('app_document') }}">
|
||||
Back to index
|
||||
<span class="icon ml-2">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
<div class="modal" data-delete-record-target="modal">
|
||||
<div class="modal-background"></div>
|
||||
<div class="modal-card">
|
||||
|
@ -134,6 +134,15 @@
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
<p class="pb-3 pt-3">
|
||||
<a class="button is-link is-outlined"
|
||||
href="{{ path('app_site') }}">
|
||||
Back to index
|
||||
<span class="icon ml-2">
|
||||
<i class="fa fa-arrow-left"></i>
|
||||
</span>
|
||||
</a>
|
||||
</p>
|
||||
<div class="modal" data-map-target="modal">
|
||||
<div class="modal-background" data-action="click->map#close"></div>
|
||||
<div class="modal-card" style="min-width: 900px;">
|
||||
|
Loading…
Reference in New Issue
Block a user