@@ -, +, @@
search page
---
installer/data/mysql/sysprefs.sql | 2 ++
installer/data/mysql/updatedatabase.pl | 19 +++++++++++++++++++
.../prog/en/modules/admin/preferences/opac.pref | 21 +++++++++++++++++++++
.../bootstrap/en/modules/opac-advsearch.tt | 19 ++++++++++++++++---
opac/opac-search.pl | 14 +++++++++++---
5 files changed, 69 insertions(+), 6 deletions(-)
--- a/installer/data/mysql/sysprefs.sql
+++ a/installer/data/mysql/sysprefs.sql
@@ -213,6 +213,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, `
('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'),
('OPACAcquisitionDetails','0','','Show the acquisition details at the OPAC','YesNo'),
('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'),
+('OpacAdvSearchMoreOptions','pubdate|itemtype|language|subtype|sorting|location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple'),
+('OpacAdvSearchOptions','pubdate|itemtype|language|sorting|location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple'),
('OPACAllowHoldDateInFuture','0','','If set, along with the AllowHoldDateInFuture system preference, OPAC users can set the date of a hold to be in the future.','YesNo'),
('OpacAllowPublicListCreation','1',NULL,'If set, allows opac users to create public lists','YesNo'),
('OpacAllowSharingPrivateLists','0',NULL,'If set, allows opac users to share private lists with other patrons','YesNo'),
--- a/installer/data/mysql/updatedatabase.pl
+++ a/installer/data/mysql/updatedatabase.pl
@@ -8577,6 +8577,25 @@ if ( CheckVersion($DBversion) ) {
SetVersion ($DBversion);
}
+
+
+
+
+
+
+$DBversion = "3.17.00.XXX";
+if ( CheckVersion($DBversion) ) {
+ $dbh->do(q{
+ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchOptions','pubdate|itemtype|language|sorting|location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple');
+ });
+
+ $dbh->do(q{
+ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchMoreOptions','pubdate|itemtype|language|subtype|sorting|location','Show search options for the expanded view (More options)','pubdate|itemtype|language|subtype|sorting|location','multiple');
+ });
+ print "Upgrade to $DBversion done (Bug 9043: Add system preference OpacAdvSearchOptions and OpacAdvSearchMoreOptions)\n";
+ SetVersion ($DBversion);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref
@@ -663,3 +663,24 @@ OPAC:
- pref: PatronSelfRegistrationAdditionalInstructions
type: textarea
class: html
+ Advanced Search Options:
+ -
+ - Show search options
+ - pref: OpacAdvSearchOptions
+ multiple:
+ pubdate: Publication date
+ itemtype: Item types
+ language: Language
+ subtype: Subtypes
+ sorting: Sorting
+ location: Location and availability
+ -
+ - Show search options for the expanded view
+ - pref: OpacAdvSearchMoreOptions
+ multiple:
+ pubdate: Publication date
+ itemtype: Item types
+ language: Language
+ subtype: Subtypes
+ sorting: Sorting
+ location: Location and availability
--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt
+++ a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-advsearch.tt
@@ -120,6 +120,7 @@
+ [% IF ( ( OpacAdvSearchOptions.grep('itemtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('itemtype').size > 0 and expanded_options ) ) %]
+ [% IF ( ( OpacAdvSearchOptions.grep('pubdate').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('pubdate').size > 0 and expanded_options ) ) %]
@@ -164,7 +167,9 @@
+ [% END %]
+ [% IF ( ( OpacAdvSearchOptions.grep('language').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('language').size > 0 and expanded_options ) ) %]
+ [% END %]
+ [% IF ( ( OpacAdvSearchOptions.grep('location').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('location').size > 0 and expanded_options ) ) %]
[% UNLESS ( singleBranchMode ) %]
@@ -223,7 +230,9 @@
[% END # / UNLESS singleBranchMode %]
+ [% END %]
+ [% IF ( ( OpacAdvSearchOptions.grep('sorting').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('sorting').size > 0 and expanded_options ) ) %]
@@ -237,9 +246,10 @@
+ [% END %]
- [% IF ( expanded_options ) %]
+ [% IF ( ( OpacAdvSearchOptions.grep('subtype').size > 0 and not expanded_options ) or ( OpacAdvSearchMoreOptions.grep('subtype').size > 0 and expanded_options ) ) %]
[% IF ( usmarc ) %]
@@ -340,6 +350,7 @@
+ [% IF ( OpacAdvSearchMoreOptions.size > 0 and expanded_options ) or ( OpacAdvSearchOptions.size > 0 and not expanded_options ) %]
@@ -351,15 +362,17 @@
+ [% END %]
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK searchbuttons %]
- [% IF ( expanded_options ) %]
+
+ [% IF expanded_options %]
[Fewer options]
- [% ELSE %]
+ [% ELSIF not expanded_options %]
[More options]
[% END %]
[New search]
--- a/opac/opac-search.pl
+++ a/opac/opac-search.pl
@@ -295,9 +295,17 @@ if ( $template_type && $template_type eq 'advsearch' ) {
}
}
- $template->param(uc( C4::Context->preference("marcflavour")) => 1, # we already did this for UNIMARC
- advsearch => 1,
- search_boxes_loop => \@search_boxes_array);
+
+ my @advsearch_limits = split /\|/, C4::Context->preference('OpacAdvSearchOptions');
+ my @advsearch_more_limits = split /\|/,
+ C4::Context->preference('OpacAdvSearchMoreOptions');
+ $template->param(
+ uc( C4::Context->preference("marcflavour") ) => 1, # we already did this for UNIMARC
+ advsearch => 1,
+ search_boxes_loop => \@search_boxes_array,
+ OpacAdvSearchOptions => \@advsearch_limits,
+ OpacAdvSearchMoreOptions => \@advsearch_more_limits,
+ );
# use the global setting by default
if ( C4::Context->preference("expandedSearchOption") == 1 ) {
--