Commit 20598289 authored by Théo GUILLON's avatar Théo GUILLON
Browse files

Modification : traitement et affichage du nom, finalité et service d'un traitement

Modification : création elements pour les modals dans le registre
parent a9b755a0
......@@ -286,7 +286,15 @@ class RegistresController extends AppController {
]
],
'Fichier' => [],
'Norme' => [],
'Norme' => [
'fields' => [
'id',
'norme',
'numero',
'libelle',
'description',
],
],
'Formulaire' => [
'fields' => [
'soustraitant'
......@@ -301,7 +309,12 @@ class RegistresController extends AppController {
$this->paginate = $query;
$fichesValid = $this->paginate('EtatFiche');
foreach ($fichesValid as $idx => $fiche) {
$list = Hash::combine($fiche, 'Fiche.Valeur.{n}.champ_name', 'Fiche.Valeur.{n}.valeur');
$fichesValid[$idx]['Fiche']['Valeur'] = $list;
}
$enumsNormes = $this->Norme->enums();
$this->set(compact('enumsNormes'));
......
<!-- Pop-up de modification de la position d'un traitement pour la génération -->
<div class="modal fade" id="modalChangerPosition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">
<?php
echo __d('registre', 'registre.popupPositionnement');
?>
</h4>
</div>
<div class="modal-body">
<table class="table" id="render">
<!-- Titre tableau -->
<thead>
<tr>
<!-- Positionnement -->
<th class="col-md-1">
<?php
echo __d('registre', 'registre.textTableauPositionTraitement');
?>
</th>
<!-- Numéro d'enregistrement -->
<th class="col-md-1">
<?php
echo __d('registre', 'registre.textTableauNumeroEnregistrement');
?>
</th>
<!-- Nom du traitement -->
<th class="col-md-3">
<?php
echo __d('registre', 'registre.titreTableauNomTraitement');
?>
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="modal-footer">
<div class="btn-group">
<button type="button" class="btn btn-default-default" data-dismiss="modal">
<i class="fa fa-times-circle fa-lg"><!----></i>
<?php echo __d('default', 'default.btnAnnuler'); ?>
</button>
<?php
echo $this->Form->button('<span class="fa fa-cogs fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnGenerer'), [
'onclick' => "sendDataExtrait()",
'class' => 'btn btn-default-primary pull-left btn_popupGenerer'
]);
echo $this->Form->button('<span class="fa fa-download fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnTélécharger'), [
'onclick' => "sendData()",
'class' => 'btn btn-default-primary pull-left btn_popupTelecharger'
]);
echo $this->Form->button('<span class="fa fa-cogs fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnGenerer'), [
'onclick' => "sendDataDeclaration()",
'class' => 'btn btn-default-primary pull-left btn_popupGenererNonVerrouiller'
]);
echo $this->Form->button('<span class="fa fa-download fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnExport'), [
'onclick' => "sendDataExport()",
'class' => 'btn btn-default-primary pull-left btn_popupExportCsv'
]);
?>
</div>
</div>
</div>
</div>
</div>
\ No newline at end of file
<!-- Pop-up modification du traitement enregistré au registre -->
<div class="modal fade" id="modalEditRegistre" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">
<?php echo __d('registre', 'registre.popupTitreEditionTraitementRegistre'); ?>
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12 text-warning">
<div class="col-md-12 text-center">
<i class="fa fa-exclamation-triangle fa-lg"><!----></i>
</div>
<div class="col-md-12">
<?php echo __d('registre', 'registre.popupText'); ?>
</div>
</div>
</div>
<div class="row top17">
<div class="col-md-12">
<?php
echo $this->Form->create('Registre', [
'url' => ['action' => 'edit'],
'class' => 'form-horizontal'
]);
echo $this->Form->input('motif', [
'label' => [
'text' => __d('registre', 'registre.popupChampMotif') . '<span class="obligatoire"> *</span>',
'class' => 'col-md-2 control-label'
],
'between' => '<div class="col-md-10">',
'after' => '</div>',
'class' => 'form-control',
'div' => 'form-group',
'required' => 'required'
]);
echo $this->Form->hidden('idEditRegistre', [
'value' => '',
'id' => "toModif"
]);
?>
</div>
</div>
</div>
<div class="modal-footer">
<div class="btn-group">
<button type="button" class="btn btn-default-default" data-dismiss="modal">
<i class="fa fa-times-circle fa-lg"><!----></i>
<?php echo __d('default', 'default.btnAnnuler'); ?>
</button>
<?php
echo $this->Form->button("<i class='fa fa-floppy-o fa-lg'><!----></i>" . __d('default', 'default.btnEnregistrer'), [
'type' => 'submit',
'class' => 'btn btn-default-success',
'escape' => false
]);
?>
</div>
<?php
echo $this->Form->end();
?>
</div>
</div>
</div>
</div>
\ No newline at end of file
......@@ -21,7 +21,7 @@
$filters = $this->request->data;
unset($filters['sort'], $filters['direction'], $filters['page'], $filters['Registre']['nbAffichage']);
if(empty($filters['Registre'])) {
if (empty($filters['Registre'])) {
unset($filters['Registre']);
}
......@@ -162,8 +162,6 @@
<?php
$idExtrait = [];
foreach ($fichesValid as $key => $value) {
$numeroRegistre = $value['Fiche']['numero'];
if ($value['EtatFiche']['etat_id'] != EtatFiche::ARCHIVER || $organisationActuelle['Organisation']['verrouiller'] == false) {
$iconBtn = $this->Html->tag('i','<!---->',['class' => 'fa fa-cog fa-lg']);
$titleBtn = __d('registre', 'registre.commentaireGenererRegistrePDF');
......@@ -173,21 +171,6 @@
}
if ($value['Fiche']['Valeur'] != null) {
$valeursTraitement = Hash::extract($value['Fiche'],'Valeur.{n}');
foreach ($valeursTraitement as $valeurTraitement) {
if ($valeurTraitement['champ_name'] === 'outilnom') {
$nomTraitement = $valeurTraitement['valeur'];
}
if ($valeurTraitement['champ_name'] === 'finaliteprincipale') {
$finalitePrincipaleTraitement = $valeurTraitement['valeur'];
}
if ($valeurTraitement['champ_name'] === 'declarantservice') {
$declarantServiceTraitement = $valeurTraitement['valeur'];
}
}
?>
<tr>
<?php
......@@ -208,14 +191,14 @@
<!-- Nom du traitement -->
<td class="tdleft">
<?php
echo $nomTraitement;
echo $value['Fiche']['Valeur']['outilnom'];
?>
</td>
<!-- Finalité principale -->
<td class="tdleft">
<?php
echo nl2br($finalitePrincipaleTraitement);
echo nl2br($value['Fiche']['Valeur']['finaliteprincipale']);
?>
</td>
......@@ -224,9 +207,13 @@
<div class="row">
<div class="col-md-12">
<strong>
<?php echo __d('registre', 'registre.textTableauNumeroEnregistrement'); ?>
<?php
echo __d('registre', 'registre.textTableauNumeroEnregistrement');
?>
</strong>
<?php echo $numeroRegistre; ?>
<?php
echo $value['Fiche']['numero'];
?>
</div>
</div>
......@@ -234,9 +221,13 @@
<div class="row">
<div class="col-md-12">
<strong>
<?php echo __d('registre', 'registre.textTableauDateCreation'); ?>
<?php
echo __d('registre', 'registre.textTableauDateCreation');
?>
</strong>
<?php echo $this->Time->format($value['Fiche']['created'], FORMAT_DATE); ?>
<?php
echo $this->Time->format($value['Fiche']['created'], FORMAT_DATE);
?>
</div>
</div>
......@@ -249,7 +240,7 @@
?>
</strong>
<?php
echo $declarantServiceTraitement;
echo $value['Fiche']['Valeur']['declarantservice'];
?>
</div>
</div>
......@@ -477,171 +468,13 @@
</div>
<?php
}
?>
<!-- Pop-up modification du traitement enregistré au registre -->
<div class="modal fade" id="modalEditRegistre" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">
<?php echo __d('registre', 'registre.popupTitreEditionTraitementRegistre'); ?>
</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-12 text-warning">
<div class="col-md-12 text-center">
<i class="fa fa-exclamation-triangle fa-lg"><!----></i>
</div>
<div class="col-md-12">
<?php echo __d('registre', 'registre.popupText'); ?>
</div>
</div>
</div>
<div class="row top17">
<div class="col-md-12">
<?php
echo $this->Form->create('Registre', [
'url' => ['action' => 'edit'],
'class' => 'form-horizontal'
]);
echo $this->Form->input('motif', [
'label' => [
'text' => __d('registre', 'registre.popupChampMotif') . '<span class="obligatoire"> *</span>',
'class' => 'col-md-2 control-label'
],
'between' => '<div class="col-md-10">',
'after' => '</div>',
'class' => 'form-control',
'div' => 'form-group',
'required' => 'required'
]);
echo $this->Form->hidden('idEditRegistre', [
'value' => '',
'id' => "toModif"
]);
?>
</div>
</div>
</div>
<div class="modal-footer">
<div class="btn-group">
<button type="button" class="btn btn-default-default" data-dismiss="modal">
<i class="fa fa-times-circle fa-lg"><!----></i>
<?php echo __d('default', 'default.btnAnnuler'); ?>
</button>
<?php
echo $this->Form->button("<i class='fa fa-floppy-o fa-lg'><!----></i>" . __d('default', 'default.btnEnregistrer'), [
'type' => 'submit',
'class' => 'btn btn-default-success',
'escape' => false
]);
?>
</div>
<?php
echo $this->Form->end();
?>
</div>
</div>
</div>
</div>
echo $this->element('Registres/modal/modalEditRegistre');
<?php
echo $pagination;
?>
<!-- Pop-up de modification de la position d'un traitement pour la génération -->
<div class="modal fade" id="modalChangerPosition" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title" id="myModalLabel">
<?php
echo __d('registre', 'registre.popupPositionnement');
?>
</h4>
</div>
<div class="modal-body">
<table class="table" id="render">
<!-- Titre tableau -->
<thead>
<tr>
<!-- Positionnement -->
<th class="col-md-1">
<?php
echo __d('registre', 'registre.textTableauPositionTraitement');
?>
</th>
<!-- Numéro d'enregistrement -->
<th class="col-md-1">
<?php
echo __d('registre', 'registre.textTableauNumeroEnregistrement');
?>
</th>
<!-- Nom du traitement -->
<th class="col-md-3">
<?php
echo __d('registre', 'registre.titreTableauNomTraitement');
?>
</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="modal-footer">
<div class="btn-group">
<button type="button" class="btn btn-default-default" data-dismiss="modal">
<i class="fa fa-times-circle fa-lg"><!----></i>
<?php echo __d('default', 'default.btnAnnuler'); ?>
</button>
<?php
echo $this->Form->button('<span class="fa fa-cogs fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnGenerer'), [
'onclick' => "sendDataExtrait()",
'class' => 'btn btn-default-primary pull-left btn_popupGenerer'
]);
echo $this->Form->button('<span class="fa fa-download fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnTélécharger'), [
'onclick' => "sendData()",
'class' => 'btn btn-default-primary pull-left btn_popupTelecharger'
]);
echo $this->Form->button('<span class="fa fa-cogs fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnGenerer'), [
'onclick' => "sendDataDeclaration()",
'class' => 'btn btn-default-primary pull-left btn_popupGenererNonVerrouiller'
]);
echo $this->Form->button('<span class="fa fa-download fa-lg">&nbsp;</span>' . __d('registre', 'registre.btnExport'), [
'onclick' => "sendDataExport()",
'class' => 'btn btn-default-primary pull-left btn_popupExportCsv'
]);
?>
</div>
</div>
</div>
</div>
</div>
echo $this->element('Registres/modal/modalChangerPosition');
?>
<script type="text/javascript">
//<![CDATA[
......@@ -829,7 +662,7 @@
var tr = $('<tr id="'+selectedList[key]+'"><\/tr>')
.append('<td class="col-md-1"><select class="form-control optionSelected" required="required">' + createOption(nbTraitement, key+1) + '<\/select><\/td>')
.append('<td class="col-md-1 tdleft">'+traitement[key]['Fiche']['numero']+'<\/td>')
.append('<td class="col-md-3 tdleft">'+traitement[key]['Fiche']['Valeur'][1]['valeur']+'<\/td>')
.append('<td class="col-md-3 tdleft">'+traitement[key]['Fiche']['Valeur']['outilnom']+'<\/td>')
$('#render').find('tbody').append(tr);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment