Bugzilla – Attachment 13385 Details for
Bug 9043
Adding system preferences to control the visibility of the content on the Advanced Search page
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9043 - Changes to the advanced search page
Bug-9043---Changes-to-the-advanced-search-page.patch (text/plain), 10.85 KB, created by
Srikanth Dhondi
on 2012-11-12 05:01:54 UTC
(
hide
)
Description:
Bug 9043 - Changes to the advanced search page
Filename:
MIME Type:
Creator:
Srikanth Dhondi
Created:
2012-11-12 05:01:54 UTC
Size:
10.85 KB
patch
obsolete
>From 09eb9be26222ef399f27a273ca177f14548aba03 Mon Sep 17 00:00:00 2001 >From: Srikanth Dhondi <srikanth@catalyst.net.nz> >Date: Fri, 9 Nov 2012 15:51:53 +1300 >Subject: [PATCH] Bug 9043 - Changes to the advanced search page > >Added system preferences to enable control of elements that are to be displayed on the advanced search page. > >* New system preferences were added to control the display of > > a) Publication date range > b) Item type selection > c) Language selection > d) Location and Availability > e) Sorting options > f) Subtype limits > >elements. > >* This patch preserves the current default settings. >--- > installer/data/mysql/sysprefs.sql | 6 +++ > installer/data/mysql/updatedatabase.pl | 12 +++++ > .../prog/en/modules/admin/preferences/opac.pref | 46 +++++++++++++++++++- > .../opac-tmpl/prog/en/modules/opac-advsearch.tt | 19 +++++++- > opac/opac-search.pl | 9 ++++ > 5 files changed, 89 insertions(+), 3 deletions(-) > >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index a4e4102..5f7409f 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -386,3 +386,9 @@ INSERT INTO systempreferences (variable,value,explanation,type) VALUES('OPACdidy > INSERT INTO systempreferences (variable,value,explanation,type) VALUES('INTRAdidyoumean',NULL,'Did you mean? configuration for the Intranet. Do not change, as this is controlled by /cgi-bin/koha/admin/didyoumean.pl.','Free'); > INSERT INTO systempreferences (variable, value, options, explanation, type) VALUES ('BlockReturnOfWithdrawnItems', '1', '0', 'If enabled, items that are marked as withdrawn cannot be returned.', 'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); >+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('OpacAdvSeachSorting','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('OpacAdvSeachSubtype','moreonly','Choose whether or not to show the Subtype Limiting options on Fewer and More options pages','neither|moreonly|both','Choice'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index f7e34eb..1184fc1 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -6049,6 +6049,18 @@ if (C4::Context->preference("Version") < TransformToNum($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('OpacAdvSeachSorting','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('OpacAdvSeachSubtype','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) >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 1a9fa09..c043bb7 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 >@@ -526,4 +526,48 @@ OPAC: > choices: > yes: Use > no: "Don't use" >- - "the item collection code when finding items for the shelf browser." >+ - "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: OpacAdvSeachSorting >+ choices: >+ neither: never >+ moreonly: only on More Options page >+ both: always >+ - >+ - "Show subtype search limits" >+ - pref: OpacAdvSeachSubtype >+ choices: >+ neither: never >+ moreonly: only on More Options page >+ both: always >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 55eea18..80e4766 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >@@ -129,6 +129,7 @@ > <a href="/cgi-bin/koha/opac-search.pl?do=Clear">[New search]</a> > > <!-- /SEARCH BUTTONS --></div></div> >+[% IF OpacAdvSearchPubDate == "both" || ( OpacAdvSearchPubDate == "moreonly" && expanded_options) %] > <div class="yui-g"> > <div id="pubrange" class="container"> > <fieldset> >@@ -140,6 +141,9 @@ > <!-- /PUB RANGE OPTION --> > </div> > </div> >+[% END %] >+<!-- ITEM TYPE OPTIONS --> >+[% IF OpacAdvSearchItemType == "both" || (OpacAdvSearchItemType == "moreonly" && expanded_options) %] > <div class="yui-g"> > <div id="advsearches" class="toptabs"> > <ul> >@@ -172,6 +176,9 @@ > </div> > [% END %] > </div> >+ [% END %] >+<!-- /ITEM TYPE OPTIONS --> >+[% IF OpacAdvSearchLanguage == "both" || ( OpacAdvSearchLanguage == "moreonly" && expanded_options) %] > <div id="langfilter"> > <fieldset><legend>Language</legend> > <!-- LANGUAGE LIMIT --> >@@ -189,7 +196,9 @@ > <!-- /LANGUAGE LIMIT --> > </fieldset> > </div> >-[% IF ( expanded_options ) %] >+ [% END %] >+ <!-- SUB TYPE OPTIONS --> >+[% IF OpacAdvSeachSubtype == "both" || ( OpacAdvSeachSubtype == "moreonly" && expanded_options) %] > [% IF ( usmarc ) %] > <!-- SUBTYPE LIMITS --> > <div id="subtypes" class="container"><fieldset> >@@ -257,9 +266,11 @@ > <div id="subtypes_unimarc" class="container"><!-- SUBTYPE LIMITS --> > [% INCLUDE 'subtypes_unimarc.inc' %]</div> > [% END %] >-[% END %] >+[% END %]<!-- SUB TYPE OPTIONS --> > > </div> >+ >+[% IF OpacAdvSearchLocation == "both" || ( OpacAdvSearchLocation == "moreonly" && expanded_options) %] > <div class="yui-g"> > > <div class="yui-u first"> >@@ -292,6 +303,9 @@ > [% END %] > <!-- /AVAILABILITY LIMITS --> > </div> >+[% END %] >+ >+[% IF OpacAdvSeachSorting == "both" || ( OpacAdvSeachSorting == "moreonly" && expanded_options) %] > <div class="yui-u"> > <!-- RANK LIMITS --> > <div id="sortby" class="container"><fieldset><legend>Sorting: </legend> >@@ -301,6 +315,7 @@ > <!-- RANK LIMITS --> > </div> > </div> >+[% END %] > > <div class="yui-g"><div class="container" style="text-align: center;"><!-- SEARCH BUTTONS --> > >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 7677d86..95a100c 100755 >--- a/opac/opac-search.pl >+++ b/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('OpacAdvSeachSorting'), >+ 'OpacAdvSeachSubtype' => C4::Context->preference('OpacAdvSeachSubtype'), >+); >+ >+$template->param( > OpacStarRatings => C4::Context->preference("OpacStarRatings") ); > > if (C4::Context->preference('BakerTaylorEnabled')) { >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 9043
:
13385
|
13858
|
15312
|
15328
|
15329
|
15546
|
15547
|
15792
|
19150
|
19151
|
20316
|
20317
|
20318
|
20717
|
20718
|
21643
|
21644
|
21645
|
27524
|
27525
|
27526
|
29005
|
29006
|
29007
|
29914
|
29915
|
29916
|
29945
|
29946
|
30183
|
30184
|
30185
|
30186
|
30967
|
30968
|
30969
|
31170
|
31557
|
31558
|
31559
|
31560
|
31561
|
33428
|
33429
|
33430
|
33431
|
33432
|
33617
|
33620
|
33947