Bugzilla – Attachment 64742 Details for
Bug 18743
Filter suggestion lists correctly for IndependentBranches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
bug 18743 - Partially working filter of suggestions by libraries
bug-18743---Partially-working-filter-of-suggestion.patch (text/plain), 4.47 KB, created by
Alex Buckley
on 2017-06-30 03:40:43 UTC
(
hide
)
Description:
bug 18743 - Partially working filter of suggestions by libraries
Filename:
MIME Type:
Creator:
Alex Buckley
Created:
2017-06-30 03:40:43 UTC
Size:
4.47 KB
patch
obsolete
>From 68e48c21d0a04875bf73bdfd527d815491583cd8 Mon Sep 17 00:00:00 2001 >From: Alex Buckley <alexbuckley@catalyst.net.nz> >Date: Fri, 30 Jun 2017 03:38:59 +0000 >Subject: [PATCH] bug 18743 - Partially working filter of suggestions by > libraries > >--- > .../prog/en/modules/suggestion/suggestion.tt | 1 + > suggestion/suggestion.pl | 41 ++++++++++++---------- > 2 files changed, 23 insertions(+), 19 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >index 85b0821..15da936 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt >@@ -837,6 +837,7 @@ h4.local_collapse a { font-size : 80%; text-decoration: none; } fieldset.brief o > [% IF ( budgetid_loo.selected ) %] <option value="[% budgetid_loo.code %]" selected="selected">[% budgetid_loo.desc %]</option>[% ELSE %]<option value="[% budgetid_loo.code %]">[% budgetid_loo.desc %]</option>[% END %] > [% END %] > </select></li> >+ > <li><label for="branchcode">Library:</label> > <select name="branchcode" id="branchcode"> > <option value="__ANY__">Any</option> >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index fb97762..e2a20f4 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -63,7 +63,8 @@ sub GetCriteriumDesc{ > return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i); > } > return Koha::Libraries->find($criteriumvalue)->branchname >- if $displayby =~ /branchcode/; >+ if $displayby =~ /branchcode/; >+ > if ( $displayby =~ /itemtype/ ) { > my $av = Koha::AuthorisedValues->search({ category => 'SUGGEST_FORMAT', authorised_value => $criteriumvalue }); > return $av->count ? $av->next->lib : 'Unkown'; >@@ -244,31 +245,33 @@ if ($op=~/else/) { > my @allsuggestions; > my $reasonsloop = GetAuthorisedValues("SUGGEST"); > foreach my $criteriumvalue ( @criteria_dv ) { >- # By default, display suggestions from current working branch >- unless ( exists $$suggestion_ref{'branchcode'} ) { >- $$suggestion_ref{'branchcode'} = C4::Context->userenv->{'branch'}; >- } >- my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne ""; >+ # By default, display suggestions from current working branch > >- next if ( $definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue ); >- $$suggestion_ref{$displayby} = $criteriumvalue; >+# unless ( exists $$suggestion_ref{'branchcode'} ) { >+# $$suggestion_ref{'branchcode'} = C4::Context->userenv->{'branch'}; >+# } >+ my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne ""; > >- my $suggestions = &SearchSuggestion($suggestion_ref); >- foreach my $suggestion (@$suggestions) { >- if ($suggestion->{budgetid}){ >- my $bud = GetBudget( $suggestion->{budgetid} ); >- $suggestion->{budget_name} = $bud->{budget_name} if $bud; >- } >- } >- push @allsuggestions,{ >+ next if ( $definedvalue && $$suggestion_ref{$displayby} ne $criteriumvalue ); >+ $$suggestion_ref{$displayby} = $criteriumvalue; >+ >+ my $suggestions = &SearchSuggestion($suggestion_ref); >+ foreach my $suggestion (@$suggestions) { >+ if ($suggestion->{budgetid}){ >+ my $bud = GetBudget( $suggestion->{budgetid} ); >+ $suggestion->{budget_name} = $bud->{budget_name} if $bud; >+ } >+ } >+ >+ push @allsuggestions,{ > "suggestiontype"=>$criteriumvalue||"suggest", > "suggestiontypelabel"=>GetCriteriumDesc($criteriumvalue,$displayby)||"", > "suggestionscount"=>scalar(@$suggestions), >- 'suggestions_loop'=>$suggestions, >- 'reasonsloop' => $reasonsloop, >+ "suggestions_loop"=>$suggestions, >+ "reasonsloop" => $reasonsloop, > }; > >- delete $$suggestion_ref{$displayby} unless $definedvalue; >+ delete $$suggestion_ref{$displayby} unless $definedvalue; > } > > $template->param( >-- >2.1.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 18743
:
64742
|
64763
|
64768
|
68298
|
71030
|
72637
|
72679
|
94300
|
94417
|
94418
|
94515
|
94516
|
94737
|
94738
|
94739
|
94740
|
94741
|
94742