From 1f6597752632dd97ad5a283b9dd8426f559d615a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 31 Dec 2015 10:54:55 -0500 Subject: [PATCH] Bug 16000 - Duplicate a report from the New Reports button This patch creates a combined edit/duplicate/delete toolbar menu option similar to the one on the bibliographic detail page. Also added is the "Schedule" link which was previously only available from the main list of saved reports. Also added is some deletion confirmation JavaScript for deletions initiated from the toolbar. To test, apply the patch and go to Reports -> Saved reports. - Click "Show" in the menu for any saved report. The toolbar which appears on this page should show the new menu items. - Confirm the behavior of all the buttons. - As you check the behavior of the button actions, check that the toolbar is shown and hidden appropriately for each action. - Confirm that the toolbar is correctly shown or hidden when building a guided report. - Confirm that the "Schedule" button is shown or hidden according to the logged-in user's "schedule_tasks" permission. - Confirm that clicking the "Delete" menu option triggers a JS confirmation. Signed-off-by: Nicole C Engard Signed-off-by: Christopher Brannon --- .../prog/en/includes/reports-toolbar.inc | 44 +++++++++++++------- .../en/modules/reports/guided_reports_start.tt | 18 +++++++- 2 files changed, 45 insertions(+), 17 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc index b7fa555..613da7d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc @@ -1,7 +1,7 @@
[% IF ( CAN_user_reports_create_reports ) %]
- +
[% END %] - [% IF ( showsql || execute || editsql || save_successful ) %] - [% UNLESS ( editsql ) # Do not show edit button on edit page %] - [% IF ( CAN_user_reports_create_reports ) %] - - [% END %] - [% END %] + [% IF ( showsql || execute || save_successful ) %] [% IF ( CAN_user_reports_create_reports ) %]
- - Delete - + + +
+ [% END %] + + [% IF ( CAN_user_tools_schedule_tasks ) %] + + [% END %] + + [% IF ( save_successful ) %] + [% END %] [% UNLESS ( errors ) # Unless there are errors saving a report %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt index d766381..76c0fa9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt @@ -167,6 +167,15 @@ $(document).ready(function(){ } }); + $("#deletereport").on("click",function(){ + $(".btn-group").removeClass("open"); + if(confirm(_("Are you sure you want to delete this saved report?"))){ + return true; + } else { + return false; + } + }); + [% IF (create || editsql || save) %] $("#select_group").change(function() { if($(this).attr('checked')) { @@ -230,7 +239,9 @@ $(document).ready(function(){ [% ELSIF ( showsql ) %]› Saved reports › SQL view [% ELSIF ( editsql ) %]› Saved reports › Edit SQL report [% ELSIF ( execute ) %]› Saved reports[% name %] Report -[% ELSIF ( build1 || build2 || build3 || build4 || build5 || build6 ) %]› Build a report +[% ELSIF ( build1 || build2 || build3 || build4 || build5 || build6 ) %] + [% guided = 1 %] + › Build a report [% IF ( build1 ) %]› Step 1 of 6: Choose a module [% ELSIF ( build2 ) %]› Step 2 of 6: Pick a report type [% ELSIF ( build3 ) %]› Step 3 of 6: Select columns for display @@ -245,7 +256,10 @@ $(document).ready(function(){
- [% INCLUDE "reports-toolbar.inc" %] + + [% UNLESS ( editsql || create || enter_params || guided || save ) %] + [% INCLUDE "reports-toolbar.inc" %] + [% END %] [% IF ( start ) %]

Guided reports

-- 1.7.10.4