Bug 15321 - Add delete report option to Show, Edit and Run screens
Summary: Add delete report option to Show, Edit and Run screens
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Magnus Enger
QA Contact: Testopia
URL:
Keywords:
: 15322 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-12-06 02:23 UTC by HB-NEKLS
Modified: 2017-06-14 22:10 UTC (History)
3 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Trivial patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15321 - Add delete report link to Show, Edit and Run screens (1.91 KB, patch)
2015-12-08 19:52 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 15321 - Add delete report link to Show, Edit and Run screens (2.85 KB, patch)
2015-12-08 21:02 UTC, Magnus Enger
Details | Diff | Splinter Review
Bug 15321 - Add delete report link to Show, Edit and Run screens (2.97 KB, patch)
2015-12-09 09:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15321: No need to add the change trigger conditionally (1.36 KB, patch)
2015-12-09 09:11 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15321: No need to add the change trigger conditionally (1.36 KB, patch)
2015-12-09 09:12 UTC, Jonathan Druart
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description HB-NEKLS 2015-12-06 02:23:11 UTC
It would be nice if the saved report output screen (cgi-bin/koha/reports/guided_reports.pl?reports=[report number]&phase=Run%20this%20report) had a delete option. Sometimes you need to write a report and then immediately delete it. 

Right now, you have to go back to the saved reports module and delete from there.
Comment 1 Magnus Enger 2015-12-08 19:40:49 UTC
*** Bug 15322 has been marked as a duplicate of this bug. ***
Comment 2 Magnus Enger 2015-12-08 19:42:58 UTC
Because of the way the relevant templates are structured, it is easy to add the Delete link to the Show, Edit and Run screens in one go, so I have marked bug 15322 as a duplicate of this one.
Comment 3 Magnus Enger 2015-12-08 19:52:21 UTC Comment hidden (obsolete)
Comment 4 HB-NEKLS 2015-12-08 20:07:46 UTC
Magnus, you just made my day with this! 

I've tested it, to check for it in the three places (edit, "report has been saved", and run screens), and it's present in all three places. 

Before signing off, though, I did notice there's no delete confirmation message appearing -- the reports just delete. Can that be fixed in the scope of this bug or does it need to be a separate bug report?
Comment 5 Magnus Enger 2015-12-08 20:44:06 UTC
Ah, when you click Delete from the list of saved reports there is a JavaScript confirmation that I missed. I'll see if I can get that to work with the new links.
Comment 6 Magnus Enger 2015-12-08 21:02:33 UTC Comment hidden (obsolete)
Comment 7 HB-NEKLS 2015-12-08 21:13:37 UTC
I've followed the testing plan below, including the patch update in version 2, and this works as described. Thanks Magnus! 

Test plan:
- Apply the patch
- Make sure you have at least one saved report
- Make sure you have the create_reports permission
- Go to the Show, Edit and Run screens and verify the Delete link
  is present and functional, including the JavaScript confirmation
  dialogue
- Change to a user without the create_reports permission and check
  that the Delete link is not displayed on the Show, Edit and Run
  screens
- Sign ye off merrily!

Version 2: This version makes sure the JavaScript confirmation is
shown before an actual delete is carried out.
Comment 8 Jonathan Druart 2015-12-09 09:11:55 UTC
Created attachment 45518 [details] [review]
Bug 15321 - Add delete report link to Show, Edit and Run screens

Currently, if you are editing or viewing the results of running a
report and you decide you want to delete it, you have to go back
to the list of saved reports to do so. This patch adds a "Delete"
link in some convenient places.

To test:
- Apply the patch
- Make sure you have at least one saved report
- Make sure you have the create_reports permission
- Go to the Show, Edit and Run screens and verify the Delete link
  is present and functional, including the JavaScript confirmation
  dialogue
- Change to a user without the create_reports permission and check
  that the Delete link is not displayed on the Show, Edit and Run
  screens
- Sign ye off merrily!

Version 2: This version makes sure the JavaScript confirmation is
shown before an actual delete is carried out.

Signed-off-by: Heather Braum <hbraum@nekls.org>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 9 Jonathan Druart 2015-12-09 09:11:58 UTC Comment hidden (obsolete)
Comment 10 Jonathan Druart 2015-12-09 09:12:53 UTC
Created attachment 45520 [details] [review]
Bug 15321: No need to add the change trigger conditionally

It will be applied if the button exists.

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 11 Kyle M Hall 2015-12-31 15:47:50 UTC
Pushed to master, thanks Magnus!