From a5b0a37a8a5bafcc4734c1e06b472f4657d4cd62 Mon Sep 17 00:00:00 2001 From: hdl Date: Mon, 8 Aug 2005 13:55:52 +0000 Subject: [PATCH] Managing branch independancy when creating a new biblio. A librarian of one branch cannot create a biblio on a branch different form his own, unless superlibrarian. --- acqui/newbiblio.pl | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/acqui/newbiblio.pl b/acqui/newbiblio.pl index b90c615e00..f40e615212 100755 --- a/acqui/newbiblio.pl +++ b/acqui/newbiblio.pl @@ -115,8 +115,11 @@ my @select_branch; my %select_branches; my ($count2,@branches)=branches(); for (my $i=0;$i<$count2;$i++){ - push @select_branch, $branches[$i]->{'branchcode'};# - $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; + if ((!C4::Context->preference('IndependantBranches'))||(C4::Context->preference('IndependantBranches') && (C4::Context->userenv->{flags} ==1)) + ||((C4::Context->preference('IndependantBranches') && (C4::Context->userenv->{flags} !=1) && (C4::Context->userenv->{branch} eq $branches[$i]->{'branchcode'})))){ + push @select_branch, $branches[$i]->{'branchcode'};# + $select_branches{$branches[$i]->{'branchcode'}} = $branches[$i]->{'branchname'}; + } } my $CGIbranch=CGI::scrolling_list( -name => 'branch', -values => \@select_branch, -- 2.39.2