mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
Improve user experience for creation of document categories with select field for document class
This commit is contained in:
parent
8cb2bb1ef4
commit
456d29e605
@ -17,15 +17,25 @@ use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Contracts\Translation\TranslatorInterface;
|
||||
|
||||
class DocumentCategoryType extends AbstractType
|
||||
{
|
||||
public function __construct(private readonly TranslatorInterface $translator)
|
||||
{
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$bundles = [
|
||||
'chill-doc-store' => 'chill-doc-store',
|
||||
];
|
||||
|
||||
$documentClasses = [
|
||||
$this->translator->trans('Accompanying period document') => "Chill\DocStoreBundle\Entity\AccompanyingCourseDocument",
|
||||
$this->translator->trans('Person document') => "Chill\DocStoreBundle\Entity\PersonDocument",
|
||||
];
|
||||
|
||||
$builder
|
||||
->add('bundleId', ChoiceType::class, [
|
||||
'choices' => $bundles,
|
||||
@ -34,7 +44,10 @@ class DocumentCategoryType extends AbstractType
|
||||
->add('idInsideBundle', null, [
|
||||
'disabled' => true,
|
||||
])
|
||||
->add('documentClass', null, [
|
||||
->add('documentClass', ChoiceType::class, [
|
||||
'choices' => $documentClasses,
|
||||
'expanded' => false,
|
||||
'required' => true,
|
||||
'disabled' => false,
|
||||
])
|
||||
->add('name', TranslatableStringFormType::class);
|
||||
|
@ -8,7 +8,7 @@
|
||||
<table class="table table-bordered border-dark align-middle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{{ 'Creator bundle id' | trans }}</th>
|
||||
{# <th>{{ 'Creator bundle id' | trans }}</th>#}
|
||||
<th>{{ 'Internal id inside creator bundle' | trans }}</th>
|
||||
<th>{{ 'Document class' | trans }}</th>
|
||||
<th>{{ 'Name' | trans }}</th>
|
||||
@ -18,7 +18,7 @@
|
||||
<tbody>
|
||||
{% for document_category in document_categories %}
|
||||
<tr>
|
||||
<td>{{ document_category.bundleId }}</td>
|
||||
{# <td>{{ document_category.bundleId }}</td>#}
|
||||
<td>{{ document_category.idInsideBundle }}</td>
|
||||
<td>{{ document_category.documentClass }}</td>
|
||||
<td>{{ document_category.name | localize_translatable_string}}</td>
|
||||
|
@ -74,6 +74,8 @@ no records found:
|
||||
Create new category: Créer une nouvelle catégorie
|
||||
Back to the category list: Retour à la liste
|
||||
Create new DocumentCategory: Créer une nouvelle catégorie de document
|
||||
Accompanying period document: Document de parcours d'accompagnement
|
||||
Person document: Document de personne
|
||||
|
||||
# WOPI EDIT
|
||||
online_edit_document: Éditer en ligne
|
||||
|
Loading…
x
Reference in New Issue
Block a user