Bug 16000 - Duplicate a report from the New Reports button
Summary: Duplicate a report from the New Reports button
Status: RESOLVED DUPLICATE of bug 15421
Alias: None
Product: Koha
Classification: Unclassified
Component: Reports (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Owen Leonard
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-07 16:52 UTC by Christopher Brannon
Modified: 2016-03-25 12:44 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Medium patch
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 16000 - Duplicate a report from the New Reports button (7.73 KB, patch)
2016-03-08 14:03 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16000 - Duplicate a report from the New Reports button (7.75 KB, patch)
2016-03-08 21:01 UTC, Nicole C. Engard
Details | Diff | Splinter Review
Bug 16000 - Duplicate a report from the New Reports button (7.81 KB, patch)
2016-03-16 14:35 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 16000: Simplify JS code (1.12 KB, patch)
2016-03-17 09:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 16000 [Revised] Duplicate a report from the New Reports button (8.45 KB, patch)
2016-03-17 15:58 UTC, Owen Leonard
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 16000: Simplify JS code (1.22 KB, patch)
2016-03-17 16:01 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16000 [Revised] Duplicate a report from the New Reports button (8.75 KB, patch)
2016-03-24 17:21 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16000: Simplify JS code (1.21 KB, patch)
2016-03-24 17:22 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 16000 [Revised] Duplicate a report from the New Reports button (8.77 KB, patch)
2016-03-24 17:29 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review
Bug 16000: Simplify JS code (1.23 KB, patch)
2016-03-24 17:29 UTC, sandboxes@biblibre.com
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Brannon 2016-03-07 16:52:01 UTC
It would make sense to have a "Duplicate" options in guided_reports.pl on the New Report button outside of the "Use saved" phase of the page.

Christopher
Comment 1 Owen Leonard 2016-03-08 14:03:17 UTC Comment hidden (obsolete)
Comment 2 Nicole C. Engard 2016-03-08 21:01:13 UTC Comment hidden (obsolete)
Comment 3 Christopher Brannon 2016-03-08 23:15:07 UTC
While the menu works, it doesn't deliver.  Duplicate just puts me in a new report, not a duplicate.

The menu could also be visible when editing.  I don't think that would pose any issues.  Do you?

The other menu items appear to work as expected.
Comment 4 Owen Leonard 2016-03-09 00:55:20 UTC
(In reply to Christopher Brannon from comment #3)
> While the menu works, it doesn't deliver.  Duplicate just puts me in a new
> report, not a duplicate.

I do not find this to be the case. Have you tried it with more than one report?
 
> The menu could also be visible when editing.  I don't think that would pose
> any issues.  Do you?

This is something which I describe in my latest update to the interface patterns page on the wiki:

"In this view the toolbar is not displayed, because the user is expected to either submit a completed form or choose the 'Cancel' link to abort the process of creating a new entry."

https://wiki.koha-community.org/wiki/Interface_patterns#The_.27New.27_entry_form

However, the option of duplicating something might be relevant during an edit process. I wonder if we should have a "Save as new report" option or something like that?
Comment 5 Christopher Brannon 2016-03-09 15:50:03 UTC
(In reply to Owen Leonard from comment #4)
> (In reply to Christopher Brannon from comment #3)
> > While the menu works, it doesn't deliver.  Duplicate just puts me in a new
> > report, not a duplicate.
> 
> I do not find this to be the case. Have you tried it with more than one
> report?

Yes.  You can see this in action here: http://screencast.com/t/TS06SJOhpyY

> > The menu could also be visible when editing.  I don't think that would pose
> > any issues.  Do you?
> 
> This is something which I describe in my latest update to the interface
> patterns page on the wiki:
> 
> "In this view the toolbar is not displayed, because the user is expected to
> either submit a completed form or choose the 'Cancel' link to abort the
> process of creating a new entry."
> 
> https://wiki.koha-community.org/wiki/Interface_patterns#The_.27New.
> 27_entry_form
> 
> However, the option of duplicating something might be relevant during an
> edit process. I wonder if we should have a "Save as new report" option or
> something like that?

I would suggest a secondary Update button, such as "Update and Duplicate", since we don't use the term Save on the screen.
Comment 6 Owen Leonard 2016-03-16 13:06:30 UTC
(In reply to Christopher Brannon from comment #5)
> > I do not find this to be the case. Have you tried it with more than one
> > report?
> 
> Yes.  You can see this in action here: http://screencast.com/t/TS06SJOhpyY

I still can't reproduce this problem. Can you please post the SQL of a report which is showing the problem? Does the "Duplicate" option work from the "Actions" menu on the list of saved reports?

> I would suggest a secondary Update button, such as "Update and Duplicate",
> since we don't use the term Save on the screen.

I think that should be its own enhancement request.
Comment 7 Christopher Brannon 2016-03-16 14:32:09 UTC
(In reply to Owen Leonard from comment #6)
> (In reply to Christopher Brannon from comment #5)
> > > I do not find this to be the case. Have you tried it with more than one
> > > report?
> > 
> > Yes.  You can see this in action here: http://screencast.com/t/TS06SJOhpyY
> 
> I still can't reproduce this problem. Can you please post the SQL of a
> report which is showing the problem? Does the "Duplicate" option work from
> the "Actions" menu on the list of saved reports?

The screencast I posted demonstrates me showing the original "Duplicate" working from the list of saved reports.  It also shows the SQL report I used.
Comment 8 Christopher Brannon 2016-03-16 14:33:07 UTC
I have tested again and it is working now.  This must be another case of not clearing the cache.  I will go ahead and sign off on this.
Comment 9 sandboxes@biblibre.com 2016-03-16 14:34:27 UTC
Patch tested with a sandbox, by Christopher Brannon <cbrannon@cdalibrary.org>
Comment 10 sandboxes@biblibre.com 2016-03-16 14:35:06 UTC Comment hidden (obsolete)
Comment 11 Jonathan Druart 2016-03-17 09:23:38 UTC
(In reply to Christopher Brannon from comment #8)
> I have tested again and it is working now.  This must be another case of not
> clearing the cache.  I will go ahead and sign off on this.

No it does not :)

Owen, to replicate:
/reports/guided_reports.pl?phase=Use saved
Actions > edit
Update SQL
Edit > Duplicate
Will open an empty form
Comment 12 Jonathan Druart 2016-03-17 09:24:19 UTC Comment hidden (obsolete)
Comment 13 Jonathan Druart 2016-03-17 09:25:22 UTC
(In reply to Jonathan Druart from comment #12)
> Created attachment 49247 [details] [review] [review]
> Bug 16000: Simplify JS code

Owen, feel free to embed it into your patch if it's easier for you (i.e. I don't care about the authorship).
Comment 14 Owen Leonard 2016-03-17 15:58:36 UTC Comment hidden (obsolete)
Comment 15 Owen Leonard 2016-03-17 16:01:25 UTC Comment hidden (obsolete)
Comment 16 Marc Véron 2016-03-24 16:05:38 UTC
Sorry, does not apply:
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/reports-toolbar.inc
Failed to merge in the changes.
Comment 17 Christopher Brannon 2016-03-24 16:53:17 UTC
I was having trouble getting it to load in a sandbox yesterday.  Sandboxes are not sending me e-mails, so had no clue what was happening.  Now we know.

Christopher
Comment 18 Owen Leonard 2016-03-24 17:21:55 UTC Comment hidden (obsolete)
Comment 19 Owen Leonard 2016-03-24 17:22:32 UTC Comment hidden (obsolete)
Comment 20 sandboxes@biblibre.com 2016-03-24 17:29:19 UTC
Patch tested with a sandbox, by Christopher Brannon <cbrannon@cdalibrary.org>
Comment 21 sandboxes@biblibre.com 2016-03-24 17:29:50 UTC
Created attachment 49543 [details] [review]
Bug 16000 [Revised] 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.

Revision passes the sql data to the template in the case of the
"save_successful" screen.

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 22 sandboxes@biblibre.com 2016-03-24 17:29:53 UTC
Created attachment 49544 [details] [review]
Bug 16000: Simplify JS code

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Signed-off-by: Christopher Brannon <cbrannon@cdalibrary.org>
Comment 23 Katrin Fischer 2016-03-24 22:11:06 UTC
Showing an existing export, the schedule button appears twice now.
(cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Show%20SQL)
Comment 24 Christopher Brannon 2016-03-24 22:24:20 UTC
(In reply to Katrin Fischer from comment #23)
> Showing an existing export, the schedule button appears twice now.
> (cgi-bin/koha/reports/guided_reports.pl?reports=1&phase=Show%20SQL)

Yep. I missed that one.  :/
Comment 25 Christopher Brannon 2016-03-24 22:27:47 UTC
Schedule button duplicates after update or save as well.
Comment 26 Owen Leonard 2016-03-25 12:44:43 UTC
Rather than resolve the merge errors with Bug 15421, I resolve that my patch is made obsolete by Bug 15421.

*** This bug has been marked as a duplicate of bug 15421 ***