From cae93c6770d07bc05c91250c0333d21828179b02 Mon Sep 17 00:00:00 2001 From: Fridolyn SOMERS Date: Thu, 6 Dec 2012 15:11:57 +0100 Subject: [PATCH] Bug 9226: Wrong branch filter after suggestion creation Signed-off-by: Owen Leonard Before the patch, upon submitting a new suggestion in the staff client I was redirected to a view which was not filtered by branch. After the patch I was redirected to a view which was filtered by my logged-in branch. Signed-off-by: Marcel de Rooy Signed-off-by: Jared Camins-Esakov Signed-off-by: Chris Cormack --- suggestion/suggestion.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 99f38eb04e..ff78ef8ecd 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -82,7 +82,6 @@ my $returnsuggestedby = $input->param('returnsuggestedby'); my $returnsuggested = $input->param('returnsuggested'); my $managedby = $input->param('managedby'); my $displayby = $input->param('displayby') || ''; -my $branchfilter = ($displayby ne "branchcode") ? $input->param('branchcode') : ''; my $tabcode = $input->param('tabcode'); # filter informations which are not suggestion related. @@ -195,7 +194,7 @@ if ($op=~/else/) { my $reasonsloop = GetAuthorisedValues("SUGGEST"); foreach my $criteriumvalue ( map { $$_{'value'} } @$criteria_list ) { # By default, display suggestions from current working branch - if(not defined $branchfilter) { + unless ( exists $$suggestion_ref{'branchcode'} ) { $$suggestion_ref{'branchcode'} = C4::Context->userenv->{'branch'}; } my $definedvalue = defined $$suggestion_ref{$displayby} && $$suggestion_ref{$displayby} ne ""; @@ -265,6 +264,7 @@ if(defined($returnsuggested) and $returnsuggested ne "noone") ## Initializing selection lists #branch display management +my $branchfilter = ($displayby ne "branchcode") ? $input->param('branchcode') : ''; my $onlymine=C4::Context->preference('IndependantBranches') && C4::Context->userenv && C4::Context->userenv->{flags}!=1 && -- 2.39.5