Bugzilla – Attachment 72679 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 - ALTERNATE: Take IndependantBranches syspref into account
Bug-18743---ALTERNATE-Take-IndependantBranches-sys.patch (text/plain), 2.79 KB, created by
Séverine Queune
on 2018-03-12 13:02:57 UTC
(
hide
)
Description:
Bug 18743 - ALTERNATE: Take IndependantBranches syspref into account
Filename:
MIME Type:
Creator:
Séverine Queune
Created:
2018-03-12 13:02:57 UTC
Size:
2.79 KB
patch
obsolete
>From fbfb5f1b6dacd7787b1e79f855e9d49bf50049d0 Mon Sep 17 00:00:00 2001 >From: maksim <maksim@inlibro.com> >Date: Mon, 29 Jan 2018 15:07:23 -0500 >Subject: [PATCH] Bug 18743 - ALTERNATE: Take IndependantBranches syspref into > account >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr> >--- > C4/Suggestions.pm | 14 ++++++++------ > suggestion/suggestion.pl | 6 ++++-- > 2 files changed, 12 insertions(+), 8 deletions(-) > >diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm >index 70b7b0d..13d2e9b 100644 >--- a/C4/Suggestions.pm >+++ b/C4/Suggestions.pm >@@ -135,12 +135,14 @@ sub SearchSuggestion { > if ( C4::Context->preference('IndependentBranches') ) { > my $userenv = C4::Context->userenv; > if ($userenv) { >- if ( !C4::Context->IsSuperLibrarian() && !$suggestion->{branchcode} ) >+ if ( !C4::Context->IsSuperLibrarian()) > { >- push @sql_params, $$userenv{branch}; >- push @query, q{ >- AND (suggestions.branchcode=? OR suggestions.branchcode='') >- }; >+ if( !$suggestion->{branchcode} || $suggestion->{branchcode} eq $userenv->{branch}){ >+ push @sql_params, $$userenv{branch}; >+ push @query, q{ >+ AND (suggestions.branchcode=? OR suggestions.branchcode='') >+ }; >+ } > } > } > } else { >@@ -405,7 +407,7 @@ sub CountSuggestion { > FROM suggestions > LEFT JOIN borrowers ON borrowers.borrowernumber=suggestions.suggestedby > WHERE STATUS=? >- AND (borrowers.branchcode='' OR borrowers.branchcode=?) >+ AND (suggestions.branchcode='' OR suggestions.branchcode=?) > }; > $sth = $dbh->prepare($query); > $sth->execute( $status, $userenv->{branch} ); >diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl >index 98fcca4..48a885d 100755 >--- a/suggestion/suggestion.pl >+++ b/suggestion/suggestion.pl >@@ -260,8 +260,10 @@ if ($op=~/else/) { > my @allsuggestions; > 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'}; >+ if (C4::Context->preference('IndependentBranches') && !C4::Context->IsSuperLibrarian()) { >+ unless ( exists $$suggestion_ref{'branchcode'} ) { >+ $$suggestion_ref{'branchcode'} = C4::Context->userenv->{'branch'}; >+ } > } > my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne ""; > >-- >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