[Koha-patches] [PATCH] Changes to allow librarian to turn off item-level holds in the OPAC. Requires the addition of OPACItemHolds system pref ("Allow OPAC users to place hold on specific items. If OFF, users can only request next available copy." Type: YesNo). Also modifying redirect to show Holds tab in opac-user.pl.

Owen Leonard oleonard at myacpl.org
Tue Apr 1 22:58:23 CEST 2008


---
 .../opac-tmpl/prog/en/modules/opac-reserve.tmpl    |   26 ++++++++++++-------
 opac/opac-reserve.pl                               |    2 +-
 2 files changed, 17 insertions(+), 11 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 b3f6714..ea62e24 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tmpl
@@ -64,6 +64,14 @@
         <input type="hidden" name="item_types_selected" value="1">
         <input type="hidden" name="biblionumber" value="<!-- TMPL_VAR NAME="biblionumber" -->">
         <h3>Place a hold on <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->"><!-- TMPL_VAR NAME="title" --></a><!-- TMPL_IF NAME="author" -->,  by <!-- TMPL_VAR NAME="author" --><!-- /TMPL_IF --></h3>
+
+<!-- TMPL_IF NAME="OPACItemHolds" --> <!-- TMPL_LOOP name="bibitemloop" --> 
+            <!-- TMPL_UNLESS NAME="item-level_itypes" -->
+            <p><strong>Item type:</strong> <!-- TMPL_VAR NAME="description" --></p>
+            <!-- /TMPL_UNLESS -->
+            <!-- TMPL_IF NAME="publicationyear" --><p><strong>Publication year:</strong> <!-- TMPL_VAR NAME="publicationyear" --></p><!-- /TMPL_IF -->
+<!-- /TMPL_IF --><!-- /TMPL_LOOP -->
+
 		<fieldset class="rows holds">
 			<ol>
 				<li><span class="label">For:</span> <!-- TMPL_LOOP NAME="USER_INFO" --><!-- TMPL_VAR NAME="firstname" --> <!-- TMPL_VAR NAME="surname" --> (<!-- TMPL_VAR NAME="cardnumber" -->)
@@ -84,10 +92,11 @@
             </select>
             </li>
             <!-- /TMPL_UNLESS -->
+			
 			<!-- TMPL_IF NAME="forloan" -->
-            <li> <label for="requestany">Place a hold on the next available copy </label>
+            <!-- TMPL_IF NAME="OPACItemHolds" --><li> <label for="requestany">Place a hold on the next available copy </label>
             <input type="checkbox" id="requestany" name="request" checked="checked" value="Any" />
-            </li>
+            </li><!-- TMPL_ELSE --><input type="hidden" name="request" value="Any" /><!-- /TMPL_IF -->
 			</ol>
 		</fieldset>
 
@@ -96,17 +105,14 @@
             <input type="submit" value="Place Hold" />
             <input type="hidden" name="all" value="1" /></p>
             <input type="hidden" name="place_reserve" value="1" /></fieldset>
-			<!-- /TMPL_IF -->            
-        <!-- TMPL_LOOP name="bibitemloop" -->    
-
-            <!-- TMPL_UNLESS NAME="item-level_itypes" -->
-            <p><strong>Item type:</strong> <!-- TMPL_VAR NAME="description" --></p>
-            <!-- /TMPL_UNLESS -->
-            <!-- TMPL_IF NAME="publicationyear" --><p><strong>Publication year:</strong> <!-- TMPL_VAR NAME="publicationyear" --></p><!-- /TMPL_IF -->
+			<!-- /TMPL_IF -->  
+			          
+       <!-- TMPL_IF NAME="OPACItemHolds" --> <!-- TMPL_LOOP name="bibitemloop" -->    
 
             <table id="requestspecific">
 			<caption>Place a hold on a specific copy</caption>
             <tr>
+				<th>&nbsp;</th>
 	            <!-- TMPL_IF NAME="item-level_itypes" -->
                 <th>Hold</th>
                 <!-- TMPL_IF NAME="item-level_itypes" --><th>Item Type</th><!-- /TMPL_IF -->
@@ -181,7 +187,7 @@
         </table>
         <!-- /TMPL_LOOP --> <!-- bibitemloop -->
         <input type="submit" value="Place Hold" />
-        </form>
+        </form><!-- /TMPL_IF -->
     <!-- end of the first form -->
 <!-- /TMPL_IF -->
 
diff --git a/opac/opac-reserve.pl b/opac/opac-reserve.pl
index e5226c1..d89e60a 100755
--- a/opac/opac-reserve.pl
+++ b/opac/opac-reserve.pl
@@ -243,7 +243,7 @@ if ( $query->param('place_reserve') ) {
     } else {
         AddReserve($branch,$borrowernumber,$biblionumber,'a',\@realbi,$rank,$notes,$bibdata->{'title'},$checkitem, $found);
     }
-    print $query->redirect("/cgi-bin/koha/opac-user.pl");
+    print $query->redirect("/cgi-bin/koha/opac-user.pl#opac-user-holds");
 }
 else {
 
-- 
1.5.2.1




More information about the Koha-patches mailing list