From 8faa2a7843bed2a357fa9d3d4f87bd2dbba86946 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Wed, 23 May 2018 17:59:28 +0000 Subject: [PATCH] Bug 20807: Lost items report: Improve the display of CSV profile errors This patch modifies the template for the lost items report to change the way it handles a missing CSV profile. Now, if there is a missing CSV profile, a message is displayed with details about the profile requirements. If the logged-in user has the right permission there is a link to the CSV profiles page. Since item selection is used only in conjunction with exporting results, item selection controls are all hidden when there is no valid CSV profile. To test, apply the patch go to Reports -> Lost items. - Run the report with parameters which will return results. - If your system has no CSV profile for exporting lost items: - If you are logged in as a user with manage_csv_profiles permission: - You should see a message dialog instructing you to create a CSV profile with a link to the CSV profiles page. - If you are not logged in as a user with manage_csv_profiles permission: - You should see a similar message but without a link to the CSV profiles page. - In both cases, with no CSV profile defined there should be no checkboxes in the table of results and no "select all/clear all" controls. - If your system has a valid CSV profile for exporting lost items: - Checking the checkbox for one or more items in the table should trigger the display of an "Export selected items" link. --- .../prog/en/modules/reports/itemslost.tt | 50 ++++++++++++++-------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt index 596e99d..a8cb2ba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt @@ -36,29 +36,41 @@ [% IF items.count %] -
+ [% IF csv_profiles.count %] +
| Select all | Clear all - | Actions: - [% IF csv_profiles.count %] - Export selected items - Using the following CSV profile: - - [% ELSE %] - Export selected items - [% END %] + | Actions: + Export selected items + Using the following CSV profile: + -
+
+ [% ELSE %] +
+ [% IF ( CAN_user_tools_manage_csv_profiles ) %] + To enable the export of selected items, create a CSV profile of the type "SQL" with usage option "Export lost items in report." + [% ELSE %] + To enable the export of selected items, your administrator must create a CSV profile of the type "SQL" with usage option "Export lost items in report." + [% END %] +
+
+
+ [% END %] - + [% IF csv_profiles.count %] + + [% END %] @@ -79,9 +91,11 @@ [% FOREACH item IN items %] - + [% IF csv_profiles.count %] + + [% END %] -- 2.1.4
Title Author Lost status
- - + + [% item.biblio.title |html %]