Skip to content

Commit

Permalink
Merge branch 'develop' into feature/reprise-donnees-effectifs-degagem…
Browse files Browse the repository at this point in the history
…ents
  • Loading branch information
A709197 committed Nov 14, 2024
2 parents 7673e9a + 4bd2a10 commit ae0ba54
Show file tree
Hide file tree
Showing 7 changed files with 78 additions and 64 deletions.
25 changes: 16 additions & 9 deletions application/controllers/DossierController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion application/controllers/EtablissementController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
89 changes: 45 additions & 44 deletions application/views/scripts/dossier/formrecupprescription.phtml
Original file line number Diff line number Diff line change
@@ -1,50 +1,51 @@
<?php
if($this->nbEtab != 1){
echo "Pour pouvoir utiliser cette fonctionnalité, le dossier ne doit concerner qu'un seul établissement";
}else{
?>
<?php if($this->nbEtab != 1): ?>
Pour pouvoir utiliser cette fonctionnalité, le dossier ne doit concerner qu'un seul établissement
<?php else: ?>
<form name='selectionDossier' id='selectionDossier' >
<input type='hidden' name='idDossier' id='idDossier' value='<?php echo $this->idDossier; ?>' />
<?php
echo "Selectionnez le dossier pour lequel vous souhaitez reprendre les prescriptions";
<input type='hidden' name='idDossier' id='idDossier' value='<?php echo $this->idDossier; ?>' />

if(count($this->visites) == 0 && count($this->etudes) == 0 && count($this->autres) == 0) : ?>
<div class='well well-large text-center'>
<p class='lead'>Il n'y a pas de dossier.</p>
<p><a href='<?php echo $this->url(array('controller' => 'dossier', 'action' => 'add', 'id_etablissement' => $this->etablissement['general']['ID_ETABLISSEMENT']), null, true) ?>' class='btn btn-large'>Ajouter un dossier</a></p>
</div>
<?php else : ?>
Sélectionnez le dossier pour lequel vous souhaitez reprendre les prescriptions.
<br />
<small class='muted'>Plusieurs sélections sont possibles</small>

<div id="content_visites_ets">
<?php if( count($this->visites) > 0 ) : ?>
<h4>Visites</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->visites); ?>
</ul>
<?php endif ?>
</div>
<?php if(count($this->visites) == 0 && count($this->etudes) == 0 && count($this->autres) == 0) : ?>
<div class='well well-large text-center'>
<p class='lead'>Il n'y a pas de dossier.</p>
<p>
<a href='<?php echo $this->url(array('controller' => 'dossier', 'action' => 'add', 'id_etablissement' => $this->etablissement['general']['ID_ETABLISSEMENT']), null, true) ?>' class='btn btn-large'>Ajouter un dossier</a>
</p>
</div>
<?php else : ?>
<div id="content_visites_ets">
<?php if( count($this->visites) > 0 ) : ?>
<h4>Visites</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->visites); ?>
</ul>
<?php endif ?>
</div>

<div id="content_etudes_ets">
<?php if( count($this->etudes) > 0 ) : ?>
<?php if( count($this->visites) > 0 ) echo "<hr />"; ?>
<h4>Études</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->etudes); ?>
</ul>
<?php endif ?>
</div>
<div id="content_etudes_ets">
<?php if( count($this->etudes) > 0 ) : ?>
<?php if( count($this->visites) > 0 ) echo "<hr />"; ?>

<div id="content_autres_ets">
<?php if( count($this->autres) > 0 ) : ?>
<?php if( count($this->visites) > 0 || count($this->etudes) > 0) echo "<hr />"; ?>
<h4>Autres</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->autres); ?>
</ul>
<?php endif ?>
</div>
<?php endif ?>
<h4>Études</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->etudes); ?>
</ul>
<?php endif ?>
</div>

<div id="content_autres_ets">
<?php if( count($this->autres) > 0 ) : ?>
<?php if( count($this->visites) > 0 || count($this->etudes) > 0) echo "<hr />"; ?>

<h4>Autres</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->autres); ?>
</ul>
<?php endif ?>
</div>
<?php endif ?>
</form>
<?php
}
?>
<?php endif ?>
2 changes: 1 addition & 1 deletion application/views/scripts/dossier/prescription.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 7 additions & 7 deletions application/views/scripts/dossier/results/dossier.phtml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<li <?php if($this->NB_DOSS_LIES > 0) echo "class='slide'" ?> id="<?php echo $this->ID_DOSSIER ?>">
<li <?php if($this->NB_DOSS_LIES > 0) echo "class='slide'" ?> id="<?= $this->ID_DOSSIER ?>">
<!-- Icone représentant le dropdown des fils -->
<?php if($this->NB_DOSS_LIES > 0) : ?>
<span class="icone_enfants" ><em class='ui-icon ui-icon-triangle-1-e' style='position: relative; left: -25px; float: left; margin-right: -25px;' ></em></span>
<span class="icone_enfants" ><em class='ui-icon ui-icon-triangle-1-e' style='position: relative; left: -25px; float: left; margin-right: -25px;' ></em></span>
<?php endif ?>

<!-- Nom du dossier -->
<span class="doss-nom">
<input type='radio' name='dossierSelect' value='<?php echo $this->ID_DOSSIER ?>' />
<a href='/dossier/index/id/<?php echo $this->ID_DOSSIER ?>' title='<?php echo htmlspecialchars($this->LIBELLE_DOSSIERTYPE . " - " . $this->LIBELLE_DOSSIERNATURE . (!empty($this->OBJET_DOSSIER) ? " - " . $this->OBJET_DOSSIER : ""), ENT_QUOTES) ?>'>
<?php echo $this->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 : '') ?>
<input type='checkbox' name='dossierSelect-<?= $this->ID_DOSSIER ?>' value='<?= $this->ID_DOSSIER ?>' />
<a href='/dossier/index/id/<?= $this->ID_DOSSIER ?>' title='<?= htmlspecialchars($this->LIBELLE_DOSSIERTYPE . " - " . $this->LIBELLE_DOSSIERNATURE . (!empty($this->OBJET_DOSSIER) ? " - " . $this->OBJET_DOSSIER : ""), ENT_QUOTES) ?>'>
<?= $this->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 : '') ?>
</a>
</span>

Expand Down Expand Up @@ -56,9 +56,9 @@
<?php elseif($this->DIFFEREAVIS_DOSSIER == 1) : ?>
<span class='avis' style='background-color: #3a87ad;'>Avis différé</span>
<?php elseif($this->AVIS_DOSSIER == 1) : ?>
<span class="avis F">Favorable <?php echo in_array($this->ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?></span>
<span class="avis F">Favorable <?= in_array($this->ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?></span>
<?php elseif($this->AVIS_DOSSIER == 2) : ?>
<span class="avis D">Défavorable <?php echo in_array($this->ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?></span>
<span class="avis D">Défavorable <?= in_array($this->ID_DOSSIERNATURE, array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?></span>
<?php else : ?>
<span class="avis">Avis indisponible</span>
<?php endif ?>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,8 @@
"array" => $this->historiqueAvisDerogations
));
?>

<?php if (null !== $this->derogationsOriginales && '' !== $this->derogationsOriginales): ?>
<h4>Dérogations originales</h4>
<?= nl2br($this->derogationsOriginales) ?>
<?php endif ?>
4 changes: 2 additions & 2 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -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

-
Expand Down Expand Up @@ -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

-
Expand Down

0 comments on commit ae0ba54

Please sign in to comment.