From 508f81ff75b401ccfaca69a90d0a0c5e687b58bb Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 19 Feb 2013 14:49:20 +0100 Subject: [PATCH] Bug 9043: Changes to the advanced search page New syspref: OpacAdvSearch. This syspref is multivalued and you can add or remove some elements on the adv search page. --- installer/data/mysql/sysprefs.sql | 1 + installer/data/mysql/updatedatabase.pl | 7 +++++++ .../prog/en/modules/admin/preferences/opac.pref | 11 ++++++++++ .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 21 ++++++++++++++++++-- opac/opac-search.pl | 5 ++++- 5 files changed, 42 insertions(+), 3 deletions(-) diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql index 32ce6ab..e0b1ecf 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -198,6 +198,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('OAI-PMH:MaxCount','50',NULL,'OAI-PMH maximum number of records by answer to ListRecords and ListIdentifiers queries','Integer'), ('OCLCAffiliateID','','','Use with FRBRizeEditions and XISBN. You can sign up for an AffiliateID here: http://www.worldcat.org/wcpa/do/AffiliateUserServices?method=initSelfRegister','free'), ('OpacAddMastheadLibraryPulldown','0','','Adds a pulldown menu to select the library to search on the opac masthead.','YesNo'), +('OpacAdvSearch','pubdate|itemtype|language|subtype|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'), diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index 74aeb3e..02ac66e 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -7067,6 +7067,13 @@ if ( CheckVersion($DBversion) ) { SetVersion($DBversion); } +$DBversion = "3.13.00.XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearch','pubdate|itemtype|language|subtype|sorting|location','Show search options','pubdate|itemtype|language|subtype|sorting|location','multiple');"); + print "Upgrade to $DBversion done (Bug 9043: Add OpacAdvSearch)\n"; + SetVersion ($DBversion); +} + =head1 FUNCTIONS =head2 TableExists($table) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref index a75c7ef..810ff34 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref @@ -619,3 +619,14 @@ OPAC: - pref: PatronSelfRegistrationAdditionalInstructions type: textarea class: html + Advanced Search Options: + - + - Show search options + - pref: OpacAdvSearch + multiple: + pubdate: Publication date + itemtype: Item types + language: Language + subtype: Subtypes + sorting: Sorting + location: Location diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt index 4c1c552..8b91078 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt @@ -154,6 +154,7 @@ [New search] +[% IF OpacAdvSearch.grep('pubdate').size > 0 || expanded_options %]
@@ -165,7 +166,10 @@
+[% END %] +
+[% IF OpacAdvSearch.grep('itemtype').size > 0 || expanded_options %]
    [% FOREACH advsearchloo IN advancedsearchesloop %] @@ -197,6 +201,9 @@
[% END %]
+[% END %] + +[% IF OpacAdvSearch.grep('language').size > 0 || expanded_options %]
Language @@ -214,7 +221,9 @@
-[% IF ( expanded_options ) %] +[% END %] + +[% IF OpacAdvSearch.grep('subtype').size > 0 || expanded_options %] [% IF ( usmarc ) %]
@@ -287,10 +296,11 @@ [% INCLUDE 'subtypes_unimarc.inc' %]
[% END %] [% END %] - +
+[% IF OpacAdvSearch.grep('location').size > 0 || expanded_options %]
[% UNLESS ( singleBranchMode ) %] @@ -321,6 +331,9 @@ [% END %]
+[% END%] + +[% IF OpacAdvSearch.grep('sorting').size > 0 || expanded_options %]
Sorting: @@ -329,8 +342,10 @@
+[% END %]
+[% IF OpacAdvSearch.size > 0 || expanded_options %]
@@ -344,6 +359,8 @@
+[% END %] +