[Koha-patches] [PATCH] Fix for Bug 4080, OPAC hold screen doesn't obey OPACDisplayRequestPriority pref

Owen Leonard oleonard at myacpl.org
Fri Jan 29 21:06:53 CET 2010


---
 .../opac-tmpl/prog/en/modules/opac-reserve.tmpl    |   12 +++++++-----
 opac/opac-reserve.pl                               |   20 ++++++++++----------
 2 files changed, 17 insertions(+), 15 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
index 6f33b09..0fff56c 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
@@ -52,7 +52,7 @@
     function changeSelection (newCopiesRowId, isSpecific) {
         if (copiesRowId && ((copiesRowId != newCopiesRowId) || (wasSpecific != isSpecific))) {
             var biblioNum = suffixOf(copiesRowId, "_");
-            
+
             // If the 'specific copy' radio button was checked
               if (wasSpecific && (copiesRowId != newCopiesRowId)) {
                 // Find the selected copy
@@ -79,7 +79,7 @@
             return false;
         }
         $(".copiesrow:not(" + newCopiesRowId + ")").hide();
-        
+
         // Show the specific copy table for this radio button.
         $(newCopiesRowId).show();
     });
@@ -160,7 +160,7 @@
     <div id="bd">
 	  <div id="yui-g">
         <div id="holds" class="container">
-      
+
           <!-- TMPL_IF NAME="message" -->
             <!-- TMPL_IF NAME="GNA" -->
               <div class="dialog alert">
@@ -238,7 +238,9 @@
                   <!-- TMPL_UNLESS NAME="item-level_itypes" -->
                     <th>Item Type</th>
                   <!-- /TMPL_UNLESS -->
+                  <!-- TMPL_IF NAME="showpriority" -->
                   <th>Priority</th>
+                  <!-- /TMPL_IF -->
 		  <!-- TMPL_IF NAME="reserve_in_future" -->
 		  <th>Hold Starts on Date</th>
 		  <!-- /TMPL_IF -->
@@ -297,7 +299,7 @@
 						<!-- TMPL_VAR NAME="description" -->
                       </td>
                     <!-- /TMPL_UNLESS -->
-                    <td><!-- TMPL_VAR name="rank" --> out of <!-- TMPL_VAR NAME="reservecount" --></td>
+                    <!-- TMPL_IF NAME="showpriority" --><td><!-- TMPL_VAR name="rank" --> out of <!-- TMPL_VAR NAME="reservecount" --></td><!-- /TMPL_IF -->
 		    <!-- TMPL_IF NAME="reserve_in_future" -->
 		    <td>
 			<input name="reserve_date_<!-- TMPL_VAR NAME="biblionumber" -->" id="reserve_date_<!-- TMPL_VAR NAME="biblionumber" -->" size="10">
@@ -465,7 +467,7 @@
                                   <span class="notforloan">Not for loan (<!-- TMPL_VAR NAME="notforloanvalue" -->)</span>
                                 <!-- /TMPL_IF -->
                                 <!-- TMPL_IF NAME="reservedate"-->
-                                  <span class="waiting"><!-- TMPL_IF NAME="waitingdate" -->Waiting<!-- TMPL_ELSE -->On hold<!-- /TMPL_IF --> for patron 
+                                  <span class="waiting"><!-- TMPL_IF NAME="waitingdate" -->Waiting<!-- TMPL_ELSE -->On hold<!-- /TMPL_IF --> for patron
                                     <!-- TMPL_IF NAME="waitingdate" -->at<!-- TMPL_ELSE -->expected at<!-- /TMPL_IF --> <!-- TMPL_VAR NAME="ExpectedAtLibrary" -->
                                     since
                                     <!-- TMPL_IF NAME="waitingdate" --><!-- TMPL_VAR NAME="waitingdate" --><!-- TMPL_ELSE --><!-- TMPL_IF name="reservedate" --><!-- TMPL_VAR NAME="reservedate" --><!-- /TMPL_IF --><!-- /TMPL_IF -->.
diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl
index be3c77a..675b901 100755
--- a/opac/opac-reserve.pl
+++ b/opac/opac-reserve.pl
@@ -45,7 +45,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
         debug           => 1,
     }
 );
-
+my $OPACDisplayRequestPriority = (C4::Context->preference("OPACDisplayRequestPriority")) ? 1 : 0;
 sub get_out ($$$) {
 	output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output;
 	exit;
@@ -167,7 +167,7 @@ if ( $query->param('place_reserve') ) {
         my $branch = $query->param('branch');
         $selectedItems = "$bib/$item/$branch/";
     }
-    
+
     my @selectedItems = split /\//, $selectedItems;
 
     # Make sure there is a biblionum/itemnum/branch triplet for each item.
@@ -190,7 +190,7 @@ if ( $query->param('place_reserve') ) {
 
         my $biblioData = $biblioDataHash{$biblioNum};
         my $found;
-        
+
 	# Check for user supplied reserve date
 	my $startdate;
 	if (
@@ -216,7 +216,7 @@ if ( $query->param('place_reserve') ) {
             # Inserts a null into the 'itemnumber' field of 'reserves' table.
             $itemNum = undef;
         }
-        
+
         # Here we actually do the reserveration. Stage 3.
         AddReserve($branch, $borrowernumber, $biblioNum, 'a', [$biblioNum], $rank, $startdate, $notes,
                    $biblioData->{'title'}, $itemNum, $found) if ($canreserve);
@@ -333,12 +333,12 @@ foreach my $biblioNum (@biblionumbers) {
         my $fee = GetReserveFee(undef, $borrowernumber, $itemInfo->{'biblionumber'}, 'a',
                                 ( $itemInfo->{'biblioitemnumber'} ) );
         $itemInfo->{'reservefee'} = sprintf "%.02f", ($fee ? $fee : 0.0);
-        
+
         if ($itemLevelTypes && $itemInfo->{itype}) {
             $itemInfo->{description} = $itemTypes->{$itemInfo->{itype}}{description};
             $itemInfo->{imageurl} = getitemtypeimagesrc() . "/". $itemTypes->{$itemInfo->{itype}}{imageurl};
         }
-        
+
         if (!$itemInfo->{'notforloan'} && !($itemInfo->{'itemnotforloan'} > 0)) {
             $biblioLoopIter{forloan} = 1;
         }
@@ -449,13 +449,13 @@ foreach my $biblioNum (@biblionumbers) {
             $itemLoopIter->{waitingdate} = format_date($wait_hashref->{waitingdate});
         }
 	$itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} );
-     
+
     # Show serial enumeration when needed
     if ($itemLoopIter->{enumchron}) {
-        $itemdata_enumchron = 1;    
+        $itemdata_enumchron = 1;
     }
     $template->param( itemdata_enumchron => $itemdata_enumchron );
-        
+
         push @{$biblioLoopIter{itemLoop}}, $itemLoopIter;
     }
 
@@ -489,7 +489,7 @@ $template->param(itemtable_colspan => $itemTableColspan);
 
 # display infos
 $template->param(bibitemloop => $biblioLoop);
-
+$template->param( showpriority=>1 ) if $OPACDisplayRequestPriority;
 # can set reserve date in future
 if (
     C4::Context->preference( 'AllowHoldDateInFuture' ) &&
-- 
1.6.3.3




More information about the Koha-patches mailing list