Skip to content

Commit

Permalink
MaJ avec la reprise multiple des prescriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
A709197 committed Nov 14, 2024
1 parent ae0ba54 commit 662c324
Show file tree
Hide file tree
Showing 4 changed files with 108 additions and 79 deletions.
12 changes: 8 additions & 4 deletions application/controllers/DossierController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3036,12 +3036,14 @@ public function prescriptionchangeposAction(): void

public function formrecupprescriptionAction(): void
{
$idDossier = (int) $this->getRequest()->getParam('idDossier');

// récupération de l'établissement attaché au dossier
$dbEtabDossier = new Model_DbTable_EtablissementDossier();
$listeEtab = $dbEtabDossier->getEtablissementListe($this->_getParam('idDossier'));
$listeEtab = $dbEtabDossier->getEtablissementListe($idDossier);

$this->view->assign('nbEtab', count($listeEtab));
$this->view->assign('idDossier', $this->_getParam('idDossier'));
$this->view->assign('idDossier', $idDossier);

if (1 == $this->view->nbEtab) {
// si il n'y a qu'un établissement, on affiche la liste des dossiers qu'il contient
Expand Down Expand Up @@ -3082,12 +3084,14 @@ public function recupprescriptionAction(): void

public function formrecupeffectifsdegagementsAction(): void
{
$idDossier = (int) $this->getRequest()->getParam('idDossier');

// récupération de l'établissement attaché au dossier
$dbEtabDossier = new Model_DbTable_EtablissementDossier();
$listeEtab = $dbEtabDossier->getEtablissementListe($this->_getParam('idDossier'));
$listeEtab = $dbEtabDossier->getEtablissementListe($idDossier);

$this->view->assign('nbEtab', count($listeEtab));
$this->view->assign('idDossier', $this->_getParam('idDossier'));
$this->view->assign('idDossier', $idDossier);

if (1 == $this->view->nbEtab) {
// si il n'y a qu'un établissement, on affiche la liste des dossiers qu'il contient
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,11 @@
<?php if (count($this->etudes) > 0): ?>
<h4>Études</h4>
<ul class='recherche_liste'>
<?= $this->partialLoop('dossier/results/dossier.phtml', $this->etudes) ?>
<?= $this->partial('dossier/results/dossier.phtml', [
'dossiers' => $this->etudes,
'type' => 'single',
'idDossierCourant' => $this->idDossier,
]) ?>
</ul>
<?php endif ?>
</div>
Expand Down
18 changes: 15 additions & 3 deletions application/views/scripts/dossier/formrecupprescription.phtml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@
<?php if( count($this->visites) > 0 ) : ?>
<h4>Visites</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->visites); ?>
<?= $this->partial('dossier/results/dossier.phtml', [
'dossiers' => $this->visites,
'type' => 'multiple',
'idDossierCourant' => $this->idDossier,
]) ?>
</ul>
<?php endif ?>
</div>
Expand All @@ -31,7 +35,11 @@

<h4>Études</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->etudes); ?>
<?= $this->partial('dossier/results/dossier.phtml', [
'dossiers' => $this->etudes,
'type' => 'multiple',
'idDossierCourant' => $this->idDossier,
]) ?>
</ul>
<?php endif ?>
</div>
Expand All @@ -42,7 +50,11 @@

<h4>Autres</h4>
<ul class='recherche_liste'>
<?php echo $this->partialLoop('dossier/results/dossier.phtml', $this->autres); ?>
<?= $this->partial('dossier/results/dossier.phtml', [
'dossiers' => $this->autres,
'type' => 'multiple',
'idDossierCourant' => $this->idDossier,
]) ?>
</ul>
<?php endif ?>
</div>
Expand Down
151 changes: 80 additions & 71 deletions application/views/scripts/dossier/results/dossier.phtml
Original file line number Diff line number Diff line change
@@ -1,78 +1,87 @@
<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>
<?php endif ?>
<?php foreach ($this->dossiers as $dossier): ?>
<?php if ($dossier['ID_DOSSIER'] !== $this->idDossierCourant): ?>
<li <?php if($dossier['NB_DOSS_LIES'] > 0) echo "class='slide'" ?> id="<?= $dossier['ID_DOSSIER'] ?>">
<!-- Icone représentant le dropdown des fils -->
<?php if($dossier['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>
<?php endif ?>

<!-- Nom du dossier -->
<span class="doss-nom">
<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>
<!-- Nom du dossier -->
<span class="doss-nom">
<?php if ($this->type === 'single'): ?>
<input type='radio' name='dossierSelect' value='<?= $dossier['ID_DOSSIER'] ?>' />
<?php elseif ($this->type === 'multiple'): ?>
<input type='checkbox' name='dossierSelect-<?= $dossier['ID_DOSSIER'] ?>' value='<?= $dossier['ID_DOSSIER'] ?>' />
<?php endif ?>

<!-- Date du dossier -->
<?php
if($this->DATEVISITE_DOSSIER != null) {
$date = substr($this->DATEVISITE_DOSSIER, 0, 10);
if($date != '0000-00-00'){
$date = new DateTime(substr($this->DATEVISITE_DOSSIER,0,10));
$date = date_format($date, 'd/m/Y');
}else{
$date = "00/00/0000";
}
$date_text = "ayant pour date de visite le";
} elseif($this->DATECOMM_DOSSIER != null) {
$date = substr($this->DATECOMM_DOSSIER, 0, 10);
if($date != '0000-00-00'){
$date = new DateTime(substr($this->DATECOMM_DOSSIER,0,10));
$date = date_format($date, 'd/m/Y');
}else{
$date = "00/00/0000";
}
$date_text = "ayant pour date de passage en commission le";
} else {
$date = substr($this->DATEINSERT_DOSSIER, 0, 10);
if($date != '0000-00-00'){
$date = new DateTime(substr($this->DATEINSERT_DOSSIER,0,10));
$date = date_format($date, 'd/m/Y');
}else{
$date = "00/00/0000";
}
$date_text = "créé le";
}
echo "<small class='muted'>" . $date_text . " " . $date . "</small>";
?>
<a href='/dossier/index/id/<?= $dossier['ID_DOSSIER'] ?>' title='<?= htmlspecialchars($dossier['LIBELLE_DOSSIERTYPE'] . " - " . $dossier['LIBELLE_DOSSIERNATURE'] . (!empty($dossier['OBJET_DOSSIER']) ? " - " . $dossier['OBJET_DOSSIER'] : ""), ENT_QUOTES) ?>'>
<?= $dossier['LIBELLE_DOSSIERTYPE'] . " - " . $dossier['LIBELLE_DOSSIERNATURE'] . (!empty($dossier['OBJET_DOSSIER']) ? " - " . substr($dossier['OBJET_DOSSIER'], 0, 70) . ( strlen($dossier['OBJET_DOSSIER']) > 70 ? "(...)" : "" ) : "") . ( $dossier['NB_URBA'] != '' ? " - " . $dossier['NB_URBA'] : '') ?>
</a>
</span>

<!-- Icone de chargement des enfants (si il y'en a, et si on est en mode niveau -->
<?php if($this->NB_DOSS_LIES > 0) : ?>
<span class='load ui-helper-hidden' ><img src='/images/load.gif' alt='Chargement ...' /></span>
<?php endif ?>
<!-- Date du dossier -->
<?php
if($dossier['DATEVISITE_DOSSIER'] != null) {
$date = substr($dossier['DATEVISITE_DOSSIER'], 0, 10);
if($date != '0000-00-00'){
$date = new DateTime(substr($dossier['DATEVISITE_DOSSIER'],0,10));
$date = date_format($date, 'd/m/Y');
}else{
$date = "00/00/0000";
}
$date_text = "ayant pour date de visite le";
} elseif($dossier['DATECOMM_DOSSIER'] != null) {
$date = substr($dossier['DATECOMM_DOSSIER'], 0, 10);
if($date != '0000-00-00'){
$date = new DateTime(substr($dossier['DATECOMM_DOSSIER'],0,10));
$date = date_format($date, 'd/m/Y');
}else{
$date = "00/00/0000";
}
$date_text = "ayant pour date de passage en commission le";
} else {
$date = substr($dossier['DATEINSERT_DOSSIER'], 0, 10);
if($date != '0000-00-00'){
$date = new DateTime(substr($dossier['DATEINSERT_DOSSIER'],0,10));
$date = date_format($date, 'd/m/Y');
}else{
$date = "00/00/0000";
}
$date_text = "créé le";
}
echo "<small class='muted'>" . $date_text . " " . $date . "</small>";
?>

<!-- Avis du dossier -->
<?php if($this->INCOMPLET_DOSSIER == 1) : ?>
<span class='avis' style='background-color: #f89406;'>Dossier incomplet</span>
<?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 <?= 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 <?= 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 ?>
<!-- Icone de chargement des enfants (si il y'en a, et si on est en mode niveau -->
<?php if($dossier['NB_DOSS_LIES'] > 0) : ?>
<span class='load ui-helper-hidden' ><img src='/images/load.gif' alt='Chargement ...' /></span>
<?php endif ?>

<!-- Alerte sur la reception de travaux -->
<?php if($this->ALERTE_RECEPTION_TRAVAUX > 0) : ?>
<span class='avis' style='background-color: #3a87ad'>Présence d'un dossier de reception de travaux</span>
<?php endif ?>
<!-- Avis du dossier -->
<?php if($dossier['INCOMPLET_DOSSIER'] == 1) : ?>
<span class='avis' style='background-color: #f89406;'>Dossier incomplet</span>
<?php elseif($dossier['DIFFEREAVIS_DOSSIER'] == 1) : ?>
<span class='avis' style='background-color: #3a87ad;'>Avis différé</span>
<?php elseif($dossier['AVIS_DOSSIER'] == 1) : ?>
<span class="avis F">Favorable <?= in_array($dossier['ID_DOSSIERNATURE'], array(19, 21, 23, 24, 47, 26, 28 ,29, 48)) ? ' à l\'exploitation' : '' ?></span>
<?php elseif($dossier['AVIS_DOSSIER'] == 2) : ?>
<span class="avis D">Défavorable <?= in_array($dossier['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 ?>

<!-- Alerte sur le fait que la visite fait partie d'un échéancier de travaux -->
<?php if($this->ECHEANCIER_TRAVAUX > 0) : ?>
<span class='avis' style='background-color: #3a87ad'>Fait l'objet d'un échéancier de travaux</span>
<?php endif ?>
<!-- Alerte sur la reception de travaux -->
<?php if($dossier['ALERTE_RECEPTION_TRAVAUX'] > 0) : ?>
<span class='avis' style='background-color: #3a87ad'>Présence d'un dossier de reception de travaux</span>
<?php endif ?>

<!-- Alerte sur le fait que la visite fait partie d'un échéancier de travaux -->
<?php if($dossier['ECHEANCIER_TRAVAUX'] > 0) : ?>
<span class='avis' style='background-color: #3a87ad'>Fait l'objet d'un échéancier de travaux</span>
<?php endif ?>

<?php if($this->ID_PLATAU !== null) : echo "<span class='label label-info'>CONSULTATION PLATAU : " . $this->ID_PLATAU . "</span>"; endif ?>
<?php if($this->ID_PLATAU !== null && $this->INCOMPLET_DOSSIER === null) : echo "<span class='label label-info'>EN ATTENTE DE PEC</span>"; endif ?>
</li>
<?php if($dossier['ID_PLATAU'] !== null) : echo "<span class='label label-info'>CONSULTATION PLATAU : " . $dossier['ID_PLATAU'] . "</span>"; endif ?>
<?php if($dossier['ID_PLATAU'] !== null && $dossier['INCOMPLET_DOSSIER'] === null) : echo "<span class='label label-info'>EN ATTENTE DE PEC</span>"; endif ?>
</li>
<?php endif ?>
<?php endforeach ?>

0 comments on commit 662c324

Please sign in to comment.