@@ -, +, @@ --- installer/data/mysql/sysprefs.sql | 6 +++ installer/data/mysql/updatedatabase.pl | 12 +++++ .../prog/en/modules/admin/preferences/opac.pref | 45 ++++++++++++++++++++ .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 19 +++++++- opac/opac-search.pl | 9 ++++ 5 files changed, 89 insertions(+), 2 deletions(-) --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -411,3 +411,9 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReviews','0','Display book review snippets from IDreamBooks.com','','YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksReadometer','0','Display Readometer from IDreamBooks.com','','YesNo'); INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('IDreamBooksResults','0','Display IDreamBooks.com rating in search results','','YesNo'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchItemType','both','Choose whether or not to show Item Type selection options on Fewer and More options pages','neither|moreonly|both','Choice'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchLanguage','both','Choose whether or not to show Langague selection options on Fewer and More options pages','neither|moreonly|both','Choice'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchLocation','both','Choose whether or not to show Location Availability selection options on Fewer and More options pages','neither|moreonly|both','Choice'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchPubDate','both','Choose whether or not to show Publication Date Range selection options on Fewer and More options pages','neither|moreonly|both','Choice'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchSorting','both','Choose whether or not to show the Sorting options on Fewer and More options pages','neither|moreonly|both','Choice'); +INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchSubtype','moreonly','Choose whether or not to show the Subtype Limiting options on Fewer and More options pages','neither|moreonly|both','Choice'); --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -6400,6 +6400,18 @@ if ( CheckVersion($DBversion) ) { } +$DBversion = 'XXX'; +if (C4::Context->preference("Version") < TransformToNum($DBversion)) { + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchItemType','both','Choose whether or not to show Item Type selection options on Fewer and More options pages','neither|moreonly|both','Choice');"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchLanguage','both','Choose whether or not to show Langague selection options on Fewer and More options pages','neither|moreonly|both','Choice');"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchLocation','both','Choose whether or not to show Location Availability selection options on Fewer and More options pages','neither|moreonly|both','Choice');"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchPubDate','both','Choose whether or not to show Publication Date Range selection options on Fewer and More options pages','neither|moreonly|both','Choice');"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchSorting','both','Choose whether or not to show the Sorting options on Fewer and More options pages','neither|moreonly|both','Choice');"); + $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacAdvSearchSubtype','moreonly','Choose whether or not to show the Subtype Limiting options on Fewer and More options pages','neither|moreonly|both','Choice');"); + print "Upgrade to $DBversion done (Add OpacAdvSearchItemType, OpacAdvSearchLanguage, OpacAdvSearchLocation, OpacAdvSearchPubDate, OpacAdvSeachSorting, and OpacAdvSeachSubtype to syspref)\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 @@ -573,3 +573,48 @@ OPAC: - pref: PatronSelfRegistrationBorrowerUnwantedField class: multi - (separate columns with |) + - "the item collection code when finding items for the shelf browser." + + Advanced Search Options: + - + - "Show item type search options" + - pref: OpacAdvSearchItemType + choices: + neither: never + moreonly: only on More Options page + both: always + - + - "Show publication date range search options" + - pref: OpacAdvSearchPubDate + choices: + neither: never + moreonly: only on More Options page + both: always + - + - "Show language search options" + - pref: OpacAdvSearchLanguage + choices: + neither: never + moreonly: only on More Options page + both: always + - + - "Show location and availability search options" + - pref: OpacAdvSearchLocation + choices: + neither: never + moreonly: only on More Options page + both: always + - + - "Show sorting search options" + - pref: OpacAdvSearchSorting + choices: + neither: never + moreonly: only on More Options page + both: always + - + - "Show subtype search limits" + - pref: OpacAdvSearchSubtype + choices: + neither: never + moreonly: only on More Options page + both: always --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt +++ a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt @@ -129,6 +129,7 @@ [New search] +[% IF OpacAdvSearchPubDate == "both" || ( OpacAdvSearchPubDate == "moreonly" && expanded_options) %]
@@ -140,6 +141,9 @@
+[% END %] + +[% IF OpacAdvSearchItemType == "both" || (OpacAdvSearchItemType == "moreonly" && expanded_options) %]
[% END %]
+ [% END %] + +[% IF OpacAdvSearchLanguage == "both" || ( OpacAdvSearchLanguage == "moreonly" && expanded_options) %]
Language @@ -189,7 +196,9 @@
-[% IF ( expanded_options ) %] + [% END %] + +[% IF OpacAdvSeachSubtype == "both" || ( OpacAdvSeachSubtype == "moreonly" && expanded_options) %] [% IF ( usmarc ) %]
@@ -261,9 +270,11 @@
[% INCLUDE 'subtypes_unimarc.inc' %]
[% END %] -[% END %] +[% END %]
+ +[% IF OpacAdvSearchLocation == "both" || ( OpacAdvSearchLocation == "moreonly" && expanded_options) %]
@@ -296,6 +307,9 @@ [% END %]
+[% END %] + +[% IF OpacAdvSeachSorting == "both" || ( OpacAdvSeachSorting == "moreonly" && expanded_options) %]
Sorting: @@ -305,6 +319,7 @@
+[% END %]
--- a/opac/opac-search.pl +++ a/opac/opac-search.pl @@ -128,6 +128,15 @@ $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHo $template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResultsFound') ); $template->param( + 'OpacAdvSearchItemType' => C4::Context->preference('OpacAdvSearchItemType'), + 'OpacAdvSearchPubDate' => C4::Context->preference('OpacAdvSearchPubDate'), + 'OpacAdvSearchLanguage' => C4::Context->preference('OpacAdvSearchLanguage'), + 'OpacAdvSearchLocation' => C4::Context->preference('OpacAdvSearchLocation'), + 'OpacAdvSeachSorting' => C4::Context->preference('OpacAdvSearchSorting'), + 'OpacAdvSeachSubtype' => C4::Context->preference('OpacAdvSearchSubtype'), +); + +$template->param( OpacStarRatings => C4::Context->preference("OpacStarRatings") ); if (C4::Context->preference('BakerTaylorEnabled')) { --