Bugzilla – Attachment 28355 Details for
Bug 10276
Extend IndependentBranches to support groups of libraries
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10276i [QA Followup] - Extend IndependentBranches to support groups of libraries
Bug-10276i-QA-Followup---Extend-IndependentBranche.patch (text/plain), 2.49 KB, created by
Kyle M Hall (khall)
on 2014-05-20 13:04:20 UTC
(
hide
)
Description:
Bug 10276i [QA Followup] - Extend IndependentBranches to support groups of libraries
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2014-05-20 13:04:20 UTC
Size:
2.49 KB
patch
obsolete
>From 819f1e39a47eb644414749353495b17b7a405feb Mon Sep 17 00:00:00 2001 >From: Kyle M Hall <kyle@bywatersolutions.com> >Date: Wed, 15 Jan 2014 16:13:21 -0500 >Subject: [PATCH] Bug 10276i [QA Followup] - Extend IndependentBranches to support groups of libraries > >Signed-off-by: Mark Tompsett <mtompset@hotmail.com> >--- > C4/Branch.pm | 13 +++++-------- > t/db_dependent/Branch.t | 5 ++++- > 2 files changed, 9 insertions(+), 9 deletions(-) > >diff --git a/C4/Branch.pm b/C4/Branch.pm >index f6c4333..2db1fd0 100644 >--- a/C4/Branch.pm >+++ b/C4/Branch.pm >@@ -495,16 +495,13 @@ sub GetIndependentGroupModificationRights { > push( @params, $other_branch ); > } > >+ $sql .= q{ UNION SELECT branchcode FROM branches WHERE branchcode = ? }; >+ push( @params, $this_branch ); >+ > my $dbh = C4::Context->dbh; > my @branchcodes = @{ $dbh->selectcol_arrayref( $sql, {}, @params ) }; > >- if ( $stringify ) { >- if ( @branchcodes ) { >- return join( ',', map { qq{'$_'} } @branchcodes ); >- } else { >- return qq{'$this_branch'}; >- } >- } >+ return join( ',', map { qq{'$_'} } @branchcodes ) if $stringify; > > if ( wantarray() ) { > if ( @branchcodes ) { >@@ -513,7 +510,7 @@ sub GetIndependentGroupModificationRights { > return $this_branch; > } > } else { >- return scalar(@branchcodes); >+ return scalar(@branchcodes) > 1; > } > } > >diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t >index 799a315..2cce07a 100644 >--- a/t/db_dependent/Branch.t >+++ b/t/db_dependent/Branch.t >@@ -21,7 +21,7 @@ use Modern::Perl; > use C4::Context; > use Data::Dumper; > >-use Test::More tests => 69; >+use Test::More tests => 70; > > use C4::Branch; > >@@ -381,6 +381,9 @@ is_deeply( \@branches_bra, [ 'BRA', 'BRB' ], 'Libraries in LIBCATCODE returned c > $string = GetIndependentGroupModificationRights({ branch => 'BRA', stringify => 1 }); > ok( $string eq q{'BRA','BRB'}, "String returns correctly" ); > >+$string = GetIndependentGroupModificationRights({ branch => 'BRC', stringify => 1 }); >+ok( $string eq q{'BRC'}, "String returns correctly" ); >+ > ok( GetIndependentGroupModificationRights({ branch => 'BRA', for => 'BRA' }), 'Boolean test for BRA rights to BRA returns true' ); > ok( GetIndependentGroupModificationRights({ branch => 'BRA', for => 'BRB'}), 'Boolean test for BRA rights to BRB returns true' ); > ok( !GetIndependentGroupModificationRights({ branch => 'BRA', for => 'BRC'}), 'Boolean test for BRA rights to BRC returns false' ); >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 10276
:
18205
|
18479
|
18519
|
18716
|
18717
|
18850
|
20773
|
21145
|
22791
|
23037
|
23484
|
23489
|
23637
|
23641
|
23953
|
23992
|
24427
|
24428
|
25722
|
25723
|
25724
|
26015
|
26026
|
26027
|
26028
|
26029
|
28354
|
28355
|
28356
|
28357
|
28358
|
28359
|
28360
|
28361
|
28365
|
28366
|
28367
|
36027
|
36028
|
36029
|
36030
|
36031
|
36032
|
41064
|
41065
|
41066
|
41067
|
41068
|
41069
|
41070