Bugzilla – Attachment 19690 Details for
Bug 10588
opac-topissues first branch always selected in filters
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10588 - opac-topissues first branch always selected in filters
0001-Bug-10588-opac-topissues-first-branch-always-selecte.patch (text/plain), 4.87 KB, created by
Fridolin Somers
on 2013-07-16 09:53:55 UTC
(
hide
)
Description:
Bug 10588 - opac-topissues first branch always selected in filters
Filename:
MIME Type:
Creator:
Fridolin Somers
Created:
2013-07-16 09:53:55 UTC
Size:
4.87 KB
patch
obsolete
>From 1bfb7d45d3a6d1c003dab083fd058be26f3dce5b Mon Sep 17 00:00:00 2001 >From: Fridolyn SOMERS <fridolyn.somers@biblibre.com> >Date: Mon, 15 Jul 2013 12:14:53 +0200 >Subject: [PATCH] Bug 10588 - opac-topissues first branch always selected in > filters > >In OPAC most popular items page: >With user is logged-in his branch should be selected. >When a branch is manually selected and form is submitted, this branch should be selected in results page. >When looking at HTML, you see that all options are selected in combobox. > >This patch corrects by using the code "__ANY__" to distinguish form display and no branch filter selected. > >Test plan : >- Make sure there are issues on records created in the past 3 month >- Go to OPAC not logged-in >- Click on "Most popular" >=> You get to page with results, "All libraries" is selected >- Select a branch and submit >=> You get to page with results, the branch is selected [testing opac-topissues.inc from] >- Select a branch and perform a search that does not have results (for example an item type never issued) >=> You get to page without results, the branch is selected [testing opac-topissues.tt form] >- Log-in with a user >- Click on "Most popular" >=> You get to page with results, user's branch is selected >- Select "All libraries" and submit >=> You get to page with results, "All libraries" is selected [testing opac-topissues.inc from] >- Select "All libraries" and perform a search that does not have results (for example an item type never issued) >=> You get to page without results, "All libraries" is selected [testing opac-topissues.tt form] >--- > koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc | 4 ++-- > koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt | 2 +- > opac/opac-topissues.pl | 7 +++++-- > 3 files changed, 8 insertions(+), 5 deletions(-) > >diff --git a/koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc b/koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc >index 20b1d9b..05ff89d 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc >+++ b/koha-tmpl/opac-tmpl/prog/en/includes/opac-topissues.inc >@@ -15,9 +15,9 @@ > <li> > <label for="branch">From: </label> > <select name="branch" id="branch" style="width: 10em;"> >- <option value="">All libraries</option> >+ <option value="__ANY__">All libraries</option> > [% FOREACH branchloo IN branchloop %] >- [% IF ( branch == branchname ) %]<option value="[% branchloo.value %]" selected="selected">[% ELSE %]<option value="[% branchloo.value %]">[% END %] >+ [% IF ( branchloo.selected ) %]<option value="[% branchloo.value %]" selected="selected">[% ELSE %]<option value="[% branchloo.value %]">[% END %] > [% branchloo.branchname %] > </option> > [% END %] >diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt >index 460ce93..560f803 100644 >--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt >+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-topissues.tt >@@ -100,7 +100,7 @@ function Dopop(link) { > <li> > <label for="branch">From: </label> > <select name="branch" id="branch"> >- <option value="">All libraries</option> >+ <option value="__ANY__">All libraries</option> > [% FOREACH branchloo IN branchloop %] > [% IF ( branchloo.selected ) %] > <option value="[% branchloo.value %]" selected="selected">[% branchloo.branchname %]</option> >diff --git a/opac/opac-topissues.pl b/opac/opac-topissues.pl >index 38c6df0..8190194 100755 >--- a/opac/opac-topissues.pl >+++ b/opac/opac-topissues.pl >@@ -53,7 +53,8 @@ my ($template, $borrowernumber, $cookie) > my $dbh = C4::Context->dbh; > # Displaying results > my $limit = $input->param('limit') || 10; >-my $branch = $input->param('branch') || ''; >+my $branch_input = $input->param('branch') || ''; >+my $branch = $branch_input eq '__ANY__' ? '' : $branch_input ; # __ANY__ is used to distinguish form display and no branch filter selected > my $itemtype = $input->param('itemtype') || ''; > my $timeLimit = $input->param('timeLimit') || 3; > my $advanced_search_types = C4::Context->preference('AdvancedSearchTypes'); >@@ -129,7 +130,9 @@ $template->param(do_it => 1, > results_loop => \@results, > ); > >-$template->param( branchloop => GetBranchesLoop(C4::Context->userenv?C4::Context->userenv->{'branch'}:'')); >+# GetBranchesLoop without parameter will select user default branch >+my $branchloop = $branch_input ? GetBranchesLoop($branch_input) : GetBranchesLoop(); >+$template->param( branchloop => $branchloop ); > > # the index parameter is different for item-level itemtypes > my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; >-- >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 10588
:
19690
|
19714
|
19744
|
19837
|
20055
|
20103
|
20602