Bugzilla – Attachment 19151 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]
[ALT 2/2] Bug 9043: Changes to the advanced search page
Bug-9043-Changes-to-the-advanced-search-page.patch (text/plain), 6.55 KB, created by
Jonathan Druart
on 2013-06-19 10:55:21 UTC
(
hide
)
Description:
[ALT 2/2] Bug 9043: Changes to the advanced search page
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2013-06-19 10:55:21 UTC
Size:
6.55 KB
patch
obsolete
>From b52d36ddce07a45db18d6341a02f0c6bfd88f822 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >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 fbd0387..df06695 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -427,3 +427,4 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('UseCourseReserves', '0', 'Enable the course reserves feature.', NULL, 'YesNo'); > INSERT IGNORE INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacHoldNotes',0,'Show hold notes on OPAC','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES ('CalculateFinesOnReturn','1','Switch to control if overdue fines are calculated on return or not', '', '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 5963d24..2b70220 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -7010,6 +7010,13 @@ CREATE TABLE IF NOT EXISTS borrower_files ( > SetVersion($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 90295ef..01dba1d 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 6d9ff8e..936fb7a 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-advsearch.tt >@@ -145,6 +145,7 @@ > <a href="/cgi-bin/koha/opac-search.pl?do=Clear">[New search]</a> > > <!-- /SEARCH BUTTONS --></div></div> >+[% IF OpacAdvSearch.grep('pubdate').size > 0 || expanded_options %] > <div class="yui-g"> > <div id="pubrange" class="container"> > <fieldset> >@@ -156,7 +157,10 @@ > <!-- /PUB RANGE OPTION --> > </div> > </div> >+[% END %] >+ > <div class="yui-g"> >+[% IF OpacAdvSearch.grep('itemtype').size > 0 || expanded_options %] > <div id="advsearches" class="toptabs"> > <ul> > [% FOREACH advsearchloo IN advancedsearchesloop %] >@@ -188,6 +192,9 @@ > </div> > [% END %] > </div> >+[% END %] >+ >+[% IF OpacAdvSearch.grep('language').size > 0 || expanded_options %] > <div id="langfilter"> > <fieldset><legend>Language</legend> > <!-- LANGUAGE LIMIT --> >@@ -205,7 +212,9 @@ > <!-- /LANGUAGE LIMIT --> > </fieldset> > </div> >-[% IF ( expanded_options ) %] >+[% END %] >+ >+[% IF OpacAdvSearch.grep('subtype').size > 0 || expanded_options %] > [% IF ( usmarc ) %] > <!-- SUBTYPE LIMITS --> > <div id="subtypes" class="container"><fieldset> >@@ -278,10 +287,11 @@ > [% INCLUDE 'subtypes_unimarc.inc' %]</div> > [% END %] > [% END %] >- > </div> >+ > <div class="yui-g"> > >+[% IF OpacAdvSearch.grep('location').size > 0 || expanded_options %] > <div class="yui-u first"> > <!-- AVAILABILITY LIMITS --> > [% UNLESS ( singleBranchMode ) %] >@@ -312,6 +322,9 @@ > [% END %] > <!-- /AVAILABILITY LIMITS --> > </div> >+[% END%] >+ >+[% IF OpacAdvSearch.grep('sorting').size > 0 || expanded_options %] > <div class="yui-u"> > <!-- RANK LIMITS --> > <div id="sortby" class="container"><fieldset><legend>Sorting: </legend> >@@ -320,8 +333,10 @@ > </select></fieldset></div> > <!-- RANK LIMITS --> > </div> >+[% END %] > </div> > >+[% IF OpacAdvSearch.size > 0 || expanded_options %] > <div class="yui-g"><div class="container" style="text-align: center;"><!-- SEARCH BUTTONS --> > > <input class="submit" type="submit" accesskey="s" name="do" title="Search" value="Search" /> >@@ -335,6 +350,8 @@ > <!-- /SEARCH BUTTONS --></div></div> > </form> > </div> >+[% END %] >+ > <script type="text/javascript" language="javascript"> > /* This function allows to display a new field to search. > */ >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index dfe651e..173c9f0 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -146,8 +146,11 @@ elsif (C4::Context->preference("marcflavour") eq "MARC21" ) { > $template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') ); > $template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResultsFound') ); > >+my @advsearch_limits = split /\|/, C4::Context->preference('OpacAdvSearch'); > $template->param( >- OpacStarRatings => C4::Context->preference("OpacStarRatings") ); >+ OpacStarRatings => C4::Context->preference("OpacStarRatings"), >+ OpacAdvSearch => \@advsearch_limits, >+); > > if (C4::Context->preference('BakerTaylorEnabled')) { > $template->param( >-- >1.7.10.4
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