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 +
- - idDossier; ?>' /> - if(count($this->visites) == 0 && count($this->etudes) == 0 && count($this->autres) == 0) : ?> -
-

Il n'y a pas de dossier.

-

'dossier', 'action' => 'add', 'id_etablissement' => $this->etablissement['general']['ID_ETABLISSEMENT']), null, true) ?>' class='btn btn-large'>Ajouter un dossier

-
- + Sélectionnez le dossier pour lequel vous souhaitez reprendre les prescriptions. +
+ Plusieurs sélections sont possibles -
- visites) > 0 ) : ?> -

Visites

- - -
+ visites) == 0 && count($this->etudes) == 0 && count($this->autres) == 0) : ?> +
+

Il n'y a pas de dossier.

+

+ 'dossier', 'action' => 'add', 'id_etablissement' => $this->etablissement['general']['ID_ETABLISSEMENT']), null, true) ?>' class='btn btn-large'>Ajouter un dossier +

+
+ +
+ visites) > 0 ) : ?> +

Visites

+ + +
-
- etudes) > 0 ) : ?> - visites) > 0 ) echo "
"; ?> -

Études

- - -
+
+ etudes) > 0 ) : ?> + visites) > 0 ) echo "
"; ?> -
- autres) > 0 ) : ?> - visites) > 0 || count($this->etudes) > 0) echo "
"; ?> -

Autres

-
    - partialLoop('dossier/results/dossier.phtml', $this->autres); ?> -
- -
- +

Études

+ + +
+ +
+ autres) > 0 ) : ?> + visites) > 0 || count($this->etudes) > 0) echo "
"; ?> + +

Autres

+ + +
+
- \ 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 @@ -
  • NB_DOSS_LIES > 0) echo "class='slide'" ?> id="ID_DOSSIER ?>"> +
  • NB_DOSS_LIES > 0) echo "class='slide'" ?> id="ID_DOSSIER ?>"> NB_DOSS_LIES > 0) : ?> - + - - - LIBELLE_DOSSIERTYPE . " - " . $this->LIBELLE_DOSSIERNATURE . (!empty($this->OBJET_DOSSIER) ? " - " . substr($this->OBJET_DOSSIER, 0, 70) . ( strlen($this->OBJET_DOSSIER) > 70 ? "(...)" : "" ) : "") . ( $this->NB_URBA != '' ? " - " . $this->NB_URBA : '') ?> + + + LIBELLE_DOSSIERTYPE . " - " . $this->LIBELLE_DOSSIERNATURE . (!empty($this->OBJET_DOSSIER) ? " - " . substr($this->OBJET_DOSSIER, 0, 70) . ( strlen($this->OBJET_DOSSIER) > 70 ? "(...)" : "" ) : "") . ( $this->NB_URBA != '' ? " - " . $this->NB_URBA : '') ?> @@ -56,9 +56,9 @@ DIFFEREAVIS_DOSSIER == 1) : ?> Avis différé AVIS_DOSSIER == 1) : ?> - Favorable ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?> + Favorable ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?> AVIS_DOSSIER == 2) : ?> - Défavorable ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?> + Défavorable ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?> Avis indisponible diff --git a/application/views/scripts/etablissement/avis-derogations-etablissement.phtml b/application/views/scripts/etablissement/avis-derogations-etablissement.phtml index bd58de9be..92fda53f4 100644 --- a/application/views/scripts/etablissement/avis-derogations-etablissement.phtml +++ b/application/views/scripts/etablissement/avis-derogations-etablissement.phtml @@ -4,3 +4,8 @@ "array" => $this->historiqueAvisDerogations )); ?> + +derogationsOriginales && '' !== $this->derogationsOriginales): ?> +

    Dérogations originales

    + derogationsOriginales) ?> + diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index f627b528d..285973bce 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -607,7 +607,7 @@ parameters: - message: "#^Call to an undefined method Zend_Controller_Request_Abstract\\:\\:getPost\\(\\)\\.$#" - count: 5 + count: 6 path: application/controllers/DossierController.php - @@ -672,7 +672,7 @@ parameters: - message: "#^Access to an undefined property Zend_Controller_Request_Abstract\\:\\:\\$id\\.$#" - count: 33 + count: 32 path: application/controllers/EtablissementController.php -