diff --git a/application/controllers/DossierController.php b/application/controllers/DossierController.php index 64e1ed9c9..099af95a3 100755 --- a/application/controllers/DossierController.php +++ b/application/controllers/DossierController.php @@ -3056,21 +3056,28 @@ public function formrecupprescriptionAction(): void public function recupprescriptionAction(): void { $this->_helper->viewRenderer->setNoRender(); - // On reprend les prescriptions du dossier ayant id : dossierSelect pui on les ajoute au dossier ayant id : idDossier + $service_dossier = new Service_Dossier(); - $idDossierInitial = (int) $this->_getParam('dossierSelect'); $idDossier = (int) $this->_getParam('idDossier'); + $dossiersSelect = []; + $post = $this->getRequest()->getPost(); - $service_dossier = new Service_Dossier(); + foreach ($post as $key => $value) { + if (0 === strpos($key, 'dossierSelect-')) { + $dossiersSelect[] = $value; + } + } - $prescriptionRappelsReglementaire = $service_dossier->getPrescriptions($idDossierInitial, 0); - $service_dossier->copyPrescriptionDossier($prescriptionRappelsReglementaire, $idDossier, $idDossierInitial); + foreach ($dossiersSelect as $idDossierInitial) { + $prescriptionRappelsReglementaire = $service_dossier->getPrescriptions($idDossierInitial, 0); + $service_dossier->copyPrescriptionDossier($prescriptionRappelsReglementaire, $idDossier, $idDossierInitial); - $prescriptionExploitation = $service_dossier->getPrescriptions($idDossierInitial, 1); - $service_dossier->copyPrescriptionDossier($prescriptionExploitation, $idDossier, $idDossierInitial); + $prescriptionExploitation = $service_dossier->getPrescriptions($idDossierInitial, 1); + $service_dossier->copyPrescriptionDossier($prescriptionExploitation, $idDossier, $idDossierInitial); - $prescriptionAmelioration = $service_dossier->getPrescriptions($idDossierInitial, 2); - $service_dossier->copyPrescriptionDossier($prescriptionAmelioration, $idDossier, $idDossierInitial); + $prescriptionAmelioration = $service_dossier->getPrescriptions($idDossierInitial, 2); + $service_dossier->copyPrescriptionDossier($prescriptionAmelioration, $idDossier, $idDossierInitial); + } } public function formrecupeffectifsdegagementsAction(): void diff --git a/application/controllers/EtablissementController.php b/application/controllers/EtablissementController.php index 3818fd1f6..a3b7bd596 100755 --- a/application/controllers/EtablissementController.php +++ b/application/controllers/EtablissementController.php @@ -657,7 +657,8 @@ public function effectifsDegagementsEtablissementEditAction(): void public function avisDerogationsEtablissementAction(): void { $this->_helper->layout->setLayout('etablissement'); - $this->view->assign('historiqueAvisDerogations', $this->serviceEtablissement->getHistorique($this->_request->id)['AVIS_DEROGATIONS'] ?? []); + $this->view->assign('historiqueAvisDerogations', $this->serviceEtablissement->getHistorique($this->getRequest()->getParam('id'))['AVIS_DEROGATIONS'] ?? []); + $this->view->assign('derogationsOriginales', $this->serviceEtablissement->getDescriptifs($this->getRequest()->getParam('id'))['derogations']); } public function retablirEtablissementAction(): void diff --git a/application/views/scripts/dossier/formrecupprescription.phtml b/application/views/scripts/dossier/formrecupprescription.phtml index 23b83e830..a5174845d 100755 --- a/application/views/scripts/dossier/formrecupprescription.phtml +++ b/application/views/scripts/dossier/formrecupprescription.phtml @@ -1,50 +1,51 @@ -nbEtab != 1){ - echo "Pour pouvoir utiliser cette fonctionnalité, le dossier ne doit concerner qu'un seul établissement"; -}else{ -?> +nbEtab != 1): ?> + Pour pouvoir utiliser cette fonctionnalité, le dossier ne doit concerner qu'un seul établissement +
- \ No newline at end of file + diff --git a/application/views/scripts/dossier/prescription.phtml b/application/views/scripts/dossier/prescription.phtml index 5d1c78427..8e453e17d 100755 --- a/application/views/scripts/dossier/prescription.phtml +++ b/application/views/scripts/dossier/prescription.phtml @@ -423,7 +423,7 @@ $(document).ready(function(){ text: 'Reprendre les prescriptions', class: 'btn btn-success', click: function() { - if ($('input[type=radio][name=dossierSelect]:checked').length == 1) { + if ($('input[type=checkbox][name^=dossierSelect-]:checked').length > 0) { $.ajax({ type: "POST", url: "/dossier/recupprescription", diff --git a/application/views/scripts/dossier/results/dossier.phtml b/application/views/scripts/dossier/results/dossier.phtml index 999b34ed2..2f115970c 100755 --- a/application/views/scripts/dossier/results/dossier.phtml +++ b/application/views/scripts/dossier/results/dossier.phtml @@ -1,14 +1,14 @@ -