From d9972585806b0f8aff03b53c2176a41286da610f Mon Sep 17 00:00:00 2001 From: hdl Date: Thu, 28 Jul 2005 17:38:29 +0000 Subject: [PATCH] First step of independacy branch management. Displaying only librarian branch if librarian is not superlibrarian and IndependantBranches is set. --- members/memberentry.pl | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/members/memberentry.pl b/members/memberentry.pl index c13142ac48..15a6a257ed 100755 --- a/members/memberentry.pl +++ b/members/memberentry.pl @@ -223,10 +223,22 @@ if ($delete){ my @select_branch; my %select_branches; my $branches=getbranches(); + my $default; foreach my $branch (keys %$branches) { - push @select_branch, $branch; - $select_branches{$branch} = $branches->{$branch}->{'branchname'}; + if (C4::Context->preference("IndependantBranches")) { + my $userenv = C4::Context->userenv; + unless ($userenv->{flags} == 1){ + push @select_branch, $branch if ($branch eq $userenv->{branch}); + $select_branches{$branch} = $branches->{$branch}->{'branchname'} if ($branch eq $userenv->{branch}); + $default = $userenv->{branch}; + } + } else { + push @select_branch, $branch; + $select_branches{$branch} = $branches->{$branch}->{'branchname'}; + $default = $data->{'branchcode'}; + } } + my $CGIbranch=CGI::scrolling_list( -name => 'branchcode', -id => 'branchcode', -values => \@select_branch, -- 2.39.5