Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
da1c3a6
Création de la table des statuts
devottered Jan 23, 2023
23b96d3
Suppression d'un fichier non utilisé
devottered Jan 23, 2023
4b63a9e
Ajout des cases à cocher
devottered Jan 25, 2023
0d55f73
Mise à jour des statuts "pas envoyé" => "en attente d'envoi"
devottered Jan 30, 2023
2571be5
Simplifie le passage des données
devottered Jan 30, 2023
81bda3d
Ajout d'un statut d'erreur
devottered Jan 30, 2023
46afe12
Interdit la suppression d'une pj en attente d'envoi ou envoyée
devottered Feb 6, 2023
3b01b47
Permet de renvoyer une pj dont l'envoi était en erreur
devottered Feb 6, 2023
6cac5ce
Libellés plus descriptifs
devottered Feb 7, 2023
86031d6
N'affiche pas l'envoi des pjs vers Plat'AU sur des dossiers uniquemen…
devottered Feb 7, 2023
b9f7880
Correction des types
devottered Feb 7, 2023
40fb68a
Correction sur certains appels de méthode
devottered Feb 7, 2023
f4d79cb
Correction de l'affichage lors de l'ajout d'une pj
devottered Feb 7, 2023
6db3936
Affichage des PJs pouvant être envoyées vers Plat'AU à la sauvegarde …
devottered Feb 14, 2023
db8f770
Changement du statut des PJs lors de la sauvegarde du dossier
devottered Feb 14, 2023
ffcda40
Changement de statut possible que sur des Etudes
devottered Feb 14, 2023
309d24f
Renommage du fichier
devottered Feb 20, 2023
a62bcce
syntaxe composer 2
devottered Mar 15, 2023
c0e0a6b
Ajout de statuts pour la pec et l'avis platau & Affichage en front
devottered Feb 27, 2023
13c7e2d
Permet de renvoyer une pec ou un avis
devottered Feb 27, 2023
dec2630
Correction sur la définition de la table
devottered Mar 6, 2023
613c229
Correction sur les valeurs par défaut
devottered Mar 6, 2023
a156029
Ajout de la date d'envoi
devottered Mar 6, 2023
0dbca17
Ajout d'un statut d'erreur
devottered Mar 13, 2023
3efd5e9
Empêche le renvoi de PEC et le changement d'avis une fois l'avis rend…
devottered Mar 13, 2023
35ec646
Affiche la liste des PJs si le statut est "à renvoyer"
devottered Mar 13, 2023
91287a5
Correction pour les dossiers arrivés avant l'ajout des statuts
devottered Mar 29, 2023
169b372
Renommage des SQLs pour ne pas planter à l'installation
devottered Apr 5, 2023
d9fb157
Code plus utilisé depuis le déplacement dans la modification du dossier
devottered Jun 19, 2023
6ccb45d
On a une valeur null
devottered Jun 19, 2023
5a8b408
Bloc spécifique Plat'AU
devottered Jun 19, 2023
297da3e
Dates en français
devottered Jun 19, 2023
75fdb5d
Les classes n'étaient pas correctes
devottered Jun 20, 2023
167d79b
Ajout warning si avis/pec en erreur
devottered Jun 20, 2023
5f32a0c
Evite de planter en front si statut inconnu
devottered Jun 27, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 25 additions & 2 deletions application/controllers/DossierController.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@ class DossierController extends Zend_Controller_Action
public function init()
{
$this->_helper->layout->setLayout('dossier');
$this->view->inlineScript()->appendFile('/js/dossier/dossierGeneral.js','text/javascript');
$this->view->inlineScript()->appendFile('/js/dossier/dossierGeneral.js', 'text/javascript');
$this->view->inlineScript()->appendFile('/js/dossier/platau.js', 'text/javascript');

// Actions à effectuées en AJAX
$ajaxContext = $this->_helper->getHelper('AjaxContext');
Expand All @@ -169,6 +170,22 @@ public function init()
$dossier = $DBdossier->find($id_dossier)->current();
$this->view->id_platau = null !== $dossier['ID_PLATAU'] ? $dossier['ID_PLATAU'] : null;

if (null !== $dossier['ID_PLATAU']) {
$platauConsultationMapper = new Model_PlatauConsultationMapper();
$platauConsultationModel = new Model_PlatauConsultation();
$this->view->enumStatutsPec = new Model_Enum_PlatauStatutPec();
$this->view->enumStatutsAvis = new Model_Enum_PlatauStatutAvis();

$platauConsultation = $platauConsultationMapper->find($dossier['ID_PLATAU'], $platauConsultationModel);

if (null !== $platauConsultation) {
$this->view->statutPec = $platauConsultation->getStatutPec();
$this->view->datePec = $platauConsultation->getDatePec();
$this->view->statutAvis = $platauConsultation->getStatutAvis();
$this->view->dateAvis = $platauConsultation->getDateAvis();
}
}

$DBdossierType = new Model_DbTable_DossierType();
$libelleType = $DBdossierType->find($dossier->TYPE_DOSSIER)->current();

Expand Down Expand Up @@ -783,7 +800,7 @@ public function saveAction()
foreach ($_POST as $libelle => $value) {
//On exclu la lecture de selectNature => select avec les natures;
//NUM_DOCURB => input text pour la saisie des doc urba; docUrba & natureId => interpreté après;
if ($libelle != "DATEVISITE_PERIODIQUE" && $libelle != "selectNature" && $libelle != "NUM_DOCURBA" && $libelle != "natureId" && $libelle != "docUrba" && $libelle != 'do' && $libelle != 'idDossier' && $libelle != 'HEUREINTERV_DOSSIER' && $libelle != 'idEtablissement' && $libelle != 'ID_AFFECTATION_DOSSIER_VISITE' && $libelle != 'ID_AFFECTATION_DOSSIER_COMMISSION' && $libelle != "preventionniste" && $libelle != "commissionSelect" && $libelle != "ID_CREATEUR" && $libelle != "HORSDELAI_DOSSIER" && $libelle != "genreInfo" && $libelle != "docManquant" && $libelle != "dateReceptionDocManquant" && $libelle != "dateDocManquant" && $libelle != "ABSQUORUM_DOSSIER" && $libelle != "servInst" && $libelle != "servInstVille" && $libelle != "servInstGrp" && $libelle != "repercuterAvis" && $libelle != "INCOMPLET_DOSSIER") {
if ($libelle != "DATEVISITE_PERIODIQUE" && $libelle != "selectNature" && $libelle != "NUM_DOCURBA" && $libelle != "natureId" && $libelle != "docUrba" && $libelle != 'do' && $libelle != 'idDossier' && $libelle != 'HEUREINTERV_DOSSIER' && $libelle != 'idEtablissement' && $libelle != 'ID_AFFECTATION_DOSSIER_VISITE' && $libelle != 'ID_AFFECTATION_DOSSIER_COMMISSION' && $libelle != "preventionniste" && $libelle != "commissionSelect" && $libelle != "ID_CREATEUR" && $libelle != "HORSDELAI_DOSSIER" && $libelle != "genreInfo" && $libelle != "docManquant" && $libelle != "dateReceptionDocManquant" && $libelle != "dateDocManquant" && $libelle != "ABSQUORUM_DOSSIER" && $libelle != "servInst" && $libelle != "servInstVille" && $libelle != "servInstGrp" && $libelle != "repercuterAvis" && $libelle != "INCOMPLET_DOSSIER" && $libelle != "export-pj-platau") {
//Test pour voir s'il sagit d'une date pour la convertir au format ENG et l'inserer dans la base de données
if ("DATEMAIRIE_DOSSIER" == $libelle || "DATESECRETARIAT_DOSSIER" == $libelle || "DATEVISITE_DOSSIER" == $libelle || "DATECOMM_DOSSIER" == $libelle || "DATESDIS_DOSSIER" == $libelle || "DATEPREF_DOSSIER" == $libelle || "DATEREP_DOSSIER" == $libelle || "DATEREUN_DOSSIER" == $libelle || "DATEINTERV_DOSSIER" == $libelle || "DATESIGN_DOSSIER" == $libelle || "DATEINSERT_DOSSIER" == $libelle || "DATEENVTRANSIT_DOSSIER" == $libelle || "ECHEANCIERTRAV_DOSSIER" == $libelle || "DATETRANSFERTCOMM_DOSSIER" == $libelle || "DATERECEPTIONCOMM_DOSSIER" == $libelle || "DATERVRAT_DOSSIER" == $libelle || "DELAIPRESC_DOSSIER" == $libelle) {
if ($value) {
Expand Down Expand Up @@ -813,6 +830,12 @@ public function saveAction()
}
}

if ($pjs = $this->_getParam('export-pj-platau')) {
$servicePj = new Service_PieceJointe();

$servicePj->exportPlatau($pjs);
}

if (!$this->_getParam('HORSDELAI_DOSSIER')) {
$nouveauDossier->HORSDELAI_DOSSIER = 0;
} else {
Expand Down
77 changes: 57 additions & 20 deletions application/controllers/PieceJointeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,41 @@
class PieceJointeController extends Zend_Controller_Action
{
public $store;
private $dbPj;

public function init()
{
$this->store = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('dataStore');

// Actions à effectuées en AJAX
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('check', 'json')
->initContext();
$ajaxContext
->addActionContext('check', 'json')
->initContext()
;

$this->dbPj = new Model_DbTable_PieceJointe();
}

public function indexAction()
{
$this->view->headScript()->appendFile('/js/dossier/pieceJointe.js', 'text/javascript');
$this->view->headLink()->appendStylesheet('/css/pieces-jointes.css', 'all');

// Modèles
$DBused = new Model_DbTable_PieceJointe;
$DBused = new Model_DbTable_PieceJointe();
$modelDossier = new Model_DbTable_Dossier();

// Cas dossier
if ($this->_request->type == "dossier") {
$this->view->type = "dossier";
$this->view->identifiant = $this->_request->id;
$this->view->pjcomm = $this->_request->pjcomm;
$listePj = $DBused->affichagePieceJointe("dossierpj", "dossierpj.ID_DOSSIER", $this->_request->id);
$this->view->verrou = $this->_request->verrou;
}

// Cas établissement
else if ($this->_request->type == "etablissement") {
$this->view->type = "etablissement";
$listePj = $DBused->affichagePieceJointe('dossierpj', 'dossierpj.ID_DOSSIER', $this->_request->id);
$this->view->verrou = $this->_request->verrou;
$this->view->isPlatau = $modelDossier->isPlatau($this->getRequest()->getParam('id'));
} elseif ('etablissement' == $this->_request->type) { // Cas établissement
$this->view->type = 'etablissement';
$this->view->identifiant = $this->_request->id;
$listePj = $DBused->affichagePieceJointe("etablissementpj", "etablissementpj.ID_ETABLISSEMENT", $this->_request->id);
}
Expand Down Expand Up @@ -317,6 +324,7 @@ public function checkAction()
{
// Modèle
$DBused = new Model_DbTable_PieceJointe;
$modelDossier = new Model_DbTable_Dossier();

// Cas dossier
if ($this->_request->type == "dossier") {
Expand Down Expand Up @@ -349,15 +357,44 @@ public function checkAction()

if ($this->view->exists) {
// Données de la pj
$this->view->html = $this->view->partial("piece-jointe/display.phtml", array (
"path" => $this->getHelper('url')->url(array('controller' => 'piece-jointe', 'id' => $this->_request->id, 'action' => 'get', 'idpj' => $this->_request->idpj, 'type' => $this->_request->type)),
"listePj" => $listePj,
"droit_ecriture" => true,
"type" => $this->_request->type,
"id" => $this->_request->id,
));
}
$this->view->html = $this->view->partial('piece-jointe/display.phtml', [
'path' => $this->getHelper('url')->url(['controller' => 'piece-jointe', 'id' => $this->_request->id, 'action' => 'get', 'idpj' => $this->_request->idpj, 'type' => $this->_request->type]),
'listePj' => $listePj,
'droit_ecriture' => true,
'type' => $this->_request->type,
'id' => $this->_request->id,
'isPlatau' => $modelDossier->isPlatau($this->_request->id),
]);
}
}

public function retryExportPlatauAction(): void
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();

$idPj = filter_var($this->getRequest()->getPost()['idPj'], FILTER_VALIDATE_INT);

$this->dbPj->updatePlatauStatus($idPj, 'to_be_exported');
}

/**
* @return null|void
*/
public function displayPjPlatauAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();

$idDossier = $this->getRequest()->getParam('idDossier');
$canBeExported = $this->dbPj->getWithStatus($idDossier, 'not_exported');

if (0 === count($canBeExported)) {
return null;
}

$html = Zend_Layout::getMvcInstance()->getView()->partial('piece-jointe/export.phtml', ['piecesJointes' => $canBeExported]);

echo $html;
}


}
43 changes: 43 additions & 0 deletions application/controllers/PlatauController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<?php

class PlatauController extends Zend_Controller_Action
{
/**
* @var Model_PlatauConsultationMapper
*/
private $platauConsultationMapper;

public function init()
{
$ajaxContext = $this->_helper->getHelper('AjaxContext');
$ajaxContext->addActionContext('selectionabreviation', 'json')
->addActionContext('retryExportPec', 'json')
->addActionContext('retryExportAvis', 'json')
->initContext()
;

$this->platauConsultationMapper = new Model_PlatauConsultationMapper();
}

public function retryExportPecAction(): void
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();

$platauConsultation = $this->platauConsultationMapper->find($this->getParam('id'), new Model_PlatauConsultation());
$platauConsultation->setStatutPec('to_export');

$this->platauConsultationMapper->save($platauConsultation);
}

public function retryExportAvisAction(): void
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();

$platauConsultation = $this->platauConsultationMapper->find($this->getParam('id'), new Model_PlatauConsultation());
$platauConsultation->setStatutAvis('to_export');

$this->platauConsultationMapper->save($platauConsultation);
}
}
50 changes: 24 additions & 26 deletions application/layouts/dossier.phtml
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
<?php if($this->action != "add" && $this->do != "new" ) : ?>
<?php $this->placeholder('lateral_navigation')->captureStart(); // Capture du 'lateral_navigation' ?>
<input type='hidden' name='ID_CREATEUR' id='ID_CREATEUR' value='<?php echo $this->idUser; ?>' />
<input type='hidden' name='ID_CREATEUR' id='ID_CREATEUR' value='<?php echo $this->idUser; ?>' />
<ul class="nav nav-tabs nav-stacked menu_dashboard" >
<?php /*class="nav nav-tabs nav-stacked menu_dashboard" */ ?>

<li class="<?php echo ( $this->action == "index" ) ? "active" : "read" ?>">
<a
href='<?php echo $this->url(array("controller" => "dossier", "id" => $this->idDossier), false, true) ?>'><i class="icon-info-sign icon-black"></i> Informations générales</a>
</li>

<?php
<li class="<?php echo ( $this->action == "index" ) ? "active" : "read" ?>">
<a
href='<?php echo $this->url(array("controller" => "dossier", "id" => $this->idDossier), false, true) ?>'><i class="icon-info-sign icon-black"></i> Informations générales</a>
</li>

<?php
if($this->idTypeDossier == 1 && $this->natureDossier != 3 && $this->natureDossier != 9) {
echo "<li class='".(( $this->action == "descriptif") ? "active" : "read" )."'>
<a "
Expand Down Expand Up @@ -38,12 +36,12 @@
</li>";
}
?>

<li class='<?php echo ( $this->action == "liees" ) ? "active" : "read" ?>'>
<a
<a
href='<?php echo $this->url(array("controller" => "dossier", "action"=>"liees", "id" => $this->idDossier), false, true) ?>'><i class="icon-folder-open icon-black"></i> Établissements et dossiers liés</a>
</li>

<?php
if($this->natureDossier != 40 && $this->natureDossier != 41 && $this->natureDossier != 42 && $this->natureDossier != 44) {
echo "<li class='".( ( $this->action == "contact" ) ? "active" : "read" )."'>
Expand All @@ -52,7 +50,7 @@
</li>";
}
?>

<li class='<?php echo ( $this->action == "piece-jointe" ) ? "active" : "read" ?>'>
<a
href='<?php echo $this->url(array("controller" => "dossier", "action"=>"piece-jointe", "id" => $this->idDossier), false, true) ?>'><i class="icon-share icon-black"></i> Pièces jointes</a>
Expand All @@ -63,7 +61,7 @@
if ($this->verrou == 1 || (isset($action) && $action == 'new')) {
$label = "Déverrouiller";
$idLink = "DEVERROU";
} else {
} else {
$label = "Verrouiller";
$idLink = "VERROU";
$verrou = false;
Expand Down Expand Up @@ -91,7 +89,7 @@ endif; ?>

<?php $this->placeholder('page_header')->captureStart(); //$this->placeholder('before_content')->captureStart() // Capture du 'before_content' ?>

<?php
<?php
if($this->action == "add" || $this->do == "new" ){
//Cas d'ajout d'un nouveau dossier
echo "
Expand Down Expand Up @@ -141,7 +139,7 @@ endif; ?>
}
echo ")</span>";
}

echo " <span style='font-size:10px'>#".$etablissementInfos['general']['NUMEROID_ETABLISSEMENT']."</span>";
}
echo "
Expand All @@ -156,9 +154,9 @@ endif; ?>
<small><br/>".nl2br($this->objetDossier)."</small>
";

if($this->id_platau !== null) {
echo "<p style='font-size: medium;' class='label label-info'><strong>CONSULTATION PLATAU : " . $this->id_platau . "</strong></p>";
}
if($this->id_platau !== null){ ?>
<p style='font-size: medium;' class='label label-info'><strong>CONSULTATION PLATAU : <?= $this->id_platau ?></strong></p>
<?php }

echo "
<div style='margin:10px;' id='infosEtabs'>
Expand All @@ -168,13 +166,13 @@ endif; ?>
if($nbEtab > 0){
if($nbEtab == 1 && $this->enteteEtab[0]["LIBELLE_GENRE"] == "Site"){
echo "Site concerné : &nbsp;";

echo "
<a href='/etablissement/index/id/".$this->enteteEtab[0]['ID_ETABLISSEMENT']."' class='etab'>
".$this->enteteEtab[0]['LIBELLE_ETABLISSEMENTINFORMATIONS']."
".$this->enteteEtab[0]['LIBELLE_ETABLISSEMENTINFORMATIONS']."
</a>
";

echo " <span style='font-size:10px'>#".$this->enteteEtab[0]['infosEtab']['general']['NUMEROID_ETABLISSEMENT']."</span>";
}else{
echo "Etablissement(s) concerné(s) : &nbsp;";
Expand Down Expand Up @@ -233,9 +231,9 @@ endif; ?>
}
echo ")</span>";
}
echo " <span style='font-size:10px'>#".$value['infosEtab']['general']['NUMEROID_ETABLISSEMENT']."</span>";

echo " <span style='font-size:10px'>#".$value['infosEtab']['general']['NUMEROID_ETABLISSEMENT']."</span>";

$i++;
}
}
Expand Down Expand Up @@ -304,7 +302,7 @@ endif; ?>
});
return false;
});

$("#DEVERROU").live('click',function(){
$.ajax({
url: "/dossier/deverrou",
Expand Down
11 changes: 11 additions & 0 deletions application/models/DbTable/Dossier.php
Original file line number Diff line number Diff line change
Expand Up @@ -370,4 +370,15 @@ public function getPreventionnistesDossier($id_dossier)
//echo $select;
return $this->getAdapter()->fetchAll($select);
}

public function isPlatau(int $idDossier): bool
{
$select = $this->select(self::SELECT_WITH_FROM_PART)
->where('ID_DOSSIER = ?', $idDossier)
;

$result = $this->fetchRow($select);

return null !== $result['ID_PLATAU'];
}
}
Loading