support more columns in listings (#1548)
This commit is contained in:
@@ -134,7 +134,6 @@ class AvatarService
|
||||
}
|
||||
$avatar = new Avatar(self::AVATAR_CONFIG);
|
||||
$avatar->create($profile->getDisplayName())->save($filePath, 90);
|
||||
$avatar->create($profile->getDisplayName())->save($filePath, 90);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@@ -4,10 +4,9 @@
|
||||
{% import "macros/toolbar.html.twig" as toolbar %}
|
||||
{% import "activity/actions.html.twig" as actions %}
|
||||
|
||||
{% set showVisibility = query.visibility != 1 %}
|
||||
{% set columns = {
|
||||
'name': 'alwaysVisible',
|
||||
'project': 'hidden-xs',
|
||||
'name': {'class': 'alwaysVisible'},
|
||||
'project': {'class': 'hidden-xs'},
|
||||
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
||||
} %}
|
||||
{% for field in metaColumns %}
|
||||
@@ -15,13 +14,9 @@
|
||||
('mf_' ~ field.name): {'title': field.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
|
||||
}) %}
|
||||
{% endfor %}
|
||||
{% if showVisibility %}
|
||||
{% set columns = columns|merge({
|
||||
'visible': {'class': 'text-center', 'orderBy': false},
|
||||
}) %}
|
||||
{% endif %}
|
||||
{% set columns = columns|merge({
|
||||
'actions': 'actions alwaysVisible',
|
||||
'visible': {'class': 'text-center hidden', 'orderBy': false},
|
||||
'actions': {'class': 'actions alwaysVisible'},
|
||||
}) %}
|
||||
|
||||
{% set tableName = 'activity_admin' %}
|
||||
@@ -43,7 +38,7 @@
|
||||
|
||||
{% for entry in entries %}
|
||||
<tr{% if is_granted('view', entry) %} class="alternative-link open-edit" data-href="{{ path('activity_details', {'id': entry.id}) }}"{% endif %}>
|
||||
<td>{{ widgets.label_color_dot('activity', true, entry.name, null, entry.color) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'name') }}">{{ widgets.label_color_dot('activity', true, entry.name, null, entry.color) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'project') }}">
|
||||
{# only none-global activities have a project and customer assigned #}
|
||||
{% if entry.project %}
|
||||
@@ -62,12 +57,8 @@
|
||||
{{ tables.datatable_meta_column(entry, field) }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
{% if showVisibility %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
|
||||
{% endif %}
|
||||
<td class="actions">
|
||||
{{ actions.activity(entry, 'index') }}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'actions') }}">{{ actions.activity(entry, 'index') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@@ -4,10 +4,21 @@
|
||||
{% import "macros/toolbar.html.twig" as toolbar %}
|
||||
{% import "customer/actions.html.twig" as actions %}
|
||||
|
||||
{% set showVisibility = query.visibility != 1 %}
|
||||
{% set columns = {
|
||||
'name': 'alwaysVisible',
|
||||
'name': {'class': 'alwaysVisible'},
|
||||
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
||||
'number': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'company': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'vat_id': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'contact': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'address': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'country': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'currency': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'phone': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'fax': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'mobile': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'email': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'homepage': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
} %}
|
||||
{% for field in metaColumns %}
|
||||
{% set columns = columns|merge({
|
||||
@@ -16,14 +27,8 @@
|
||||
{% endfor %}
|
||||
{% set columns = columns|merge({
|
||||
'team': {'class': 'text-center', 'orderBy': false},
|
||||
}) %}
|
||||
{% if showVisibility %}
|
||||
{% set columns = columns|merge({
|
||||
'visible': {'class': 'text-center', 'orderBy': false},
|
||||
}) %}
|
||||
{% endif %}
|
||||
{% set columns = columns|merge({
|
||||
'actions': 'actions alwaysVisible',
|
||||
'visible': {'class': 'text-center hidden', 'orderBy': false},
|
||||
'actions': {'class': 'actions alwaysVisible'},
|
||||
}) %}
|
||||
|
||||
{% set tableName = 'customer_admin' %}
|
||||
@@ -45,30 +50,28 @@
|
||||
|
||||
{% for entry in entries %}
|
||||
<tr{% if is_granted('view', entry) %} class="alternative-link open-edit" data-href="{{ path('customer_details', {'id': entry.id}) }}"{% endif %}>
|
||||
<td>
|
||||
{{ widgets.label_color_dot('customer', true, entry.name, null, entry.color) }}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">
|
||||
{{ entry.comment|comment2html }}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'name') }}">{{ widgets.label_color_dot('customer', true, entry.name, null, entry.color) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment2html }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'number') }}">{{ entry.number }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'company') }}">{{ entry.company }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'vat_id') }}">{{ entry.vatId }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'contact') }}">{{ entry.contact }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'address') }}">{{ entry.address }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'country') }}">{{ entry.country|country }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'currency') }}">{{ entry.currency|currency }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'phone') }}">{{ entry.phone }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'fax') }}">{{ entry.fax }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'mobile') }}">{{ entry.mobile }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'email') }}">{{ entry.email }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'homepage') }}">{{ entry.homepage }}</td>
|
||||
{% for field in metaColumns %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
|
||||
{{ tables.datatable_meta_column(entry, field) }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">
|
||||
{% if entry.teams|length > 0 %}
|
||||
{{ widgets.badge_counter(entry.teams|length) }}
|
||||
{% else %}
|
||||
{{ widgets.icon('unlocked') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if showVisibility %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
|
||||
{% endif %}
|
||||
<td class="actions">
|
||||
{{ actions.customer(entry, 'index') }}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">{{ widgets.badge_team_access(entry.teams) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'actions') }}">{{ actions.customer(entry, 'index') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@@ -136,6 +136,15 @@
|
||||
</span>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro badge_team_access(teams) %}
|
||||
{% import _self as macro %}
|
||||
{% if teams|length > 0 %}
|
||||
{{ macro.badge_counter(teams|length) }}
|
||||
{% else %}
|
||||
{{ macro.icon('unlocked') }}
|
||||
{% endif %}
|
||||
{% endmacro %}
|
||||
|
||||
{% macro badge_counter(count, url) %}
|
||||
{% if url %}
|
||||
<a href="{{ url }}"><span class="badge bg-blue">{{ count }}</span></a>
|
||||
|
||||
@@ -4,11 +4,14 @@
|
||||
{% import "macros/toolbar.html.twig" as toolbar %}
|
||||
{% import "project/actions.html.twig" as actions %}
|
||||
|
||||
{% set showVisibility = query.visibility != 1 %}
|
||||
{% set columns = {
|
||||
'name': 'alwaysVisible',
|
||||
'customer': 'hidden-xs',
|
||||
'name': {'class': 'alwaysVisible'},
|
||||
'customer': {'class': 'hidden-xs'},
|
||||
'comment': {'class': 'hidden-xs hidden-sm', 'title': 'label.description'|trans},
|
||||
'orderNumber': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'orderDate': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'start': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.project_start'|trans, 'orderBy': false},
|
||||
'end': {'class': 'hidden-xs hidden-sm hidden', 'title': 'label.project_end'|trans, 'orderBy': false},
|
||||
} %}
|
||||
{% for field in metaColumns %}
|
||||
{% set columns = columns|merge({
|
||||
@@ -17,14 +20,8 @@
|
||||
{% endfor %}
|
||||
{% set columns = columns|merge({
|
||||
'team': {'class': 'text-center', 'orderBy': false},
|
||||
}) %}
|
||||
{% if showVisibility %}
|
||||
{% set columns = columns|merge({
|
||||
'visible': {'class': 'text-center', 'orderBy': false},
|
||||
}) %}
|
||||
{% endif %}
|
||||
{% set columns = columns|merge({
|
||||
'actions': 'actions alwaysVisible',
|
||||
'visible': {'class': 'text-center hidden', 'orderBy': false},
|
||||
'actions': {'class': 'actions alwaysVisible'},
|
||||
}) %}
|
||||
|
||||
{% set tableName = 'project_admin' %}
|
||||
@@ -46,29 +43,21 @@
|
||||
|
||||
{% for entry in entries %}
|
||||
<tr{% if is_granted('view', entry) %} class="alternative-link open-edit" data-href="{{ path('project_details', {'id': entry.id}) }}"{% endif %}>
|
||||
<td>{{ widgets.label_color_dot('project', true, entry.name, null, entry.color) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'customer') }}">
|
||||
{{ widgets.label_customer(entry.customer) }}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'name') }}">{{ widgets.label_color_dot('project', true, entry.name, null, entry.color) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'customer') }}">{{ widgets.label_customer(entry.customer) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'comment') }}">{{ entry.comment|comment2html() }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'orderNumber') }}">{{ entry.orderNumber }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'orderDate') }}">{% if entry.orderDate is not null %}{{ entry.orderDate|date_full }}{% endif %}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'start') }}">{% if entry.start is not null %}{{ entry.start|date_full }}{% endif %}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'end') }}">{% if entry.end is not null %}{{ entry.end|date_full }}{% endif %}</td>
|
||||
{% for field in metaColumns %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'mf_' ~ field.name) }}">
|
||||
{{ tables.datatable_meta_column(entry, field) }}
|
||||
</td>
|
||||
{% endfor %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">
|
||||
{% if entry.teams|length > 0 %}
|
||||
{{ widgets.badge_counter(entry.teams|length) }}
|
||||
{% else %}
|
||||
{{ widgets.icon('unlocked') }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if showVisibility %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
|
||||
{% endif %}
|
||||
<td class="actions">
|
||||
{{ actions.project(entry, 'index') }}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'team') }}">{{ widgets.badge_team_access(entry.teams) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'visible') }}">{{ widgets.label_visible(entry.visible) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'actions') }}">{{ actions.project(entry, 'index') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@@ -26,10 +26,10 @@
|
||||
{% set columns = columns|merge({'rate': ''}) %}
|
||||
{% endif %}
|
||||
{% set columns = columns|merge({
|
||||
'customer': 'hidden-xs hidden-sm hidden-md',
|
||||
'project': 'hidden-xs hidden-sm hidden-md',
|
||||
'activity': 'hidden-xs hidden-sm',
|
||||
'description': 'hidden-xs hidden-sm',
|
||||
'customer': {'class': 'hidden-xs hidden-sm hidden-md'},
|
||||
'project': {'class': 'hidden-xs hidden-sm hidden-md'},
|
||||
'activity': {'class': 'hidden-xs hidden-sm'},
|
||||
'description': {'class': 'hidden-xs hidden-sm'},
|
||||
}) %}
|
||||
{% if canSeeUsername %}
|
||||
{% set columns = columns|merge({
|
||||
@@ -45,7 +45,7 @@
|
||||
}) %}
|
||||
{% endfor %}
|
||||
{% set columns = columns|merge({
|
||||
'actions': 'actions alwaysVisible',
|
||||
'actions': {'class': 'actions alwaysVisible'},
|
||||
}) %}
|
||||
|
||||
{% block page_search %}{{ toolbar.dropDownSearch(toolbarForm) }}{% endblock %}
|
||||
|
||||
@@ -4,14 +4,13 @@
|
||||
{% import "macros/toolbar.html.twig" as toolbar %}
|
||||
{% import "user/actions.html.twig" as actions %}
|
||||
|
||||
{% set showVisibility = query.visibility != 1 %}
|
||||
{% set columns = {
|
||||
'alias': 'alwaysVisible',
|
||||
'title': 'hidden-xs hidden-sm',
|
||||
'alias': {'class': 'alwaysVisible'},
|
||||
'title': {'class': 'hidden-xs hidden-sm'},
|
||||
'email': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'lastLogin': {'class': 'hidden-xs hidden-sm hidden', 'orderBy': false},
|
||||
'roles': {'class': 'hidden-sm', 'orderBy': false},
|
||||
} %}
|
||||
{% set columns = columns|merge({
|
||||
'roles': {'class': 'hidden-xs hidden-sm', 'orderBy': false},
|
||||
}) %}
|
||||
{% for pref in preferences %}
|
||||
{% set columns = columns|merge({
|
||||
('mf_' ~ pref.name): {'title': pref.label|trans, 'class': 'hidden-xs hidden-sm', 'orderBy': false}
|
||||
@@ -19,14 +18,8 @@
|
||||
{% endfor %}
|
||||
{% set columns = columns|merge({
|
||||
'team': {'class': 'text-center hidden-xs', 'orderBy': false},
|
||||
}) %}
|
||||
{% if showVisibility %}
|
||||
{% set columns = columns|merge({
|
||||
'active': {'class': '', 'orderBy': false},
|
||||
}) %}
|
||||
{% endif %}
|
||||
{% set columns = columns|merge({
|
||||
'actions': 'actions alwaysVisible',
|
||||
'active': {'class': 'hidden-xs hidden', 'orderBy': false},
|
||||
'actions': {'class': 'actions alwaysVisible'},
|
||||
}) %}
|
||||
|
||||
{% set tableName = 'user_admin' %}
|
||||
@@ -48,8 +41,10 @@
|
||||
|
||||
{% for entry in entries %}
|
||||
<tr{% if is_granted('view', entry) %} class="open-edit alternative-link" data-href="{{ path('user_profile', {'username': entry.username}) }}"{% endif %}>
|
||||
<td>{{ widgets.user_avatar(entry) }} {{ widgets.username(entry) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'alias') }}">{{ widgets.user_avatar(entry) }} {{ widgets.username(entry) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'title') }}">{{ entry.title }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'email') }}">{{ entry.email }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'lastLogin') }}">{% if entry.lastLogin is not null %}{{ entry.lastLogin|date_full }}{% endif %}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'roles') }}">
|
||||
{% set showUserRole = entry.roles|length == 1 %}
|
||||
{% for role in entry.roles %}
|
||||
@@ -71,12 +66,8 @@
|
||||
{{ widgets.badge_counter(entry.teams|length) }}
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if showVisibility %}
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'active') }}">{{ widgets.label_visible(entry.enabled) }}</td>
|
||||
{% endif %}
|
||||
<td class="actions">
|
||||
{{ actions.user(entry, 'index') }}
|
||||
</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'active') }}">{{ widgets.label_visible(entry.enabled) }}</td>
|
||||
<td class="{{ tables.data_table_column_class(tableName, columns, 'actions') }}">{{ actions.user(entry, 'index') }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
|
||||
|
||||
@@ -492,6 +492,10 @@
|
||||
<source>label.login.initial_view</source>
|
||||
<target>Initiale Ansicht nach Anmeldung</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.lastLogin">
|
||||
<source>label.lastLogin</source>
|
||||
<target>Letzte Anmeldung</target>
|
||||
</trans-unit>
|
||||
<!-- Options for user-preference label.calendar.initial_view -->
|
||||
<trans-unit id="month">
|
||||
<source>month</source>
|
||||
|
||||
@@ -492,6 +492,10 @@
|
||||
<source>label.login.initial_view</source>
|
||||
<target>Initial view after login</target>
|
||||
</trans-unit>
|
||||
<trans-unit id="label.lastLogin">
|
||||
<source>label.lastLogin</source>
|
||||
<target>Last login</target>
|
||||
</trans-unit>
|
||||
<!-- Options for user-preference label.calendar.initial_view -->
|
||||
<trans-unit id="month">
|
||||
<source>month</source>
|
||||
|
||||
Reference in New Issue
Block a user