Skip to content

Commit

Permalink
[TASK] Show correct message when wrong page
Browse files Browse the repository at this point in the history
Adapt the message when the module is used on a
page without order items. Furhtermore show a
correct message when the filtered search results
in zero results.

Solves #471
  • Loading branch information
rintisch committed Apr 19, 2024
1 parent 7214200 commit 70c1177
Show file tree
Hide file tree
Showing 3 changed files with 126 additions and 70 deletions.
26 changes: 26 additions & 0 deletions Documentation/Changelog/9.0/Breaking-471-CleanUpLanguageFiles.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
.. include:: ../../Includes.txt

===========================================================
Breaking: #471 - Clean up language files
===========================================================

See :issue:`471`

Description
===========

The language files contained a bigger amount of unused entries and their domains
were not really clear. Some entries were renamed to clarify their usage in the
backend.

Affected Installations
======================

Installations which overwrite backend labels might be affected.

Migration
=========

You need to check whether the key of your overwrite was changed and adapt it.

.. index:: Backend
9 changes: 9 additions & 0 deletions Resources/Private/Language/locallang.xlf
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,15 @@
<trans-unit id="tx_cart.backend.filter.end_date">
<source>End Date</source>
</trans-unit>
<trans-unit id="tx_cart.backend.filter.no_results">
<source>No results for this filter</source>
</trans-unit>
<trans-unit id="tx_cart.backend.page_without_datasets.title">
<source>This page does not contain any order items.</source>
</trans-unit>
<trans-unit id="tx_cart.backend.page_without_datasets.instruction">
<source>Please select a page where order items are stored.</source>
</trans-unit>

</body>
</file>
Expand Down
161 changes: 91 additions & 70 deletions Resources/Private/Templates/Backend/Order/Order/List.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,78 +7,99 @@

<f:section name="Content">
<div class="cart-list">
<f:render partial="Backend/Order/Filter/List"
arguments="{searchArguments: searchArguments, action: 'list', paymentStatus: paymentStatus, shippingStatus: shippingStatus}"/>
<f:if condition="!{orderItems} && !{searchArguments}">
<f:then>
<f:comment>
Do not show the filter if the page has no `orderItems` and no ``searchArguments`.
The searchArguments are needed as condition as otherwise the filters will not be shown when the
search results in zero order items.
</f:comment>
</f:then>
<f:else>
<f:render partial="Backend/Order/Filter/List"
arguments="{searchArguments: searchArguments, action: 'list', paymentStatus: paymentStatus, shippingStatus: shippingStatus}"/>
</f:else>
</f:if>

<div class="clear"></div>

<f:if condition="{orderItems}">
<f:then>
<div class="table-fit">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>
<f:translate key="tx_cart.backend.order.address.first_name"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.address.last_name"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.address.company"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.order_number"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.order_date"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.invoice_number"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.invoice_date"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.total_gross"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.total_net"/>
</th>
<th>
<f:translate key="tx_cart_domain_model_order_payment"/>
<br/>(
<f:translate key="tx_cart_domain_model_order_payment.status"/>
)
</th>
<th>
<f:translate key="tx_cart_domain_model_order_shipping"/>
<br/>(
<f:translate key="tx_cart_domain_model_order_shipping.status"/>
)
</th>
<th>
&nbsp;
</th>
</tr>
</thead>
<tbody>
<f:for each="{paginator.paginatedItems}" as="orderItem">
<f:cycle values="{0: 'even', 1: 'odd'}" as="cycle">
<f:render partial="Backend/Order/List/Item"
arguments="{orderItem: orderItem, cycle:cycle, arguments: arguments, pdfRendererInstalled: pdfRendererInstalled}"/>
</f:cycle>
</f:for>
</tbody>
</table>
</div>
<f:render partial="Utility/Paginator"
arguments="{pagination: pagination, pages: pages, paginator: paginator}"/>
</f:then>
<f:else>
Select a Page where Order Item Dataset are saved.
</f:else>
</f:if>
<div class="clear"></div>

<f:if condition="{orderItems}">
<f:then>
<div class="table-fit">
<table class="table table-striped table-hover">
<thead>
<tr>
<th>
<f:translate key="tx_cart.backend.order.address.first_name"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.address.last_name"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.address.company"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.order_number"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.order_date"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.invoice_number"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.invoice_date"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.total_gross"/>
</th>
<th>
<f:translate key="tx_cart.backend.order.total_net"/>
</th>
<th>
<f:translate key="tx_cart_domain_model_order_payment"/>
<br/>(
<f:translate key="tx_cart_domain_model_order_payment.status"/>
)
</th>
<th>
<f:translate key="tx_cart_domain_model_order_shipping"/>
<br/>(
<f:translate key="tx_cart_domain_model_order_shipping.status"/>
)
</th>
<th>
&nbsp;
</th>
</tr>
</thead>
<tbody>
<f:for each="{paginator.paginatedItems}" as="orderItem">
<f:cycle values="{0: 'even', 1: 'odd'}" as="cycle">
<f:render partial="Backend/Order/List/Item"
arguments="{orderItem: orderItem, cycle:cycle, arguments: arguments, pdfRendererInstalled: pdfRendererInstalled}"/>
</f:cycle>
</f:for>
</tbody>
</table>
</div>
<f:render partial="Utility/Paginator"
arguments="{pagination: pagination, pages: pages, paginator: paginator}"/>
</f:then>
<f:else>
<f:if condition="{searchArguments}">
<f:then>
<f:translate key="tx_cart.backend.filter.no_results"/>
</f:then>
<f:else>
<h2><f:translate key="tx_cart.backend.page_without_datasets.title"/></h2>
<h4><f:translate key="tx_cart.backend.page_without_datasets.instruction"/></h4>
</f:else>
</f:if>

</f:else>
</f:if>
</div>
</f:section>
</html>

0 comments on commit 70c1177

Please sign in to comment.