[Koha-patches] [PATCH] Bug 3173 Place Hold link visible in OPAC even if syspref turned off

Jane Wagner jwagner at ptfs.com
Thu Apr 30 16:58:39 CEST 2009


If the syspref RequestOnOpac is turned off, the link to place a hold does not
show in the detail page.  However, the link is still present in the results
list as well as in the basket and in lists.  Modified templates to check
for the syspref and to obey it.

NOTE:  This does not turn off the display of the Holds tab in the OPAC
user account.  I think there are situations where library staff may be
allowed to place holds but users are not allowed to do so through the
OPAC.  Leaving the Holds tab visible shows users what they have on hold,
but does not allow them to place holds.  It does allow users to cancel
holds.  If there is a need to hide this tab, that would probably be
best accomplished by a separate syspref.
---
 .../opac-tmpl/prog/en/modules/opac-basket.tmpl     |    4 +++-
 .../opac-tmpl/prog/en/modules/opac-opensearch.tmpl |    5 ++++-
 .../opac-tmpl/prog/en/modules/opac-results.tmpl    |    5 ++++-
 .../opac-tmpl/prog/en/modules/opac-shelves.tmpl    |    5 ++++-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
index a102457..cef2688 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-basket.tmpl
@@ -76,8 +76,10 @@ function tagAdded() {
 		);
 	        return false;
 	    });
+<!-- TMPL_IF NAME="RequestOnOpac" -->
         $(".holdsep").text("| ");
         $(".hold").text("Place Hold");
+<!-- /TMPL_IF -->
   
         <!-- TMPL_IF NAME="TagsEnabled" -->
         <!-- TMPL_IF NAME="TagsInputOnList" -->
@@ -350,4 +352,4 @@ function tagAdded() {
 </div>
 </div>
 </body>
-</html>
\ No newline at end of file
+</html>
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tmpl
index beeb750..773f208 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-opensearch.tmpl
@@ -44,7 +44,10 @@
                         <!-- TMPL_IF name="pages" -->. <!-- TMPL_VAR name="pages"  ESCAPE="html" --><!-- /TMPL_IF -->
                         <!-- TMPL_IF name="notes" -->, <!-- TMPL_VAR name="notes"  ESCAPE="html" --><!-- /TMPL_IF -->
                         <!-- TMPL_IF name="size" --> <!-- TMPL_VAR name="size"  ESCAPE="html" -->. <!-- /TMPL_IF -->
-                        <!-- TMPL_IF name="isbn" --> <!-- TMPL_VAR name="isbn"  ESCAPE="html" --><!-- /TMPL_IF --> </p><p><a href="<!-- TMPL_VAR NAME="OPACBaseURL" -->/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold on <i><!-- TMPL_VAR NAME="title_nospan" --></i></a></p>
+                        <!-- TMPL_IF name="isbn" --> <!-- TMPL_VAR name="isbn"  ESCAPE="html" --><!-- /TMPL_IF --> </p><p>
+<!-- TMPL_IF NAME="RequestOnOpac" -->
+<a href="<!-- TMPL_VAR NAME="OPACBaseURL" -->/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold on <i><!-- TMPL_VAR NAME="title_nospan" --></i></a></p>
+<!-- /TMPL_IF -->
 						]]></description>
        <guid><!-- TMPL_VAR NAME="OPACBaseURL" -->/cgi-bin/koha/opac-detail.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" --></guid>
      </item>
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl
index 60c7858..1d592d1 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl
@@ -134,11 +134,13 @@ $(document).ready(function(){
         $("#bookbag_form").unCheckCheckboxes();
         return false;
     });
+<!-- TMPL_IF NAME="RequestOnOpac" -->
     $("#placehold").html("<input class=\"submit\" type=\"submit\" value=\"Place Hold\"/>");
 	$("#placehold").find("input:submit").click(function(){
         holdMultiple();
 		return false;
 	});
+<!-- /TMPL_IF -->
     $("#holdDetails").hide();
 
 	<!-- TMPL_IF NAME="TagsEnabled" -->
@@ -414,7 +416,8 @@ $(document).ready(function(){
 				<!-- TMPL_IF Name="searchhighlightblob" --><span class="results_summary"><span class="label">Match:</span> <!-- TMPL_VAR NAME="searchhighlightblob" --></span><!-- /TMPL_IF -->
 
 <span class="results_summary actions"><span class="label">Actions:</span>
-				<!-- TMPL_IF name="RequestOnOpac" --><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- add back when available 0 holds in queue--> <!-- /TMPL_IF --><!-- /TMPL_UNLESS --><!-- /TMPL_IF -->
+                                <!-- TMPL_IF name="RequestOnOpac" --><!-- TMPL_UNLESS NAME="norequests" --><!-- TMPL_IF NAME="opacuserlogin" --><a class="hold" href="/cgi-bin/koha/opac-reserve.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->">Place Hold</a><!-- add back when available 0 holds in queue--> <!-- /TMPL_IF --><!-- /TMPL_UNLESS --><!-- /TMPL_IF -->
+
 
 				<!-- TMPL_IF NAME="opacuserlogin" --><!-- TMPL_IF NAME="loggedinusername" --><!-- TMPL_IF NAME="virtualshelves" --><a class="addtolist" href="/cgi-bin/koha/opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->" onclick="Dopop('opac-addbybiblionumber.pl?biblionumber=<!-- TMPL_VAR NAME="biblionumber" -->'); return false;">Save to Lists</a>
     			<!-- /TMPL_IF --><!-- /TMPL_IF --><!-- /TMPL_IF -->
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl
index 18ebcf2..0046652 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-shelves.tmpl
@@ -96,8 +96,9 @@ $(function() {
 });
 
 $(document).ready(function(){
+<!-- TMPL_IF NAME="RequestOnOpac" -->
     $(".hold").html("Place Hold");
-
+<!-- /TMPL_IF -->
     <!-- TMPL_IF NAME="TagsEnabled" -->
     $("#tagsel_tag").text("Tag");
     $("#tagsel_button").click(function(){
@@ -177,7 +178,9 @@ $(document).ready(function(){
                          <input type="submit" class="deleteshelf" value="Delete List" onclick="return confirmDelete(_('Are you sure you want to remove this List?'));"/>
                       </form>
                       <a href="#" class="send tag_hides" onclick="open(CGIBIN+'opac-sendshelf.pl?shelfid=<!-- TMPL_VAR NAME="shelfnumber" -->','win_form','dependant=yes,scrollbars=no,resizable=no,height=300,width=450,top=50,left=100')">Send List</a>
+<!-- TMPL_IF NAME="RequestOnOpac" -->
                       <a href="#" class="hold tag_hides" onclick="holdSelections();return false;"></a>
+<!-- /TMPL_IF -->
                     <!-- /div -->
                     <a id="tagsel_tag" href="#" onclick="tagSelected(); return false;"></a>                 
                     <span id="tagsel_form" style="display:none">
-- 
1.5.6.5




More information about the Koha-patches mailing list