Bugzilla – Attachment 64568 Details for
Bug 17214
Add records to lists by biblio number
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17214: Add records to lists by biblionumber
Bug-17214-Add-records-to-lists-by-biblionumber.patch (text/plain), 6.11 KB, created by
PTFS Europe Sandboxes
on 2017-06-23 03:15:28 UTC
(
hide
)
Description:
Bug 17214: Add records to lists by biblionumber
Filename:
MIME Type:
Creator:
PTFS Europe Sandboxes
Created:
2017-06-23 03:15:28 UTC
Size:
6.11 KB
patch
obsolete
>From ed3b9753995fc8caa442b70d03d9af369344070b Mon Sep 17 00:00:00 2001 >From: Aleisha Amohia <aleishaamohia@hotmail.com> >Date: Thu, 20 Apr 2017 01:50:38 +0000 >Subject: [PATCH] Bug 17214: Add records to lists by biblionumber >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >To test: >1) Apply patch and go to Lists >2) Click on an existing list or create a new list >3) Add items by barcode, confirm this functionality still works >4) Trigger error messages (adding duplicate barcodes, barcodes that >don't exist) to confirm they still show as appropriate >5) Test adding by biblionumber, confirm this works as expected >6) Trigger error messages (adding duplicate biblionumbers, biblionumbers >that don't exist). Confirm wording is appropriate in messages. >7) Add both barcodes and biblionumbers at the same time, confirm this >works as expected > >Sponsored-by: Catalyst IT > >Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com> >Signed-off-by: Israelex A Veleña for KohaCon17 <israelex19@gmail.com> > >Signed-off-by: Harold <harold.sabanal@gmail.com> >--- > .../prog/en/modules/virtualshelves/shelves.tt | 25 +++++++++++++++++++--- > virtualshelves/shelves.pl | 24 +++++++++++++++++++++ > 2 files changed, 46 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >index 2044754..560cbfe 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt >@@ -333,7 +333,11 @@ function placeHold () { > [% CASE 'error_on_delete' %] > <span>An error occurred when deleting this list.</span> > [% CASE 'error_on_add_biblio' %] >- <span>The item ([% m.item_barcode %]) has not been added to the list. Please verify it is not already in the list.</span> >+ [% IF m.item_barcode %] >+ <span>The item ([% m.item_barcode %]) has not been added to the list. Please verify it is not already in the list.</span> >+ [% ELSE %] >+ <span>The record ([% m.bibnum %]) has not been added to the list. Please verify it is not already in the list.</span> >+ [% END %] > [% CASE 'success_on_update' %] > <span>List updated.</span> > [% CASE 'success_on_insert' %] >@@ -341,13 +345,21 @@ function placeHold () { > [% CASE 'success_on_delete' %] > <span>List deleted.</span> > [% CASE 'success_on_add_biblio' %] >- <span>The item ([% m.item_barcode %]) has been added to the list.</span> >+ [% IF m.item_barcode %] >+ <span>The item ([% m.item_barcode %]) has been added to the list.</span> >+ [% ELSE %] >+ <span>The record ([% m.bibnum %]) has been added to the list.</span> >+ [% END %] > [% CASE 'success_on_remove_biblios' %] > <span>The item has been removed from the list.</span> > [% CASE 'does_not_exist' %] > <span>This list does not exist.</span> > [% CASE 'item_does_not_exist' %] >- <span>The item ([% m.item_barcode %]) does not exist.</span> >+ [% IF m.item_barcode %] >+ <span>The item ([% m.item_barcode %]) does not exist.</span> >+ [% ELSE %] >+ <span>The record ([% m.bibnum %]) does not exist.</span> >+ [% END %] > [% CASE 'unauthorized_on_view' %] > <span>You do not have permission to view this list.</span> > [% CASE 'unauthorized_on_update' %] >@@ -668,6 +680,13 @@ function placeHold () { > <input type="hidden" name="referer" value="view" /> > <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" /> > </li> >+ <li> >+ <label for="biblionumbers">Biblio numbers:</label> >+ <textarea name="biblionumbers" id="biblionumbers" class="focus" autocomplete="off" rows="5"></textarea> >+ <input type="hidden" name="op" value="add_biblio" /> >+ <input type="hidden" name="referer" value="view" /> >+ <input type="hidden" name="shelfnumber" value="[% shelf.shelfnumber %]" /> >+ </li> > </ol> > <fieldset class="action"> > <input type="submit" value="Add" /> >diff --git a/virtualshelves/shelves.pl b/virtualshelves/shelves.pl >index 06d93d2..397c52d 100755 >--- a/virtualshelves/shelves.pl >+++ b/virtualshelves/shelves.pl >@@ -165,6 +165,30 @@ if ( $op eq 'add_form' ) { > push @messages, { type => 'alert', code => 'unauthorized_on_add_biblio' }; > } > } >+ if ( my $biblionumbers = $query->param('biblionumbers') ) { >+ if ( $shelf->can_biblios_be_added( $loggedinuser ) ) { >+ my @biblionumbers = split /\n/, $biblionumbers; >+ foreach my $biblionumber (@biblionumbers) { >+ $biblionumber =~ s/\r$//; # strip any naughty return chars >+ next if $biblionumber eq ''; >+ my $biblio = GetBiblio($biblionumber); >+ if (defined $biblio) { >+ my $added = eval { $shelf->add_biblio( $biblionumber, $loggedinuser ); }; >+ if ($@) { >+ push @messages, { bibnum => $biblionumber, type => 'alert', code => ref($@), msg => $@ }; >+ } elsif ( $added ) { >+ push @messages, { bibnum => $biblionumber, type => 'message', code => 'success_on_add_biblio' }; >+ } else { >+ push @messages, { bibnum => $biblionumber, type => 'message', code => 'error_on_add_biblio' }; >+ } >+ } else { >+ push @messages, { bibnum => $biblionumber, type => 'alert', code => 'item_does_not_exist' }; >+ } >+ } >+ } else { >+ push @messages, { type => 'alert', code => 'unauthorized_on_add_biblio' }; >+ } >+ } > } else { > push @messages, { type => 'alert', code => 'does_not_exist' }; > } >-- >2.1.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 17214
:
62431
|
64567
|
64568
|
64569
|
66828
|
67815
|
67816
|
68657
|
68658
|
68659