Bugzilla – Attachment 84308 Details for
Bug 7614
Use branch transfer limits for determining available opac holds pickup locations
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7614: Don't allow un-usable pickup locations in the opac pickup locations pulldown
Bug-7614-Dont-allow-un-usable-pickup-locations-in-.patch (text/plain), 4.42 KB, created by
Kyle M Hall (khall)
on 2019-01-22 19:07:59 UTC
(
hide
)
Description:
Bug 7614: Don't allow un-usable pickup locations in the opac pickup locations pulldown
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2019-01-22 19:07:59 UTC
Size:
4.42 KB
patch
obsolete
>From 737356336095ec7942cd772d77c523fccdf8a416 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutiosn.com> >Date: Mon, 20 Aug 2018 10:48:07 -0400 >Subject: [PATCH] Bug 7614: Don't allow un-usable pickup locations in the opac > pickup locations pulldown > >Also fully qualifies some subroutine calls that fail for reasons unkown. > >Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> > >Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> >--- > C4/Items.pm | 12 ++++++------ > .../opac-tmpl/bootstrap/en/modules/opac-reserve.tt | 1 - > opac/opac-reserve.pl | 8 +++++++- > 3 files changed, 13 insertions(+), 8 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index 3b006c686e..1addacc4d1 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -222,10 +222,10 @@ sub AddItemFromMarc { > # parse item hash from MARC > my $frameworkcode = C4::Biblio::GetFrameworkCode( $biblionumber ); > my ($itemtag,$itemsubfield)=C4::Biblio::GetMarcFromKohaField("items.itemnumber",$frameworkcode); >- >- my $localitemmarc=MARC::Record->new; >- $localitemmarc->append_fields($source_item_marc->field($itemtag)); >- my $item = TransformMarcToKoha( $localitemmarc, $frameworkcode ,'items'); >+ >+ my $localitemmarc=MARC::Record->new; >+ $localitemmarc->append_fields($source_item_marc->field($itemtag)); >+ my $item = C4::Biblio::TransformMarcToKoha( $localitemmarc, $frameworkcode ,'items'); > my $unlinked_item_subfields = _get_unlinked_item_subfields($localitemmarc, $frameworkcode); > return AddItem($item, $biblionumber, $dbh, $frameworkcode, $unlinked_item_subfields); > } >@@ -284,7 +284,7 @@ sub AddItem { > > $item->{'itemnumber'} = $itemnumber; > >- ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver" ); >+ C4::Biblio::ModZebra( $item->{biblionumber}, "specialUpdate", "biblioserver" ); > > logaction( "CATALOGUING", "ADD", $itemnumber, "item" ) > if C4::Context->preference("CataloguingLog"); >@@ -2032,7 +2032,7 @@ sub _get_unlinked_item_subfields { > my $original_item_marc = shift; > my $frameworkcode = shift; > >- my $marcstructure = GetMarcStructure(1, $frameworkcode, { unsafe => 1 }); >+ my $marcstructure = C4::Biblio::GetMarcStructure(1, $frameworkcode, { unsafe => 1 }); > > # assume that this record has only one field, and that that > # field contains only the item information >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >index d55672fa5a..15dfe5e26f 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-reserve.tt >@@ -225,7 +225,6 @@ > </li> > [% END %] > >- > [% UNLESS ( singleBranchMode ) %] > [% IF ( bibitemloo.holdable && Koha.Preference('OPACAllowUserToChooseBranch')) %] > <li class="branch"> >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index e8969752b5..bb71dc786f 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -173,6 +173,7 @@ foreach my $biblioNumber (@biblionumbers) { > > # Compute the priority rank. > my $biblio = Koha::Biblios->find( $biblioNumber ); >+ $biblioData->{object} = $biblio; > my $holds = $biblio->holds; > my $rank = $holds->count; > $biblioData->{reservecount} = 1; # new reserve >@@ -390,7 +391,6 @@ $template->param('item_level_itypes' => $itemLevelTypes); > > foreach my $biblioNum (@biblionumbers) { > >- my @not_available_at = (); > my $record = GetMarcBiblio({ biblionumber => $biblioNum }); > # Init the bib item with the choices for branch pickup > my %biblioLoopIter; >@@ -402,6 +402,12 @@ foreach my $biblioNum (@biblionumbers) { > &get_out($query, $cookie, $template->output); > } > >+ my @not_available_at = (); >+ my $biblio = $biblioData->{object}; >+ foreach my $library ( $pickup_locations->as_list ) { >+ push( @not_available_at, $library->branchcode ) unless $biblio->can_be_transferred({ to => $library }); >+ } >+ > my $frameworkcode = GetFrameworkCode( $biblioData->{biblionumber} ); > $biblioLoopIter{biblionumber} = $biblioData->{biblionumber}; > $biblioLoopIter{title} = $biblioData->{title}; >-- >2.17.2 (Apple Git-113)
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 7614
:
60141
|
60142
|
60143
|
60144
|
60145
|
60785
|
60786
|
60787
|
60938
|
60946
|
70047
|
77895
|
77896
|
77897
|
77898
|
77899
|
77900
|
78020
|
84295
|
84296
|
84297
|
84298
|
84299
|
84300
|
84301
|
84302
|
84303
|
84304
|
84305
|
84306
|
84307
| 84308 |
84309
|
84310
|
84311