Bug 3093 add syspref to turn off multiholds button
authorJane Wagner <jwagner@ptfs.com>
Wed, 11 Nov 2009 15:47:07 +0000 (10:47 -0500)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 11 May 2010 05:09:49 +0000 (17:09 +1200)
Having the place multiple holds button at the top of the OPAC and staff search results has caused problems for some sites with tight holds policies; this syspref allows those sites to turn off the button.

admin/systempreferences.pl
catalogue/search.pl
koha-tmpl/intranet-tmpl/prog/en/modules/catalogue/results.tmpl
koha-tmpl/opac-tmpl/prog/en/modules/opac-results.tmpl
opac/opac-search.pl

index b39a922..ecdfa05 100755 (executable)
@@ -241,6 +241,7 @@ $tabsysprefs{sortbynonfiling}         = "Searching";
 $tabsysprefs{QueryAutoTruncate}       = "Searching";
 $tabsysprefs{QueryRemoveStopwords}    = "Searching";
 $tabsysprefs{AdvancedSearchTypes}     = "Searching";
+$tabsysprefs{DisplayMultiPlaceHold}   = "Searching";
 
 # EnhancedContent
 $tabsysprefs{AmazonEnabled}          = "EnhancedContent";
index ba0d044..5f0286b 100755 (executable)
@@ -149,6 +149,7 @@ use C4::VirtualShelves qw(GetRecentShelves);
 use POSIX qw(ceil floor);
 use C4::Branch; # GetBranches
 
+my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold");
 # create a new CGI object
 # FIXME: no_undef_params needs to be tested
 use CGI qw('-no_undef_params');
@@ -541,6 +542,7 @@ for (my $i=0;$i<@servers;$i++) {
             $template->param(query_cgi => $query_cgi);
             $template->param(query_desc => $query_desc);
             $template->param(limit_desc => $limit_desc);
+            $template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold);
                        $template->param (z3950_search_params => C4::Search::z3950_search_args($query_desc));
             if ($query_desc || $limit_desc) {
                 $template->param(searchdesc => 1);
index bfc51fb..8ad3609 100644 (file)
@@ -232,7 +232,9 @@ function GetZ3950Terms(){
                 <a href="#" class="highlight_toggle" id="highlight_toggle_off">Unhighlight</a>
                 <a href="#" class="highlight_toggle" id="highlight_toggle_on">Highlight</a>
                 <!-- TMPL_IF NAME="CAN_user_reserveforothers" -->
-                | <a href="/cgi-bin/koha/catalogue/search.pl" onclick="placeHold(); return false;">Place Hold</a>
+                       <!-- TMPL_IF NAME="DisplayMultiPlaceHold" -->
+                  <input type="button" onclick="placeHold(); return false;" value="Place Hold"/>
+                       <!-- /TMPL_IF -->
                 <!-- /TMPL_IF -->
                <span class="addto"></span>
 
index aa9f45e..040de40 100644 (file)
@@ -180,12 +180,14 @@ $(document).ready(function(){
     });
 <!-- TMPL_IF NAME="RequestOnOpac" -->
   <!-- TMPL_IF NAME="opacuserlogin" -->
+  <!-- TMPL_IF NAME="DisplayMultiPlaceHold" -->
     $("#placehold").html("<input class=\"submit\" type=\"submit\" value=\""+_("Place Hold")+"\"/>");
        $("#placehold").find("input:submit").click(function(){
         holdMultiple();
                return false;
        });
   <!-- /TMPL_IF -->
+  <!-- /TMPL_IF -->
 <!-- /TMPL_IF -->
     $("#holdDetails").hide();
 
index e1d61fa..34491c3 100755 (executable)
@@ -40,6 +40,7 @@ use URI::Escape;
 use Storable qw(thaw freeze);
 
 
+my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold");
 # create a new CGI object
 # FIXME: no_undef_params needs to be tested
 use CGI qw('-no_undef_params');
@@ -533,6 +534,7 @@ for (my $i=0;$i<=@servers;$i++) {
             $template->param(query_cgi => $query_cgi);
             $template->param(query_desc => $query_desc);
             $template->param(limit_desc => $limit_desc);
+            $template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold);
             if ($query_desc || $limit_desc) {
                 $template->param(searchdesc => 1);
             }