link customer, project and activity in invoice listing (#3428)

This commit is contained in:
Kevin Papst
2022-07-22 13:26:17 +02:00
committed by GitHub
parent ad880b5b97
commit 8d695d03df
5 changed files with 22 additions and 6 deletions

View File

@@ -76,3 +76,7 @@ table.dataTable thead > tr > th.hw-min {
.label { .label {
font-weight: normal; font-weight: normal;
} }
a.link-black {
color: #000;
}

File diff suppressed because one or more lines are too long

View File

@@ -6,7 +6,7 @@
"build/app.429626c8.js" "build/app.429626c8.js"
], ],
"css": [ "css": [
"build/app.7d391c0d.css" "build/app.dd7cccf4.css"
] ]
}, },
"invoice": { "invoice": {

View File

@@ -1,5 +1,5 @@
{ {
"build/app.css": "build/app.7d391c0d.css", "build/app.css": "build/app.dd7cccf4.css",
"build/app.js": "build/app.429626c8.js", "build/app.js": "build/app.429626c8.js",
"build/invoice.css": "build/invoice.ccdecd42.css", "build/invoice.css": "build/invoice.ccdecd42.css",
"build/invoice.js": "build/invoice.19f36eca.js", "build/invoice.js": "build/invoice.19f36eca.js",

View File

@@ -120,7 +120,11 @@
{% set currency = model.currency %} {% set currency = model.currency %}
<tr> <tr>
<td> <td>
{% if is_granted('view', model.customer) %}
<a class="link-black" href="{{ path('customer_details', {id: model.customer.id}) }}">{{ widgets.label_customer(model.customer) }}</a>
{% else %}
{{ widgets.label_customer(model.customer) }} {{ widgets.label_customer(model.customer) }}
{% endif %}
</td> </td>
<td class="w-min text-center"> <td class="w-min text-center">
{{ widgets.action_button('print', {'url': '#', 'onclick': 'return singleInvoice(this)', 'title': 'button.preview'|trans, 'target': '_blank', 'class': 'btn btn-sm', 'attr': {'data-customer': model.customer.id, 'data-template': model.template.id, 'data-href': path('invoice_preview', {'customer': model.customer.id, 'token': csrf_token('invoice.preview')})}}) }} {{ widgets.action_button('print', {'url': '#', 'onclick': 'return singleInvoice(this)', 'title': 'button.preview'|trans, 'target': '_blank', 'class': 'btn btn-sm', 'attr': {'data-customer': model.customer.id, 'data-template': model.template.id, 'data-href': path('invoice_preview', {'customer': model.customer.id, 'token': csrf_token('invoice.preview')})}}) }}
@@ -174,11 +178,19 @@
<tr> <tr>
<td class="{{ tables.data_table_column_class(tableName, columns, 'date') }}">{{ entry.begin|date_short }}</td> <td class="{{ tables.data_table_column_class(tableName, columns, 'date') }}">{{ entry.begin|date_short }}</td>
<td class="{{ tables.data_table_column_class(tableName, columns, 'project') }}"> <td class="{{ tables.data_table_column_class(tableName, columns, 'project') }}">
{% if is_granted('view', entry.project) %}
<a class="link-black" href="{{ path('project_details', {id: entry.project.id}) }}">{{ widgets.label_project(entry.project) }}</a>
{% else %}
{{ widgets.label_project(entry.project) }} {{ widgets.label_project(entry.project) }}
{% endif %}
{% if entry.activity is not null %} {% if entry.activity is not null %}
<br> <br>
<small> <small>
{% if is_granted('view', entry.activity) %}
<a class="link-black" href="{{ path('activity_details', {id: entry.activity.id}) }}">{{ widgets.label_activity(entry.activity) }}</a>
{% else %}
{{ widgets.label_activity(entry.activity) }} {{ widgets.label_activity(entry.activity) }}
{% endif %}
</small> </small>
{% endif %} {% endif %}
</td> </td>