Bugzilla – Attachment 37080 Details for
Bug 7369
Ability to duplicate existing items
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7369 - duplicate item
Bug-7369---duplicate-item.patch (text/plain), 3.53 KB, created by
Nick Clemens (kidclamp)
on 2015-03-21 16:33:42 UTC
(
hide
)
Description:
Bug 7369 - duplicate item
Filename:
MIME Type:
Creator:
Nick Clemens (kidclamp)
Created:
2015-03-21 16:33:42 UTC
Size:
3.53 KB
patch
obsolete
>From 318b89a1978dba3670dafc531e638da7b0012de7 Mon Sep 17 00:00:00 2001 >From: Nick Clemens <nick@quecheelibrary.org> >Date: Sat, 21 Mar 2015 12:27:04 -0400 >Subject: [PATCH] Bug 7369 - duplicate item > >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 >--- > cataloguing/additem.pl | 18 ++++++++++++++++++ > .../prog/en/modules/cataloguing/additem.tt | 1 + > 2 files changed, 19 insertions(+) > >diff --git a/cataloguing/additem.pl b/cataloguing/additem.pl >index 6ff3bbd..1324341 100755 >--- a/cataloguing/additem.pl >+++ b/cataloguing/additem.pl >@@ -566,6 +566,24 @@ if ($op eq "additem") { > $itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber); > $nextop = "saveitem"; > #------------------------------------------------------------------------------- >+} elsif ($op eq "dupeitem") { >+#------------------------------------------------------------------------------- >+# retrieve item if exist => then, it's a modif >+ $itemrecord = C4::Items::GetMarcItem($biblionumber,$itemnumber); >+ if (C4::Context->preference('autoBarcode') eq 'incremental') { >+ $itemrecord = _increment_barcode($itemrecord, $frameworkcode); >+ } >+ else { >+ # we have to clear the barcode field in the duplicate item record to make way for the new one generated by the javascript plugin >+ my ($tagfield,$tagsubfield) = &GetMarcFromKohaField("items.barcode",$frameworkcode); >+ my $fieldItem = $itemrecord->field($tagfield); >+ $itemrecord->delete_field($fieldItem); >+ $fieldItem->delete_subfields($tagsubfield); >+ $itemrecord->insert_fields_ordered($fieldItem); >+ } >+ $itemrecord = removeFieldsForPrefill($itemrecord) if ($prefillitem); >+ $nextop = "additem"; >+#------------------------------------------------------------------------------- > } elsif ($op eq "delitem") { > #------------------------------------------------------------------------------- > # check that there is no issue on this item before deletion. >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >index 9cdc1cf..72bd648 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt >@@ -181,6 +181,7 @@ $(document).ready(function() { > <a href="additem.pl?op=edititem&biblionumber=[% item_loo.hostbiblionumber %]&itemnumber=[% item_loo.itemnumber %]#edititem">Edit in host</a> <a class="delete" href="/cgi-bin/koha/cataloguing/additem.pl?op=delinkitem&biblionumber=[% biblionumber %]&hostitemnumber=[% item_loo.itemnumber %]">Delink</a> > [% ELSE %] > <a href="additem.pl?op=edititem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]#edititem">Edit</a> >+<a href="additem.pl?op=dupeitem&biblionumber=[% biblionumber %]&itemnumber=[% item_loo.itemnumber %]#additema">Duplicate</a> > [% IF ( item_loo.countanalytics ) %] > <a href="/cgi-bin/koha/catalogue/search.pl?idx=hi&q=% item_loo.itemnumber %]">View analytics</a> > [% ELSE %] >-- >1.7.10.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7369
:
37080
|
37352
|
37496
|
37498
|
37502
|
37503
|
37504
|
37505
|
37506
|
37507
|
37655
|
37656
|
44522
|
44523
|
44524