diff --git a/assets/js/element-form/initialisation.js b/assets/js/element-form/initialisation.js index da8f8cdf0ff890b575107d01262e5c6aeffa9e86..bceefe1bf13d4ac49cdc4db45bb32038874d571e 100755 --- a/assets/js/element-form/initialisation.js +++ b/assets/js/element-form/initialisation.js @@ -41,6 +41,12 @@ jQuery(document).ready(function() initializeToHtml() + // Checkboxes, use custom checked value + $('input[type=checkbox]').change(function() { + if ($(this).val() == 'on' && $(this).data('checked-value') != 'on') + $(this).val($(this).data('checked-value')) + }) + // TIMEPICKERS $('.timepicker').each(function(e) { var start_time; diff --git a/config/parameters.yaml b/config/parameters.yaml index 66cda5dbb6c9df68a6bba5e2f3a41bc2e634b848..4d3659b99fc0b419136cbdf7bdb4623e4563ebf3 100755 --- a/config/parameters.yaml +++ b/config/parameters.yaml @@ -1,7 +1,7 @@ # Put parameters here that don't need to change on each machine where the app is deployed # https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration parameters: - app.version: 3.2.7 + app.version: 3.2.8 locale: fr router.request_context.host: '%env(string:BASE_URL)%' from_email: "%env(FROM_EMAIL)%" diff --git a/templates/admin/core_custom/custom-fields/form-builder.html.twig b/templates/admin/core_custom/custom-fields/form-builder.html.twig index 35bc5f2e98e8baf56c4d3f2680e9137bb807e2d2..eec636c48ad75fe2732fdb45800d77db5d0cd729 100755 --- a/templates/admin/core_custom/custom-fields/form-builder.html.twig +++ b/templates/admin/core_custom/custom-fields/form-builder.html.twig @@ -109,6 +109,7 @@ label: t('js.form_builder.defaultvalue'), options: { 'no': t('js.form_builder.options.no'), 'yes': t('js.form_builder.options.yes') } }, + checked_value: { label: t("js.form_builder.checked_value"), value: "on"}, errorMsg: errorMsgAttrs }, email: { diff --git a/templates/element-form/form-partials/checkbox.html.twig b/templates/element-form/form-partials/checkbox.html.twig index 654287c11b84ff8503c527e2bb4517d866922217..1d09fa90bfcf3b65ac3303761a7f27ca42aaf8fe 100755 --- a/templates/element-form/form-partials/checkbox.html.twig +++ b/templates/element-form/form-partials/checkbox.html.twig @@ -1,6 +1,7 @@ <div class="checkbox-container"> <input type="checkbox" name="data[{{ field.name }}]" id="{{ field.name }}" {% if field.required|default(false) %}class="required"{% endif %} + data-checked-value="{{ field.checked_value }}" {% if elementValue or not elementValue and field.defaultvalue == "yes" %}checked="checked"{% endif %}/> <label for="{{ field.name }}" class="to-html">{{ field.label|raw }}</label> </div> \ No newline at end of file diff --git a/translations/admin+intl-icu.fr.yaml b/translations/admin+intl-icu.fr.yaml index d826dc80177d08f67d84b923b7e42d29a531b15b..ede704f16941f892a5335b3a4591b3287cdf72c5 100755 --- a/translations/admin+intl-icu.fr.yaml +++ b/translations/admin+intl-icu.fr.yaml @@ -1280,6 +1280,7 @@ js: # Below keys are available to javascript icon_placeholder: "Choisissez une icône" remove_icon: "Supprimer" copy_icon: "Dupliquer" + checked_value: Valeur du champ si coché edit_icon: "Editer/Masquer" label: "Libellé" errorMsg: "Msg. Erreur"