From db296b7bb739262c6c9177824cda39edbe7cb68f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Mon, 6 Feb 2012 20:00:24 +0100 Subject: [PATCH] Bug 7505 Superlibrarian can't export all biblios when IndependantBranches is enabled When a Koha user has superlibrarian permissions, and if IndependantBranches is enabled, in Tools > Export bibliographic and holdings, this user can't export all biblio records. He will just export the biblio from the branch he belongs to. This patch fix that. To test: - Do a ALL records export as superlibrian on a multi-branches Koha instance - Examine the resulting MARC file with the tool of your choice (MArcEdit, yaz-marcdump, etc.) - You will see that 952/995 contains exlusively items from your branch (as Koha user) Signed-off-by: Jared Camins-Esakov Signed-off-by: Paul Poulain (cherry picked from commit 78f2ac28626196950891dc562714f8d463f5f9bd) Signed-off-by: Chris Nighswonger (cherry picked from commit 4140acb9bf7e5b477041fa91304a78c720dc69e3) Signed-off-by: Chris Nighswonger --- tools/export.pl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/export.pl b/tools/export.pl index 0465079ca3..1a8d6a1789 100755 --- a/tools/export.pl +++ b/tools/export.pl @@ -47,11 +47,12 @@ my ($template, $loggedinuser, $cookie) my $limit_ind_branch=(C4::Context->preference('IndependantBranches') && C4::Context->userenv && - C4::Context->userenv->{flags} % 2 !=1 && + !(C4::Context->userenv->{flags} & 1) && C4::Context->userenv->{branch}?1:0); my $branches = GetBranches($limit_ind_branch); my $branch = $query->param("branch") || ''; - if ( C4::Context->preference("IndependantBranches") ) { + if ( C4::Context->preference("IndependantBranches") && + !(C4::Context->userenv->{flags} & 1) ) { $branch = C4::Context->userenv->{'branch'}; } -- 2.39.5