From 4a9f49d8674dc0a14a09d6314ceb680db1fb8352 Mon Sep 17 00:00:00 2001 From: Maxime MERRIEN <48253852+A709197@users.noreply.github.com> Date: Tue, 12 Nov 2024 08:50:09 +0100 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20affichage=20des=20d=C3=A9rogations?= =?UTF-8?q?=20originales=20dans=20l'onglet=20pr=C3=A9vu=20(#185)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- application/controllers/EtablissementController.php | 3 ++- .../etablissement/avis-derogations-etablissement.phtml | 5 +++++ phpstan-baseline.neon | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) 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/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 a9d9741f9..da9ff22ef 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -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 - From 4bd2a10bb416ece7d8958de457b0a4773f966641 Mon Sep 17 00:00:00 2001 From: Maxime MERRIEN <48253852+A709197@users.noreply.github.com> Date: Thu, 14 Nov 2024 14:37:15 +0100 Subject: [PATCH 2/2] feat(prescriptions): reprise de plusieurs dossiers (#186) --- application/controllers/DossierController.php | 25 ++++-- .../dossier/formrecupprescription.phtml | 89 ++++++++++--------- .../views/scripts/dossier/prescription.phtml | 2 +- .../scripts/dossier/results/dossier.phtml | 14 +-- phpstan-baseline.neon | 2 +- 5 files changed, 70 insertions(+), 62 deletions(-) diff --git a/application/controllers/DossierController.php b/application/controllers/DossierController.php index 03df125b4..2cc2e4486 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 lienmultipleAction(): 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 b5e673bf2..85bf4e25e 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/phpstan-baseline.neon b/phpstan-baseline.neon index da9ff22ef..a64688c70 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 -