Bugzilla – Attachment 14365 Details for
Bug 9257
Add "groups" to normal search pulldown
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 9257 - Add "groups" to normal search pulldown - Followup
Bug-9257---Add-groups-to-normal-search-pulldown---.patch (text/plain), 7.99 KB, created by
Kyle M Hall (khall)
on 2013-01-02 16:37:40 UTC
(
hide
)
Description:
Bug 9257 - Add "groups" to normal search pulldown - Followup
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-01-02 16:37:40 UTC
Size:
7.99 KB
patch
obsolete
>From 3739496526683776afe3705cc0b6c2868d6ab702 Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 2 Jan 2013 11:36:57 -0500 >Subject: [PATCH] Bug 9257 - Add "groups" to normal search pulldown - Followup > >--- > koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc | 53 ++++++++------------ > koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc | 42 ++++++----------- > opac/opac-search.pl | 16 ++++++ > 3 files changed, 52 insertions(+), 59 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc >index 8b5353e..ac9d682 100644 >--- a/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/ccsr/en/includes/masthead.inc >@@ -157,38 +157,27 @@ > <div id="libraries" class="mobile-hidden"> > [% END %] > >- <select name="limit" id="select_library" class="left" onchange="select_library_changed();"> >- <option value="">All libraries</option> >- [% FOREACH BranchesLoo IN BranchesLoop %] >- [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option> >- [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %] >- [% END %] >- [% IF BranchCategoriesLoop %] >- <option value="__GROUPS__">-- GROUPS --</option> >- [% FOREACH bc IN BranchCategoriesLoop %] >- [% IF ( bc.selected ) %] >- <option selected="selected" value="[% bc.categorycode %]">[% bc.categoryname %]</option> >- [% ELSE %] >- <option value="[% bc.categorycode %]">[% bc.categoryname %]</option> >- [% END %] >- [% END %] >- [% END %] >- </select> >- [% IF BranchCategoriesLoop %] >- <script type="text/javascript"> >- $(document).ready(function() { >- $("#select_library option[value='__GROUPS__']").attr("disabled","disabled"); >- }); >- >- function select_library_changed() { >- if ( $("#select_library option:selected").index() > $("#select_library option[value='__GROUPS__']").index() ) { >- $("#select_library").attr("name", "multibranchlimit"); >- } else { >- $("#select_library").attr("name", "limit"); >- } >- }; >- </script> >- [% END %] >+ <select name="branch_group_limit" id="select_library" class="left"> >+ <option value="">All libraries</option> >+ <optgroup label="Libraries"> >+ [% FOREACH BranchesLoo IN BranchesLoop %] >+ [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option> >+ [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %] >+ [% END %] >+ </optgroup> >+ [% IF BranchCategoriesLoop %] >+ <optgroup label="Groups"> >+ [% FOREACH bc IN BranchCategoriesLoop %] >+ [% IF ( bc.selected ) %] >+ <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option> >+ [% ELSE %] >+ <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option> >+ [% END %] >+ [% END %] >+ </optgroup> >+ [% END %] >+ </select> >+ > </div> > [% ELSE %] > [% IF ( opac_limit_override ) %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >index 825cd59..e7bc813 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/masthead.inc >@@ -77,38 +77,26 @@ > <input type="text" title="Type search term" id = "transl1" name="q" class="left" style="width: 35%; font-size: 111%;"/><div id="translControl"></div> > [% END %] > [% IF ( OpacAddMastheadLibraryPulldown ) %] >- <select name="limit" id="select_library" class="left" onchange="select_library_changed();"> >+ <select name="branch_group_limit" id="select_library" class="left"> > <option value="">All libraries</option> >- [% FOREACH BranchesLoo IN BranchesLoop %] >- [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option> >- [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %] >- [% END %] >+ <optgroup label="Libraries"> >+ [% FOREACH BranchesLoo IN BranchesLoop %] >+ [% IF ( BranchesLoo.selected ) %]<option selected="selected" value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option> >+ [% ELSE %]<option value="branch:[% BranchesLoo.value %]">[% BranchesLoo.branchname %]</option>[% END %] >+ [% END %] >+ </optgroup> > [% IF BranchCategoriesLoop %] >- <option value="__GROUPS__">-- GROUPS --</option> >- [% FOREACH bc IN BranchCategoriesLoop %] >- [% IF ( bc.selected ) %] >- <option selected="selected" value="[% bc.categorycode %]">[% bc.categoryname %]</option> >- [% ELSE %] >- <option value="[% bc.categorycode %]">[% bc.categoryname %]</option> >+ <optgroup label="Groups"> >+ [% FOREACH bc IN BranchCategoriesLoop %] >+ [% IF ( bc.selected ) %] >+ <option selected="selected" value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option> >+ [% ELSE %] >+ <option value="multibranchlimit-[% bc.categorycode %]">[% bc.categoryname %]</option> >+ [% END %] > [% END %] >- [% END %] >+ </optgroup> > [% END %] > </select> >- [% IF BranchCategoriesLoop %] >- <script type="text/javascript"> >- $(document).ready(function() { >- $("#select_library option[value='__GROUPS__']").attr("disabled","disabled"); >- }); >- >- function select_library_changed() { >- if ( $("#select_library option:selected").index() > $("#select_library option[value='__GROUPS__']").index() ) { >- $("#select_library").attr("name", "multibranchlimit"); >- } else { >- $("#select_library").attr("name", "limit"); >- } >- }; >- </script> >- [% END %] > [% ELSE %] > [% IF ( opac_limit_override ) %] > [% IF ( opac_search_limit ) %] >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 9708176..9184113 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -63,6 +63,21 @@ my $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold"); > use CGI qw('-no_undef_params'); > my $cgi = new CGI; > >+my $branch_group_limit = $cgi->param("branch_group_limit"); >+if ( $branch_group_limit ) { >+ if ( $branch_group_limit =~ /^multibranchlimit/ ) { >+ $cgi->param( >+ -name => 'multibranchlimit', >+ -values => [ ( split( 'multibranchlimit-', $branch_group_limit ) )[1] ] >+ ); >+ } else { >+ $cgi->append( >+ -name => 'limit', >+ -values => [ $branch_group_limit ] >+ ); >+ } >+} >+ > BEGIN { > if (C4::Context->preference('BakerTaylorEnabled')) { > require C4::External::BakerTaylor; >@@ -77,6 +92,7 @@ my $template_name; > my $template_type = 'basic'; > my @params = $cgi->param("limit"); > >+ > my $format = $cgi->param("format") || ''; > my $build_grouped_results = C4::Context->preference('OPACGroupResults'); > if ($format =~ /(rss|atom|opensearchdescription)/) { >-- >1.7.2.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 9257
:
13980
|
14364
|
14365
|
15279
|
16074
|
16077
|
16745