Bug 10079 - HomeOrHoldingBranch should not control who can delete when IndependantBranches is enabled

Test Plan:
1) Enable IndependantBranches
2) Set HomeOrHoldingBranch to holding branch
3) Delete an item whose holding branch is your logged in branch, and
   whose home branch is not
4) Apply this patch
5) Repeat step 3, it should fail
6) Try to delete another items whose home branch is your logged in
   branch, and whose holding branch is a different branch. This
   deletetion should succeed.

Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
All tests and QA script pass.
Change is logical, only homebranch should determine if the item
can be deleted.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
(cherry picked from commit f1d6811282)

Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
This commit is contained in:
Kyle M Hall 2013-04-19 10:21:43 -04:00 committed by Jared Camins-Esakov
parent fc1353caf4
commit 41b16e0fec
1 changed files with 3 additions and 4 deletions

View File

@ -2213,10 +2213,9 @@ sub DelItemCheck {
if ($onloan){
$error = "book_on_loan"
}
elsif ( !(C4::Context->userenv->{flags} & 1) and
C4::Context->preference("IndependantBranches") and
(C4::Context->userenv->{branch} ne
$item->{C4::Context->preference("HomeOrHoldingBranch")||'homebranch'}) )
elsif ( !( C4::Context->userenv->{flags} & 1 )
and C4::Context->preference("IndependantBranches")
and ( C4::Context->userenv->{branch} ne $item->{'homebranch'} ) )
{
$error = "not_same_branch";
}