From bb5e5ad68d315d7ecd0e5baf555ef220339ff486 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 ca9b6bd..7848aa9 100644 --- a/installer/data/mysql/sysprefs.sql +++ b/installer/data/mysql/sysprefs.sql @@ -416,3 +416,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ('IntranetNumbersPreferPhrase','0', NULL, 'Control the use of phr operator in callnumber and standard number staff client searches', 'YesNo'); INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UNIMARCField100Language', 'fre','UNIMARC field 100 default language',NULL,'short'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('Persona',0,'Use Mozilla Persona for login','','YesNo'); +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'); diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl index a44e4e8..9e57a53 100755 --- a/installer/data/mysql/updatedatabase.pl +++ b/installer/data/mysql/updatedatabase.pl @@ -6438,6 +6438,13 @@ if ( CheckVersion($DBversion) ) { } +$DBversion = "3.11.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 6d6672c..17b3baf 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 @@ -580,3 +580,14 @@ OPAC: - pref: PatronSelfRegistrationBorrowerUnwantedField class: multi - (separate columns with |) + 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 825e8be..2a067ca 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt @@ -142,6 +142,7 @@ [New search] +[% IF OpacAdvSearch.grep('pubdate').size > 0 || expanded_options %]
@@ -153,7 +154,10 @@
+[% END %] +
+[% IF OpacAdvSearch.grep('itemtype').size > 0 || expanded_options %]
    [% FOREACH advsearchloo IN advancedsearchesloop %] @@ -185,6 +189,9 @@
[% END %]
+[% END %] + +[% IF OpacAdvSearch.grep('language').size > 0 || expanded_options %]
Language @@ -202,7 +209,9 @@
-[% IF ( expanded_options ) %] +[% END %] + +[% IF OpacAdvSearch.grep('subtype').size > 0 || expanded_options %] [% IF ( usmarc ) %]
@@ -275,10 +284,11 @@ [% INCLUDE 'subtypes_unimarc.inc' %]
[% END %] [% END %] - +
+[% IF OpacAdvSearch.grep('location').size > 0 || expanded_options %]
[% UNLESS ( singleBranchMode ) %] @@ -309,6 +319,9 @@ [% END %]
+[% END%] + +[% IF OpacAdvSearch.grep('sorting').size > 0 || expanded_options %]
Sorting: @@ -317,8 +330,10 @@
+[% END %]
+[% IF OpacAdvSearch.size > 0 || expanded_options %]
@@ -332,6 +347,8 @@
+[% END %] +