OpacAddMastheadLibraryPulldown
authorKyle M Hall <kyle.m.hall@gmail.com>
Wed, 20 Jan 2010 14:04:27 +0000 (14:04 +0000)
committerHenri-Damien LAURENT <henridamien.laurent@biblibre.com>
Wed, 20 Jan 2010 21:38:23 +0000 (22:38 +0100)
In the current OPAC, there is no easy way to search a particular library.
By default, a user searches all libraries, or with SearcMyLibraryFirst turn on,
the user's home library. In dev_week, a library pulldown menu existed in the search masthead.

This commit adds the option to bring that pulldown menu back
by turning on the system preference OpacAddMastheadLibraryPulldown

C4/Auth.pm
installer/data/mysql/en/mandatory/sysprefs.sql
installer/data/mysql/fr-FR/1-Obligatoire/unimarc_standard_systemprefs.sql
installer/data/mysql/updatedatabase.pl
koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc
kohaversion.pl

index 33dd36c..f0be27c 100755 (executable)
@@ -337,9 +337,10 @@ sub get_template_and_user {
             'item-level_itypes'          => C4::Context->preference('item-level_itypes'),
             patronimages                 => C4::Context->preference("patronimages"),
             singleBranchMode             => C4::Context->preference("singleBranchMode"),
-            XSLTDetailsDisplay        => C4::Context->preference("XSLTDetailsDisplay"),
-            XSLTResultsDisplay        => C4::Context->preference("XSLTResultsDisplay"),
-                 );
+            XSLTDetailsDisplay           => C4::Context->preference("XSLTDetailsDisplay"),
+            XSLTResultsDisplay           => C4::Context->preference("XSLTResultsDisplay"),
+            BranchesLoop                 => GetBranchesLoop(),
+    );
 
     if ( $in->{'type'} eq "intranet" ) {
         $template->param(
@@ -437,7 +438,8 @@ sub get_template_and_user {
             reviewson                 => C4::Context->preference("reviewson"),
             suggestion                => "" . C4::Context->preference("suggestion"),
             virtualshelves            => "" . C4::Context->preference("virtualshelves"),
-                       OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"),
+            OPACSerialIssueDisplayCount => C4::Context->preference("OPACSerialIssueDisplayCount"),
+            OpacAddMastheadLibraryPulldown => C4::Context->preference("OpacAddMastheadLibraryPulldown"),
         );
     }
        $template->param(listloop=>[{shelfname=>"Freelist", shelfnumber=>110}]);
index 8d3c735..c97e111 100644 (file)
@@ -273,3 +273,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('
 INSERT INTO systempreferences (variable,value,explanation,options,type)VALUES('ShowPatronImageInWebBasedSelfCheck', '0', 'If ON, displays patron image when a patron uses web-based self-checkout', '', 'YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('EnableOpacSearchHistory', '1', 'Enable or disable opac search history', 'YesNo','');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingListAddReserves','1','If ON the patrons on routing lists are automatically added to holds on the issue.','','YesNo');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'OpacAddMastheadLibraryPulldown', '0', '', 'Adds a pulldown menu to select the library to search on the opac masthead.', 'YesNo' );
index 9195d80..59fe561 100644 (file)
@@ -274,3 +274,4 @@ INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('opacSerialDefaultTab', 'serialcollection', 'Ce paramètre définit l''onglet par défaut pour l''affichage des périodiques dans l''OPAC.', 'holdings|serialcollection|subscriptions', 'Choice');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('RoutingListAddReserves','1','Si activé, des reservations sont automatiquement créées pour chaque lecteur de la liste de circulation d''un numéro de périodique','','YesNo');
 INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('SpecifyDueDate',1,'Autorise ou non le bibliothécaire à spécifier la date de retour dans le module circulation','','YesNo');
+INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'OpacAddMastheadLibraryPulldown', '0', '', 'Adds a pulldown menu to select the library to search on the opac masthead.', 'YesNo' );
index 32443a0..262ab0c 100755 (executable)
@@ -3372,6 +3372,12 @@ if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
        print "Upgrade to $DBversion done (added collection and collection_tracking tables for rotataing collection functionnality)\n";
     SetVersion ($DBversion);
 }
