diff --git a/src/Admin/CategoryAdmin.php b/src/Admin/CategoryAdmin.php index 704c1d4e9b1d37713e76947a79f12b13ecda0c2c..dffadedc5580dd165377a8a522a856f1881e87da 100755 --- a/src/Admin/CategoryAdmin.php +++ b/src/Admin/CategoryAdmin.php @@ -64,6 +64,7 @@ class CategoryAdmin extends GoGoAbstractAdmin ->end() ->halfPanel('secondary') ->add('nameShort') + ->add('customId') ->add('index') ->add('showExpanded') ->add('unexpandable') diff --git a/src/Document/Category.php b/src/Document/Category.php index db8a78f4ac010f76ed146b25de39992f2cb77cc6..bdca8be71228b26ab4f0a00aafa2c5f8de52e458 100755 --- a/src/Document/Category.php +++ b/src/Document/Category.php @@ -16,7 +16,6 @@ class Category { /** * @var int - * @Exclude * @MongoDB\Id(strategy="INCREMENT") */ private $id; @@ -235,6 +234,11 @@ class Category return $this; } + public function getCustomStringId() + { + return $this->customId ?: strval($this->id); + } + /** * Set name. * diff --git a/templates/admin/list/tree_category_item.html.twig b/templates/admin/list/tree_category_item.html.twig index c7749c018c2a9a2fb8251c0c8ac385d208c75bc1..fbc05ca5fd21a47edc3f80ee57ea1ac250981f65 100755 --- a/templates/admin/list/tree_category_item.html.twig +++ b/templates/admin/list/tree_category_item.html.twig @@ -4,6 +4,7 @@ <span class="category-item {{ category.options|length and not category.unexpandable ? 'expandable':'unexpandable' }}" {% if not category.displayInForm or not category.displayInMenu %}style="opacity: 0.5"{% endif %}> <span class="name">(Groupe) {{ category.name|capitalize }}</span> + <span style="opacity: .6;margin-right: 10px;">( {{ category.customStringId }} )</span> {% if not category.displayInForm or not category.displayInMenu %}<span class="fa fa-eye-slash"></span>{% endif %} {% if category.options|length and not category.unexpandable %}<span class="arrow-after"></span>{% endif %} {% if category.isMandatory %}<span class="label label-warning">Obligatoire</span>{% endif %} diff --git a/templates/element-form/form-partials/taxonomy-field.html.twig b/templates/element-form/form-partials/taxonomy-field.html.twig index 6a1cc4ce0041a70dd514e70d75c96d8fcbf7e37a..4d85ab7b917fd4cad247d4254d22af511c8cdf92 100755 --- a/templates/element-form/form-partials/taxonomy-field.html.twig +++ b/templates/element-form/form-partials/taxonomy-field.html.twig @@ -30,7 +30,7 @@ <option value="{{option.id}}" data-custom-id="{{option.customId}}"> {{ option.name }} {% if (option.textHelper is defined and option.textHelper) %} ({{ option.textHelper }}) {% endif %} </option> - {% endif %} + {% endif %} {% endfor %} </select> </span> diff --git a/translations/admin+intl-icu.fr.yaml b/translations/admin+intl-icu.fr.yaml index a1fcb5befda2f724ab434dc751e07d2f46739adf..92ee1edefe48a25dea59d31554efa6a6fbf9bbb6 100755 --- a/translations/admin+intl-icu.fr.yaml +++ b/translations/admin+intl-icu.fr.yaml @@ -701,6 +701,7 @@ categories: nameShort: "Nom (version courte)" nameShort_help: "La version courte est utilisée dans le menu, car souvent on manque de place" index: "Position" + customId: "Id personnalisé" showExpanded: "En position intiale afficher les catégories (sinon il faudra cliquer pour les afficher)" unexpandable: "Ne pas pouvoir reduire ce groupe de catégories" unexpandable_help: "Dans le menu, les catégories de ce groupe seront toujours affichées"