Bugzilla – Attachment 8552 Details for
Bug 7398
Show number of holds on a title in the OPAC details
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
follow-up patch
0001-bug_7398-Take-in-account-OPACShowHoldsCount-syspref-.patch (text/plain), 7.12 KB, created by
Srdjan Jankovic
on 2012-03-23 06:03:41 UTC
(
hide
)
Description:
follow-up patch
Filename:
MIME Type:
Creator:
Srdjan Jankovic
Created:
2012-03-23 06:03:41 UTC
Size:
7.12 KB
patch
obsolete
>From 1112607997254b6635ba793859df5472a6e20afb Mon Sep 17 00:00:00 2001 >From: Srdjan <srdjan@catalyst.net.nz> >Date: Fri, 23 Mar 2012 18:59:31 +1300 >Subject: [PATCH] bug_7398: Take in account OPACShowHoldsCount syspref on > opac-reserves.pl > >--- > .../opac-tmpl/prog/en/modules/opac-reserve.tt | 44 ++++++++--------- > opac/opac-reserve.pl | 51 ++++++++++---------- > 2 files changed, 46 insertions(+), 49 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >index 7597a4a..5ed0e5b 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt >@@ -297,19 +297,21 @@ > [% END %] > > </td> >- [% IF ( bibitemloo.holdable ) %][% UNLESS ( item_level_itypes ) %] >- <td> >- [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %] >- [% bibitemloo.description %] >- </td> >- [% END %][% END %] > [% IF ( bibitemloo.holdable ) %] >- [% IF ( showpriority ) %] >- <td> >- [% bibitemloo.rank %] out of [% bibitemloo.reservecount %] >- </td>[% END %][% END %] >- [% IF ( reserve_in_future ) %] >- [% IF ( bibitemloo.holdable ) %]<td> >+ <!-- HOLDABLE --> >+ [% UNLESS ( item_level_itypes ) %] >+ <td> >+ [% IF ( bibitemloo.imageurl ) %]<img src="[% bibitemloo.imageurl %]" alt="" />[% END %] >+ [% bibitemloo.description %] >+ </td> >+ [% END %] >+ [% IF showholds %] >+ <td> >+ [% IF ( showpriority ) %] [% bibitemloo.rank %] out of [% END %][% bibitemloo.reservecount %] >+ </td> >+ [% END %] >+ [% IF ( reserve_in_future ) %] >+ <td> > <input name="reserve_date_[% bibitemloo.biblionumber %]" id="reserve_date_[% bibitemloo.biblionumber %]" size="10"> > <script language="JavaScript" type="text/javascript"> > //<![CDATA[ >@@ -348,10 +350,9 @@ > </script> > <p style="margin:.3em 2em;"> > <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('reserve_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p> >- </td>[% END %] >- >- [% END %] >- [% IF ( bibitemloo.holdable ) %]<td> >+ </td> >+ [% END %] >+ <td> > <input name="expiration_date_[% bibitemloo.biblionumber %]" id="expiration_date_[% bibitemloo.biblionumber %]" size="10" readonly="readonly" /> > <img src="[% themelang %]/lib/calendar/cal.gif" alt="Show Calendar" border="0" id="CalendarExpirationDate_[% bibitemloo.biblionumber %]" style="cursor: pointer;" /> > <script language="JavaScript" type="text/javascript"> >@@ -381,13 +382,10 @@ > </script> > <p style="margin:.3em 2em;"> > <a href="#" style="font-size:85%;text-decoration:none;" onclick="document.getElementById('expiration_date_[% bibitemloo.biblionumber %]').value='';return false;">Clear Date</a></p> >- </td>[% END %] >- >- [% IF ( bibitemloo.holdable ) %] >- <!-- HOLD ABLE --> >- [% IF ( OPACItemHolds ) %] >- <!-- ITEM HOLDS --> >- <td class="place_on_type" style="display:none"> >+ </td> >+ [% IF ( OPACItemHolds ) %] >+ <!-- ITEM HOLDS --> >+ <td class="place_on_type" style="display:none"> > <ul> > <li> > [% UNLESS ( bibitemloo.holdable ) %] >diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl >index 4e4d440..77e5b05 100755 >--- a/opac/opac-reserve.pl >+++ b/opac/opac-reserve.pl >@@ -48,6 +48,8 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user( > } > ); > my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0; >+my $show_holds_count = C4::Context->preference("OPACShowHoldsCount"); >+ > sub get_out ($$$) { > output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output; > exit; >@@ -113,12 +115,8 @@ $template->param( choose_branch => $OPACChooseBranch); > # > # > >-# Hash of biblionumber to biblio/biblioitems record. >-my %biblioDataHash; >- >-# Hash of itemnumber to item info. >-my %itemInfoHash; >- >+my %biblioDataHash; # Hash of biblionumber to biblio/biblioitems record. >+my %itemInfoHash; # Hash of itemnumber to item info. > foreach my $biblioNumber (@biblionumbers) { > > my $biblioData = GetBiblioData($biblioNumber); >@@ -128,33 +126,33 @@ foreach my $biblioNumber (@biblionumbers) { > > my $marcrecord= GetMarcBiblio($biblioNumber); > >- # flag indicating existence of at least one item linked via a host record >- my $hostitemsflag; >- # adding items linked via host biblios >- my @hostitemInfos = GetHostItemsInfo($marcrecord); >- if (@hostitemInfos){ >- $hostitemsflag =1; >- push (@itemInfos,@hostitemInfos); >- } >- >- >+ # flag indicating existence of at least one item linked via a host record >+ my $hostitemsflag; >+ # adding items linked via host biblios >+ my @hostitemInfos = GetHostItemsInfo($marcrecord); >+ if (@hostitemInfos){ >+ $hostitemsflag =1; >+ push (@itemInfos,@hostitemInfos); >+ } > > $biblioData->{itemInfos} = \@itemInfos; > foreach my $itemInfo (@itemInfos) { > $itemInfoHash{$itemInfo->{itemnumber}} = $itemInfo; > } > >- # Compute the priority rank. >- my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1); >- $biblioData->{reservecount} = $rank; >- foreach my $res (@$reserves) { >- my $found = $res->{'found'}; >- if ( $found && ($found eq 'W') ) { >- $rank--; >+ if ($show_holds_count) { >+ # Compute the priority rank. >+ my ( $rank, $reserves ) = GetReservesFromBiblionumber($biblioNumber,1); >+ $biblioData->{reservecount} = $rank; >+ foreach my $res (@$reserves) { >+ my $found = $res->{'found'}; >+ if ( $found && ($found eq 'W') ) { >+ $rank--; >+ } > } >+ $rank++; >+ $biblioData->{rank} = $rank; > } >- $rank++; >- $biblioData->{rank} = $rank; > } > > # >@@ -528,7 +526,8 @@ $template->param(itemtable_colspan => $itemTableColspan); > > # display infos > $template->param(bibitemloop => $biblioLoop); >-$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority; >+$template->param( showpriority=>$OPACDisplayRequestPriority); >+$template->param( showholds=>$show_holds_count); > # can set reserve date in future > if ( > C4::Context->preference( 'AllowHoldDateInFuture' ) && >-- >1.7.5.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 7398
:
8171
|
8181
|
8430
|
8441
|
8552
|
8625
|
8701
|
8737
|
9008
|
9251
|
9439
|
9733
|
14138