Bug 7369 - Ability to duplicate existing items
Summary: Ability to duplicate existing items
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Nick Clemens (kidclamp)
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-19 15:04 UTC by Nicole C. Engard
Modified: 2016-06-21 21:40 UTC (History)
8 users (show)

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


Attachments
Bug 7369 - duplicate item (3.53 KB, patch)
2015-03-21 16:33 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
duplicating fields it shouldn't (45.25 KB, image/png)
2015-03-29 20:50 UTC, Nicole C. Engard
Details
Bug 7369 - duplicate item (4.24 KB, patch)
2015-04-04 03:16 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 7369 - Use dropdown buttons for item actions (3.83 KB, patch)
2015-04-04 10:08 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 7369 - duplicate item (4.24 KB, patch)
2015-04-05 00:57 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 7369 - Use dropdown buttons for item actions (3.83 KB, patch)
2015-04-05 00:57 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 7369 - Use dropdown buttons for item actions (3.88 KB, patch)
2015-04-05 00:59 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 7369 - duplicate item (4.29 KB, patch)
2015-04-05 01:01 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 7369 - duplicate item (4.29 KB, patch)
2015-04-05 01:02 UTC, Mark Tompsett
Details | Diff | Splinter Review
Bug 7369 - Use dropdown buttons for item actions (3.91 KB, patch)
2015-04-05 01:02 UTC, Mark Tompsett
Details | Diff | Splinter Review
[PASSED QA] Bug 7369 - duplicate item (4.38 KB, patch)
2015-04-10 14:34 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
[PASSED QA] Bug 7369 - Use dropdown buttons for item actions (3.98 KB, patch)
2015-04-10 14:34 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 7369 - duplicate item (4.67 KB, patch)
2015-11-05 16:57 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 7369 - Use dropdown buttons for item actions (4.13 KB, patch)
2015-11-05 16:57 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review
Bug 7369 - duplicate item and add dropdown buttons for item actions (6.54 KB, patch)
2015-11-05 18:57 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2011-12-19 15:04:54 UTC
It would be nice when coming back to a bib record with items on it already to be able to choose an item to duplicate.  You can duplicate bib records and subscriptions under their edit menus, but the only way to duplicate an item is to use add and duplicate  which is only done when adding a new item - but often you want to duplicate an existing item at a later date and this would allow that.
Comment 1 Nick Clemens (kidclamp) 2015-03-21 16:33:42 UTC Comment hidden (obsolete)
Comment 2 Nicole C. Engard 2015-03-29 20:50:29 UTC
Created attachment 37352 [details]
duplicating fields it shouldn't

2 things.

1 - we should put the edit, duplicate, delete options in a pull down like on other pages

2 - much bigger - the hidden fields are duplicating like number of checkouts and last checkout (see attached)


Other QA tests passed:

Processing files before patches
|========================>| 2 / 2 (100.00%)
Processing files after patches
|========================>| 2 / 2 (100.00%)

 OK	cataloguing/additem.pl
   OK	  critic
   OK	  forbidden patterns
   OK	  pod
   OK	  valid

 OK	koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
   OK	  forbidden patterns
   OK	  tt_valid
   OK	  valid_template
Comment 3 Nick Clemens (kidclamp) 2015-04-04 03:16:47 UTC Comment hidden (obsolete)
Comment 4 Nick Clemens (kidclamp) 2015-04-04 03:17:55 UTC
Leaving as ASSIGNED, getting a valid_template error with qa tools
Comment 5 Nick Clemens (kidclamp) 2015-04-04 10:08:02 UTC Comment hidden (obsolete)
Comment 6 Nick Clemens (kidclamp) 2015-04-04 10:08:54 UTC
passes qa-test-tools and uses dropdown for item actions
Comment 7 Mark Tompsett 2015-04-04 23:07:43 UTC
Comment on attachment 37496 [details] [review]
Bug 7369 - duplicate item

Review of attachment 37496 [details] [review]:
-----------------------------------------------------------------

::: cataloguing/additem.pl
@@ +581,5 @@
> +        $fieldItem->delete_subfields($tagsubfield);
> +        $itemrecord->insert_fields_ordered($fieldItem);
> +    }
> +
> +    #check for hidden subfield and remove them for the duplicated item

Why? Duplicate means duplicate everything (except itemnumber and barcode), right?
Comment 8 Mark Tompsett 2015-04-04 23:12:11 UTC
BTW, I love the button dropdown on the Edit/Duplicate/Delete. Such a pretty improvement!

Now for the question: Why is the delete an else on whether there are analytics or not?

