Bugzilla – Attachment 2869 Details for
Bug 4891
Order facets in left sidebar of search results
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Proposed patch
0001-bug4891-sort-facets-in-search-sidebar-OPAC-and-staff.patch (text/plain), 1.83 KB, created by
Robin Sheat
on 2010-12-16 23:17:30 UTC
(
hide
)
Description:
Proposed patch
Filename:
MIME Type:
Creator:
Robin Sheat
Created:
2010-12-16 23:17:30 UTC
Size:
1.83 KB
patch
obsolete
>From cb01d9aa67a64d3a22d48a0bccf99431725b218b Mon Sep 17 00:00:00 2001 >From: Robin Sheat <robin@catalyst.net.nz> >Date: Fri, 17 Dec 2010 12:13:54 +1300 >Subject: [PATCH] bug4891 - sort facets in search sidebar (OPAC and staff client) > >--- > catalogue/search.pl | 6 ++++++ > opac/opac-search.pl | 7 +++++++ > 2 files changed, 13 insertions(+), 0 deletions(-) > >diff --git a/catalogue/search.pl b/catalogue/search.pl >index ac2209a..8cb737d 100755 >--- a/catalogue/search.pl >+++ b/catalogue/search.pl >@@ -499,6 +499,12 @@ if (C4::Context->preference('NoZebra')) { > ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan); > }; > } >+# This sorts the facets into alphabetical order >+if ($facets) { >+ foreach my $f (@$facets) { >+ $f->{facets} = [ sort { uc($a->{facet_title_value}) cmp uc($b->{facet_title_value}) } @{ $f->{facets} } ]; >+ } >+} > if ($@ || $error) { > $template->param(query_error => $error.$@); > output_html_with_http_headers $cgi, $cookie, $template->output; >diff --git a/opac/opac-search.pl b/opac/opac-search.pl >index 88f3a2f..45cb766 100755 >--- a/opac/opac-search.pl >+++ b/opac/opac-search.pl >@@ -422,6 +422,13 @@ elsif (C4::Context->preference('NoZebra')) { > ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan); > }; > } >+# This sorts the facets into alphabetical order >+if ($facets) { >+ foreach my $f (@$facets) { >+ $f->{facets} = [ sort { uc($a->{facet_title_value}) cmp uc($b->{facet_title_value}) } @{ $f->{facets} } ]; >+ } >+} >+ > # use Data::Dumper; print STDERR "-" x 25, "\n", Dumper($results_hashref); > if ($@ || $error) { > $template->param(query_error => $error.$@); >-- >1.7.1 >
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 4891
:
2246
| 2869