Bugzilla – Attachment 45368 Details for
Bug 15295
Move the C4::Branch related code to Koha::Libraries - part 2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory
Bug-15295-KohaLibraries---Remove-DelBranch-and-Del.patch (text/plain), 2.98 KB, created by
Jonathan Druart
on 2015-12-03 16:15:44 UTC
(
hide
)
Description:
Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2015-12-03 16:15:44 UTC
Size:
2.98 KB
patch
obsolete
>From 79fa518f26f313d37abaffefc9735032a9fe76ae Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 3 Dec 2015 14:04:06 +0000 >Subject: [PATCH] Bug 15295: Koha::Libraries - Remove DelBranch and > DelBranchCategory > >These 2 subroutines are not used anymore, there were only used from the >admin script rewrote on bug 15294. >--- > C4/Branch.pm | 29 ----------------------------- > t/db_dependent/Branch.t | 11 ++++------- > 2 files changed, 4 insertions(+), 36 deletions(-) > >diff --git a/C4/Branch.pm b/C4/Branch.pm >index 3d513e9..4d344fb 100644 >--- a/C4/Branch.pm >+++ b/C4/Branch.pm >@@ -42,8 +42,6 @@ BEGIN { > &GetBranchCategories > &GetBranchesInCategory > &ModBranchCategoryInfo >- &DelBranch >- &DelBranchCategory > &CheckCategoryUnique > &mybranch > &GetBranchesCount >@@ -472,19 +470,6 @@ sub GetBranchInfo { > return \@results; > } > >-=head2 DelBranch >- >-&DelBranch($branchcode); >- >-=cut >- >-sub DelBranch { >- my ($branchcode) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("delete from branches where branchcode = ?"); >- $sth->execute($branchcode); >-} >- > =head2 ModBranchCategoryInfo > > &ModBranchCategoryInfo($data); >@@ -528,20 +513,6 @@ sub CheckCategoryUnique { > } > } > >- >-=head2 DeleteBranchCategory >- >-DeleteBranchCategory($categorycode); >- >-=cut >- >-sub DelBranchCategory { >- my ($categorycode) = @_; >- my $dbh = C4::Context->dbh; >- my $sth = $dbh->prepare("delete from branchcategories where categorycode = ?"); >- $sth->execute($categorycode); >-} >- > =head2 CheckBranchCategorycode > > $number_rows_affected = CheckBranchCategorycode($categorycode); >diff --git a/t/db_dependent/Branch.t b/t/db_dependent/Branch.t >index 9ca3f56..a7b889f 100644 >--- a/t/db_dependent/Branch.t >+++ b/t/db_dependent/Branch.t >@@ -24,6 +24,8 @@ use Data::Dumper; > use Test::More tests => 36; > > use C4::Branch; >+use Koha::Libraries; >+use Koha::LibraryCategories; > > BEGIN { > use FindBin; >@@ -46,8 +48,6 @@ can_ok( > GetBranchCategories > GetBranchesInCategory > ModBranchCategoryInfo >- DelBranch >- DelBranchCategory > CheckCategoryUnique > mybranch > GetBranchesCount) >@@ -118,9 +118,7 @@ $b2->{add} = 1; > ModBranch($b2); > is( GetBranchesCount(), $count + 2, "two branches added" ); > >-#Test DelBranch >- >-is( DelBranch( $b2->{branchcode} ), 1, "One row affected" ); >+is( Koha::Libraries->find( $b2->{branchcode} )->delete, 1, "One row affected" ); > is( GetBranchesCount(), $count + 1, "branch BRB deleted" ); > > #Test GetBranchName >@@ -220,8 +218,7 @@ is_deeply( $cat1detail, $cat1, 'CAT1 details are right' ); > my $category = GetBranchCategory('LIBCATCODE'); > is_deeply($category, \%new_category, 'fetched newly added library category'); > >-#Test DelBranchCategory >-my $del = DelBranchCategory( $cat2->{categorycode} ); >+my $del = Koha::LibraryCategories->find( $cat2->{categorycode} )->delete; > is( $del, 1, 'One row affected' ); > > $categories = GetBranchCategories(); >-- >2.1.0
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 15295
:
45368
|
45369
|
45370
|
45371
|
45372
|
45373
|
45374
|
45375
|
45752
|
45754
|
45755
|
45756
|
45757
|
45760
|
45763
|
45764
|
45765
|
45924
|
45925
|
45926
|
45927
|
45928
|
45929
|
45930
|
45931
|
46684
|
46696