Moving to 'In Discussion' to reflect that I have asked some questions before signing off.
Comment 9 Nick Clemens (kidclamp) 2015-04-04 23:15:12 UTC
> Why? Duplicate means duplicate everything (except itemnumber and barcode),
> right?

The hidden fields include issues and on loan etc., I think duplicating fields you can't manually touch or edit is not helpful.

Essentially it's an extension of Add+duplicate, giving you the option to add additional copies after initial cataloging.
Comment 10 Nick Clemens (kidclamp) 2015-04-04 23:17:30 UTC
(In reply to M. Tompsett from comment #8)
> 
> Now for the question: Why is the delete an else on whether there are
> analytics or not?
> 
I honestly wondered that myself when editing but not knowing the answer I assumed whoever did that had intention and was better to leave as is than to bug fix someone's feature
Comment 11 Nick Clemens (kidclamp) 2015-04-04 23:37:00 UTC
(In reply to Nick Clemens from comment #10)
> (In reply to M. Tompsett from comment #8)
> > 
> > Now for the question: Why is the delete an else on whether there are
> > analytics or not?
> > 

Ah, okay, when adding an analytical record (say a separate record for an article in a journal) you attach it to a specific item on the parent record.  This check ensures that if the record has an analytical/'child' record you don't delete it
Comment 12 Mark Tompsett 2015-04-05 00:57:51 UTC Comment hidden (obsolete)
Comment 13 Mark Tompsett 2015-04-05 00:57:58 UTC Comment hidden (obsolete)
Comment 14 Mark Tompsett 2015-04-05 00:59:36 UTC Comment hidden (obsolete)
Comment 15 Mark Tompsett 2015-04-05 01:01:30 UTC Comment hidden (obsolete)
Comment 16 Mark Tompsett 2015-04-05 01:02:53 UTC Comment hidden (obsolete)
Comment 17 Mark Tompsett 2015-04-05 01:02:58 UTC Comment hidden (obsolete)
Comment 18 Kyle M Hall (khall) 2015-04-10 14:34:32 UTC Comment hidden (obsolete)
Comment 19 Kyle M Hall (khall) 2015-04-10 14:34:39 UTC Comment hidden (obsolete)
Comment 20 Tomás Cohen Arazi (tcohen) 2015-11-05 13:24:36 UTC
Can u please rebase it ASAP?
Comment 21 Mark Tompsett 2015-11-05 13:51:55 UTC
(In reply to Tomás Cohen Arazi from comment #20)
> Can u please rebase it ASAP?

The rebase is required because of bug 13943.
Also noticed that ampersand parameters were added in poor HTML form.
Comment 22 Nick Clemens (kidclamp) 2015-11-05 16:57:12 UTC Comment hidden (obsolete)
Comment 23 Nick Clemens (kidclamp) 2015-11-05 16:57:18 UTC Comment hidden (obsolete)
Comment 24 Mark Tompsett 2015-11-05 18:42:40 UTC
Comment on attachment 44523 [details] [review]
Bug 7369 - Use dropdown buttons for item actions

Review of attachment 44523 [details] [review]:
-----------------------------------------------------------------

::: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt
@@ +188,2 @@
>                            [% ELSE %]
> +                              <li><a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delitem&amp;biblionumber=[% biblionumber %]&amp;itemnumber=[% item_loo.itemnumber %]&amp;searchid=[% searchid %]" onclick="confirm_deletion([% biblionumber %],[% item_loo.itemnumber %]); return false;">Delete</a></li>

This is the only point I'd question in the rebase: confirm_deletion has parameters here, but not in master.
Comment 25 Nick Clemens (kidclamp) 2015-11-05 18:57:43 UTC
Created attachment 44524 [details] [review]
Bug 7369 - duplicate item and add dropdown buttons for item actions

This patch adds a link to duplicate existing items on the edit items screen

To test:
1 - Apply patch
2 - navigate to the edit items screen for a record with existing items
3 - click the duplicate link and ensure item info but not barcode are carried over
4 - save the item and ensure it is added correctly
5 - check that all previous functionality on page works as before

Signed-off-by: Mark Tompsett <mtompset@hotmail.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Comment 26 Nick Clemens (kidclamp) 2015-11-05 18:59:27 UTC
Thanks Mark!  Rebased and squashed

> This is the only point I'd question in the rebase: confirm_deletion has
> parameters here, but not in master.
Comment 27 Tomás Cohen Arazi (tcohen) 2015-11-09 18:05:02 UTC
Patch pushed to master.

Thanks Nick!