Data-Source Synonyme: ergänze "assembly" zu Datenquellen und Baumansichten

This commit is contained in:
Marcel Diegelmann 2025-10-15 16:10:59 +02:00
parent 498f8bc6e5
commit 51e7eea73d
4 changed files with 7 additions and 1 deletions

View file

@ -237,6 +237,7 @@ class TreeViewGenerator
Manufacturer::class => $this->getTranslatedOrSynonym('manufacturer', $locale), Manufacturer::class => $this->getTranslatedOrSynonym('manufacturer', $locale),
Supplier::class => $this->getTranslatedOrSynonym('supplier', $locale), Supplier::class => $this->getTranslatedOrSynonym('supplier', $locale),
Project::class => $this->getTranslatedOrSynonym('project', $locale), Project::class => $this->getTranslatedOrSynonym('project', $locale),
Assembly::class => $this->getTranslatedOrSynonym('assembly', $locale),
default => $this->translator->trans('tree.root_node.text'), default => $this->translator->trans('tree.root_node.text'),
}; };
} }

View file

@ -3,7 +3,9 @@
{# @var entity App\Entity\AssemblySystem\Assembly #} {# @var entity App\Entity\AssemblySystem\Assembly #}
{% block card_title %} {% block card_title %}
<i class="fas fa-archive fa-fw"></i> {% trans %}assembly.caption{% endtrans %} {% set dataSourceName = get_data_source_name('assembly', 'assembly.caption') %}
{% set translatedSource = 'assembly.caption'|trans %}
<i class="fas fa-archive fa-fw"></i> {% if dataSourceName != translatedSource %}{{ 'datasource.synonym'|trans({'%name%': translatedSource, '%synonym%': dataSourceName}) }}{% else %}{{ translatedSource }}{% endif %}
{% endblock %} {% endblock %}
{% block edit_title %} {% block edit_title %}

View file

@ -9,6 +9,7 @@
['manufacturers', path('tree_manufacturer_root'), 'manufacturer.labelp', is_granted('@manufacturers.read') and is_granted('@parts.read'), 'manufacturer'], ['manufacturers', path('tree_manufacturer_root'), 'manufacturer.labelp', is_granted('@manufacturers.read') and is_granted('@parts.read'), 'manufacturer'],
['suppliers', path('tree_supplier_root'), 'supplier.labelp', is_granted('@suppliers.read') and is_granted('@parts.read'), 'supplier'], ['suppliers', path('tree_supplier_root'), 'supplier.labelp', is_granted('@suppliers.read') and is_granted('@parts.read'), 'supplier'],
['projects', path('tree_device_root'), 'project.labelp', is_granted('@projects.read'), 'project'], ['projects', path('tree_device_root'), 'project.labelp', is_granted('@projects.read'), 'project'],
['assembly', path('tree_assembly_root'), 'assembly.labelp', is_granted('@assemblies.read'), 'assembly'],
['tools', path('tree_tools'), 'tools.label', true, 'tool'], ['tools', path('tree_tools'), 'tools.label', true, 'tool'],
] %} ] %}

View file

@ -19,6 +19,8 @@
{% set dataSource = 'supplier' %} {% set dataSource = 'supplier' %}
{% elseif (form.vars.label == 'perm.projects') %} {% elseif (form.vars.label == 'perm.projects') %}
{% set dataSource = 'project' %} {% set dataSource = 'project' %}
{% elseif (form.vars.label == 'perm.assemblies') %}
{% set dataSource = 'assembly' %}
{% endif %} {% endif %}
{% set dataSourceName = get_data_source_name(dataSource, form.vars.label) %} {% set dataSourceName = get_data_source_name(dataSource, form.vars.label) %}