+$DBversion = "3.01.00.106";
+if (C4::Context->preference("Version") < TransformToNum($DBversion)) {
+       $dbh->do("INSERT INTO `systempreferences` (variable,value,options,explanation,type) VALUES ( 'OpacAddMastheadLibraryPulldown', '0', '', 'Adds a pulldown menu to select the library to search on the opac masthead.', 'YesNo' )");
+       print "Upgrade done (added OpacAddMastheadLibraryPulldown system preferences)\n";
+    SetVersion ($DBversion);
+}
 
 =item DropAllForeignKeys($table)
 
index f3916e6..63d92b0 100644 (file)
 <div id="fluid">
 <div id="fluid-offset">
 <!-- TMPL_UNLESS NAME="advsearch" --><form name="searchform" method="get" action="/cgi-bin/koha/opac-search.pl" id="searchform">
-    <label for="masthead_search" class="left"> Search <!-- TMPL_IF name="mylibraryfirst" --> (in <!-- TMPL_VAR name="mylibraryfirst" --> only)<!-- /TMPL_IF --></label>
+    <label for="masthead_search" class="left"> Search 
+       <!-- TMPL_UNLESS NAME="OpacAddMastheadLibraryPulldown" -->
+            <!-- TMPL_IF name="mylibraryfirst" --> (in <!-- TMPL_VAR name="mylibraryfirst" --> only)<!-- /TMPL_IF -->
+       <!-- /TMPL_UNLESS -->
+    </label>
+
        <select name="idx" id="masthead_search" class="left" style="max-width:10em;width:10em;">
        <!-- TMPL_IF NAME="ms_kw" -->
         <option selected="selected" value="">Library Catalog</option>
 <!-- TMPL_ELSE -->
         <input type="text" id = "transl1" name="q" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div>
 <!-- /TMPL_IF -->
-   <!-- TMPL_UNLESS NAME="opac_limit_override" -->
-       <!-- TMPL_IF name="mylibraryfirst" --> 
-            <input name="limit" value="branch:<!-- TMPL_VAR name="mylibraryfirst" -->" type="hidden" />
-       <!-- /TMPL_IF -->
-    <!-- /TMPL_UNLESS -->
-    <!-- TMPL_IF NAME="opac_search_limit" -->
-        <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" />
-    <!-- /TMPL_IF -->
+   <!-- TMPL_IF NAME="OpacAddMastheadLibraryPulldown" -->
+      <select name="limit" id="masthead_search" class="left" style="max-width:10em;width:10em;">
+         <option value="">All Libraries</option>
+         <!-- TMPL_LOOP NAME="BranchesLoop" -->
+            <option <!-- TMPL_IF NAME="selected" -->SELECTED<!-- /TMPL_IF --> value="branch:<!-- TMPL_VAR NAME='value' -->"><!-- TMPL_VAR NAME='branchname' --></option>
+         <!-- /TMPL_LOOP -->
+      </select>
+   <!-- TMPL_ELSE -->
+      <!-- TMPL_UNLESS NAME="opac_limit_override" -->
+          <!-- TMPL_IF name="mylibraryfirst" --> 
+               <input name="limit" value="branch:<!-- TMPL_VAR name="mylibraryfirst" -->" type="hidden" />
+          <!-- /TMPL_IF -->
+       <!-- /TMPL_UNLESS -->
+   <!-- /TMPL_IF -->
+   <!-- TMPL_IF NAME="opac_search_limit" -->
+      <input name="limit" value="<!-- TMPL_VAR name="opac_search_limit" -->" type="hidden" />
+   <!-- /TMPL_IF -->
+
+
     <input type="submit" value="Go" id="searchsubmit" class="left" />
 <!-- TMPL_IF NAME="opacbookbag" --><span id="cmspan"></span><!-- /TMPL_IF -->
 
index 65f75f8..4fbb128 100644 (file)
@@ -10,7 +10,7 @@
 use strict;
 
 sub kohaversion {
-    our $VERSION = '3.01.00.105';
+    our $VERSION = '3.01.00.106';
     # version needs to be set this way
     # so that it can be picked up by Makefile.PL
     # during install