diff --git a/app/Locale/fra/LC_MESSAGES/fiche.po b/app/Locale/fra/LC_MESSAGES/fiche.po index 8e5d46dd93ab3a347bb672aa4d242cbfa2525f42..05e9df16541c3415c75e1cc07303fb1cf2259871 100755 --- a/app/Locale/fra/LC_MESSAGES/fiche.po +++ b/app/Locale/fra/LC_MESSAGES/fiche.po @@ -640,6 +640,9 @@ msgstr "Dupliquer le traitement" msgid "fiche.champOrganisationcible" msgstr "Entité cible pour la duplication du traitement" +msgid "fiche.champDuplicationOrganisationcible" +msgstr "Entité cible pour la duplication du traitement" + msgid "fiche.champUsercible" msgstr "Utilisateur rédacteur pour la duplication du traitement" diff --git a/app/View/Elements/Fiches/modal/modalDupliquerTraitement.ctp b/app/View/Elements/Fiches/modal/modalDupliquerTraitement.ctp index cfa641c0958795649cc108ec29b7a5bfa0a028c9..b6a1f15a803da7b3fd2f1a2c4bbe345cb2bb9c72 100644 --- a/app/View/Elements/Fiches/modal/modalDupliquerTraitement.ctp +++ b/app/View/Elements/Fiches/modal/modalDupliquerTraitement.ctp @@ -4,9 +4,10 @@ $body = $this->WebcilForm->inputs([ 'id' => "FicheId", 'value' => null ], - 'Fiche.organisationcible' => [ - 'id' => 'organisationcible', + 'Fiche.duplicationOrganisationcible' => [ + 'id' => 'duplicationOrganisationcible', 'options' => $mesOrganisations, + 'class' => 'usersDeroulant transformSelect form-control', 'required' => true, 'empty' => true, 'placeholder' => false, @@ -15,6 +16,7 @@ $body = $this->WebcilForm->inputs([ 'Fiche.usercible' => [ 'id' => 'usercible', 'options' => [], + 'class' => 'usersDeroulant transformSelect form-control', 'required' => true, 'empty' => true, 'placeholder' => false, @@ -23,6 +25,7 @@ $body = $this->WebcilForm->inputs([ 'Fiche.userservicecible' => [ 'id' => 'userservicecible', 'options' => [], + 'class' => 'usersDeroulant transformSelect form-control', 'required' => true, 'empty' => true, 'placeholder' => false, @@ -70,36 +73,37 @@ echo $this->element('modal', [ $('#FicheId').val($(this).attr('value')); }); - // Lors d'action sur une menu déroulant : organisationcible - $("#organisationcible").change(function () { - let organisationcible = $(this).val(); + // Lors d'action sur une menu déroulant : duplicationOrganisationcible + $("#duplicationOrganisationcible").on('change.select2', function () { + let duplicationOrganisationcible = $(this).val(); hideAndRemoveField(); - if (organisationcible) { - updateListingUser(organisationcible); + if (duplicationOrganisationcible) { + updateListingUser(duplicationOrganisationcible); } else { hideBtnSave(); } }); - $("#usercible").change(function () { + // $("#usercible").change(function () { + $("#usercible").on('change.select2', function () { let usercible = $(this).val(); - let organisationcible = $('#organisationcible').val(); + let duplicationOrganisationcible = $('#duplicationOrganisationcible').val(); $('#userservicecible option').remove(); - if (usercible && organisationcible) { + if (usercible && duplicationOrganisationcible) { updateListingServices( usercible, - organisationcible + duplicationOrganisationcible ); } else { hideBtnSave(); } }); - $("#userservicecible").change(function () { + $("#userservicecible").on('change.select2', function () { if ($(this).val()) { $('#btnSave').removeAttr('disabled'); } else { @@ -107,6 +111,11 @@ echo $this->element('modal', [ } }); + // $('#modalDupliquerTraitement').on('hidden.bs.modal', function () { + // $('#organisationcible').val(); + // hideAndRemoveField(); + // hideBtnSave(); + // }) }); function hideAndRemoveField() @@ -123,12 +132,12 @@ echo $this->element('modal', [ $('#btnSave').attr('disabled', true); } - function updateListingUser(organisationcible) + function updateListingUser(duplicationOrganisationcible) { $.ajax({ url: '<?php echo Router::url(['controller' => 'pannel', 'action' => 'ajax_listing_users_organisation']);?>', method: 'POST', - data: {'organisation_id': organisationcible}, + data: {'organisation_id': duplicationOrganisationcible}, success: function(dataResponse) { try { let organisations = JSON.parse(dataResponse); @@ -153,14 +162,14 @@ echo $this->element('modal', [ }); } - function updateListingServices(usercible, organisationcible) + function updateListingServices(usercible, duplicationOrganisationcible) { $.ajax({ url: '<?php echo Router::url(['controller' => 'pannel', 'action' => 'ajax_listing_services_user']);?>', method: 'POST', data: { 'user_id': usercible, - 'organisation_id': organisationcible, + 'organisation_id': duplicationOrganisationcible, }, success: function(dataResponse) { try { @@ -189,4 +198,4 @@ echo $this->element('modal', [ }); } -</script> +</script> \ No newline at end of file diff --git a/app/View/Users/edit.ctp b/app/View/Users/edit.ctp index 22ce60d7f10eead94a3787159dabc9c5eb08ca7b..bf1b81407fed5671e5b05b54cc1d46ba69f89126 100755 --- a/app/View/Users/edit.ctp +++ b/app/View/Users/edit.ctp @@ -277,27 +277,30 @@ echo $this->element('modalpassword'); <?php $selected = (array)Hash::get($this->request->data, 'User.organisation_id');?> <?php foreach(array_keys($options['organisation_id']) as $organisation_id): ?> - $("#<?php echo 'service_id'.$organisation_id;?>").select2({ - language: "fr", - placeholder: "Sélectionnez un ou plusieurs service", - allowClear: true - }); + $("#<?php echo 'service_id'.$organisation_id;?>").select2({ + language: "fr", + placeholder: "Sélectionnez un ou plusieurs service", + allowClear: true + }); - <?php if(false === in_array($organisation_id, $selected)):?> - $("#organisation-block-<?php echo $organisation_id;?>").hide(); - <?php endif;?> + <?php if(false === in_array($organisation_id, $selected)):?> + $("#organisation-block-<?php echo $organisation_id;?>").hide(); + $("#organisation-block-<?php echo $organisation_id;?>").attr('disabled', true); + <?php endif;?> <?php endforeach;?> $('#deroulant').change(function(event) { - var select = $(this), + let select = $(this), values = $.map($(select).children('option'),function(option){return option.value;}), selected = $(select).val(); $.each(values, function(index, value){ if(-1 !== $.inArray(value, selected)) { $("#organisation-block-"+value).show(); + $("#organisation-block-"+value).attr('disabled', false); } else { $("#organisation-block-"+value).hide(); + $("#organisation-block-"+value).attr('disabled', true); } }); }); diff --git a/docker-compose.yml b/docker-compose.yml index 4b8ca5e5b71f7f7b084119ee3bf481d1af3d2b4e..98fe7f43b3d0068d80f878a1dd32949bbfd152f8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -51,6 +51,7 @@ services: - ./VERSION.txt:/var/www/html/web-dpo/VERSION.txt - tmp-volume:/var/www/html/web-dpo/app/tmp - ./app/tmp/out:/var/www/html/web-dpo/app/tmp/out + - ./vendors:/var/www/html/web-dpo/vendors web-dpo-cloudooo: container_name: web-dpo-cloudooo