Commit cd4be57c authored by Théo GUILLON's avatar Théo GUILLON

Merge branch '165-affichage-des-entites-dans-le-menu-pour-changer-d-entite' into 'master'

Resolve "Affichage des entités dans le menu pour changer d'entité"

See merge request web-DPO/web-DPO!135
parents 7836f6e5 93acf5c9
......@@ -515,6 +515,10 @@ class OrganisationsController extends AppController {
* @version V1.0.0
*/
public function change($id = null, $redirect = 0, $controller = null, $action = null) {
if (isset($this->request->data['Organisation']['organisationcible'])) {
$id = $this->request->data['Organisation']['organisationcible'];
}
if ($id === 'null' ) {
$id = trim((string)Hash::get($this->request->data, 'Organisation.organisationcible'));
$id = $id === '' ? null : $id;
......
......@@ -410,13 +410,23 @@
]
];
foreach ($organisations as $datas) {
$mesEntites[$datas['Organisation']['raisonsociale']] = [
if (count($organisations) <= 5) {
foreach ($organisations as $datas) {
$mesEntites[$datas['Organisation']['raisonsociale']] = [
'url' => [
'controller' => 'organisations',
'action' => 'change',
$datas['Organisation']['id']
]
];
}
} else {
$mesEntites[__d('pannel', 'pannel.champOrganisationcible')] = [
'url' => [
'controller' => 'organisations',
'action' => 'change',
$datas['Organisation']['id']
]
'#' => '#'
],
'data-toggle' => 'modal',
'data-target' => '#modalChangeEntite'
];
}
......@@ -723,6 +733,66 @@
</div>
</div>
</div>
<!--Pop-up pour administrer une entité-->
<div class="modal fade" id="modalChangeEntite" 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('pannel', 'pannel.popupAdministrerEntite'); ?>
</h4>
</div>
<div class="modal-body">
<div class="row form-group">
<?php
echo $this->Form->create('Organisation', [
'url' => [
'controller' => 'organisations',
'action' => 'change'
]
]);
echo $this->WebcilForm->input('Organisation.organisationcible', [
'id' => 'organisationcible',
'options' => $listeOrganisations,
'class' => 'usersDeroulant transformSelect form-control',
'required' => true,
'empty' => true,
'data-placeholder' => ' '
]);
?>
</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-wrench fa-lg'>&nbsp;</i>" . __d('organisation', 'organisation.btnAdministrerEntite'), [
'type' => 'submit',
'class' => 'btn btn-default-success',
'escape' => false
]);
?>
</div>
<?php
echo $this->Form->end();
?>
</div>
</div>
</div>
</div>
<div id="footer" class="container-fluid-custom">
<div class="text-center versioning">
......
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