Commit ef115162 authored by THEO GUILLON's avatar THEO GUILLON
Browse files

Modification : factorisation de la modal

Modification : de l'affichage de la modal (TinyMCE)
parent 97a59ecf
Pipeline #17374 passed with stage
in 1 minute and 51 seconds
<?php
$body = $this->WebcilForm->inputs([
'EtatFiche.commentaire' => [
'label' => [
'text' => 'Commentaire',
],
'class' => 'form-control reponseStartTinyMCE',
'required' => true,
'placeholder' => false,
'type' => 'textarea'
],
'EtatFiche.idUserCommentaire' => [
'type' => 'hidden',
'value' => json_encode($idUserCommentaire)
],
'EtatFiche.etat_fiche_id' => [
'type' => 'hidden',
'value' => $id
],
'EtatFiche.fiche_id' => [
'type' => 'hidden',
'value' => $fiche_id
],
]);
$footer = '<div class="buttons">'
. $this->WebcilForm->button("<i class='fa fa-times-circle fa-lg'></i>" . __d('default', 'default.btnCancel'), [
'type' => 'submit',
'data-dismiss' => 'modal',
'class' => 'btn btn-outline-primary',
'escape' => false,
])
. ' '
. $this->WebcilForm->button("<i class='fa fa-paper-plane fa-lg'></i>" . __d('default', 'default.btnSend'), [
'type' => 'submit',
'class' => 'btn btn-outline-success',
'escape' => false
])
.'</div>'
;
$content = [
'title' => __d('formulaire', 'formulaire.modalTitleRepondreCommentaire'),
'body' => $body,
'footer' => $footer,
];
echo $this->element('modal', [
'modalId' => 'AddCommentaire',
'controller' => 'EtatFiches',
'action' => 'repondreCommentaire',
'content' => $content,
'sizeModal' => 'modal-xl'
]);
......@@ -195,95 +195,17 @@
</button>
</div>
</div>
<div class="modal fade" id="AddCommentaire" 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('formulaire', 'formulaire.modalTitleRepondreCommentaire');
?>
</h4>
</div>
<div class="modal-body">
<?php
//pop-up de création de formulaire
echo $this->Form->create('EtatFiche', [
'url' => [
'action' => 'repondreCommentaire'
],
'class' => 'search-form'
]);
echo '<div class="row form-group">';
//Champ Description
echo $this->Form->input('commentaire', [
'type' => 'textarea',
'class' => 'form-control',
'placeholder' => __d('formulaire', 'formulaire.popupPlaceholderDescription'),
'label' => [
'text' => "Commentaire" .' '. '<span class="requis">*</span>',
'class' => 'col-md-4 control-label'
],
'between' => '<div class="col-md-8">',
'after' => '</div>',
'required' => true
]);
echo $this->Form->input('idUserCommentaire', [
'type' => 'hidden',
'value' => json_encode($idUserCommentaire)
]);
echo $this->Form->input('etat_fiche_id', [
'type' => 'hidden',
'value' => $value['EtatFiche']['id']
]);
echo $this->Form->input('fiche_id', [
'type' => 'hidden',
'value' => $value['EtatFiche']['fiche_id']
]);
echo '</div>'
?>
</div>
<div class="modal-footer">
<div class="buttons">
<button type="button" class="btn btn-outline-primary" data-dismiss="modal">
<i class="fa fa-times-circle fa-lg"></i>
<?php
echo __d('default', 'default.btnCancel');
?>
</button>
<?php
echo $this->Form->button("<i class='fa fa-paper-plane fa-lg'></i>" . __d('default', 'default.btnSend'), [
'type' => 'submit',
'class' => 'btn btn-outline-success',
'escape' => false
]);
?>
</div>
<?php
echo $this->Form->end();
?>
</div>
</div>
</div>
</div>
</div>
<?php
}
?>
</div>
<?php
echo $this->element('Pannel/modalAddCommentaire', [
'idUserCommentaire' => $idUserCommentaire,
'id' => $value['EtatFiche']['id'],
'fiche_id' => $value['EtatFiche']['fiche_id']
]);
break;
//Rectangle vert Validée
......
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