Bug 15295

Summary: Move the C4::Branch related code to Koha::Libraries - part 2
Product: Koha Reporter: Jonathan Druart <jonathan.druart>
Component: Architecture, internals, and plumbingAssignee: Jonathan Druart <jonathan.druart>
Status: CLOSED FIXED QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: brendan, kyle, martin.renvoize, veron
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Bug Depends on: 15294    
Bug Blocks: 4941, 15293, 15568, 17142, 19389    
Attachments: Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode
Bug 15295: Koha::Libraries - Remove GetBranchCategory
Bug 15295: Koha::Libraries - Remove GetBranchCategories
Bug 15295: Koha::Libraries - Remove GetCategoryTypes
Bug 15295: Koha::Libraries - Remove GetBranchesCount
Bug 15295! Koha::Libraries - Remove ModBranchCategoryInfo
Bug 15294: Koha::Libraries - Rewrite the admin scripts
Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode
Bug 15295: Koha::Libraries - Remove GetBranchCategory
Bug 15295: Koha::Libraries - Remove GetBranchCategories
Bug 15295: Koha::Libraries - Remove GetCategoryTypes
Bug 15295: Koha::Libraries - Remove GetBranchesCount
Bug 15295! Koha::Libraries - Remove ModBranchCategoryInfo
Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode
Bug 15295: Koha::Libraries - Remove GetBranchCategory
Bug 15295: Koha::Libraries - Remove GetBranchCategories
Bug 15295: Koha::Libraries - Remove GetCategoryTypes
Bug 15295: Koha::Libraries - Remove GetBranchesCount
Bug 15295! Koha::Libraries - Remove ModBranchCategoryInfo
Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount
[SIGNED-OFF] Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount

Description Jonathan Druart 2015-12-03 15:13:46 UTC
In this second part, the following subroutines from C4::Branch will be removed by using methods from Koha::Libraries.
- DelBranch
- DelBranchCategory
- CheckCategoryUnique
- CheckBranchCategorycode
- GetBranchCategory
- GetBranchCategories
- GetCategoryTypes
- GetBranchesCount
- ModBranchCategoryInfo
Comment 1 Jonathan Druart 2015-12-03 16:15:44 UTC Comment hidden (obsolete)
Comment 2 Jonathan Druart 2015-12-03 16:15:46 UTC Comment hidden (obsolete)
Comment 3 Jonathan Druart 2015-12-03 16:15:49 UTC Comment hidden (obsolete)
Comment 4 Jonathan Druart 2015-12-03 16:15:52 UTC Comment hidden (obsolete)
Comment 5 Jonathan Druart 2015-12-03 16:15:55 UTC Comment hidden (obsolete)
Comment 6 Jonathan Druart 2015-12-03 16:15:58 UTC Comment hidden (obsolete)
Comment 7 Jonathan Druart 2015-12-03 16:16:00 UTC Comment hidden (obsolete)
Comment 8 Jonathan Druart 2015-12-03 16:16:03 UTC Comment hidden (obsolete)
Comment 9 Marc Véron 2015-12-17 10:40:38 UTC Comment hidden (obsolete)
Comment 10 Marc Véron 2015-12-17 10:42:42 UTC
Comment on attachment 45752 [details] [review]
Bug 15294: Koha::Libraries - Rewrite the admin scripts

Sorry, that was an error, I tried to attach multiple patches.
Comment 11 Marc Véron 2015-12-17 10:54:37 UTC Comment hidden (obsolete)
Comment 12 Marc Véron 2015-12-17 10:55:38 UTC Comment hidden (obsolete)
Comment 13 Marc Véron 2015-12-17 10:56:34 UTC Comment hidden (obsolete)
Comment 14 Marc Véron 2015-12-17 10:57:25 UTC Comment hidden (obsolete)
Comment 15 Marc Véron 2015-12-17 10:58:50 UTC Comment hidden (obsolete)
Comment 16 Marc Véron 2015-12-17 11:00:08 UTC Comment hidden (obsolete)
Comment 17 Marc Véron 2015-12-17 11:01:02 UTC Comment hidden (obsolete)
Comment 18 Marc Véron 2015-12-17 11:01:41 UTC Comment hidden (obsolete)
Comment 19 Marc Véron 2015-12-17 11:02:46 UTC
Note: I tested all patches together. Worked as expected.
Comment 20 Jonathan Druart 2015-12-17 11:04:37 UTC
(In reply to Marc Véron from comment #19)
> Note: I tested all patches together. Worked as expected.

And that is exactly the way to do.
I add a test plan on the patch to highlight the changes done for each one, but they have to be tested together.

Thanks a lot for testing and signoffing!
Comment 21 Martin Renvoize 2015-12-23 05:15:45 UTC
Created attachment 45924 [details] [review]
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.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 22 Martin Renvoize 2015-12-23 05:15:51 UTC
Created attachment 45925 [details] [review]
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique

This subroutine is not used anymore and was not really useful.
The branchcategories table has a primary key defined on categorycode.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=15294
Comment 23 Martin Renvoize 2015-12-23 05:15:57 UTC
Created attachment 45926 [details] [review]
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode

This verification is now done in admin/branches.pl, no need for a
special subroutine/method, it's 1 line only called once.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=15294
Comment 24 Martin Renvoize 2015-12-23 05:16:03 UTC
Created attachment 45927 [details] [review]
Bug 15295: Koha::Libraries - Remove GetBranchCategory

This has been replaced with Koha::Libraries->find

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=15294
Comment 25 Martin Renvoize 2015-12-23 05:16:09 UTC
Created attachment 45928 [details] [review]
Bug 15295: Koha::Libraries - Remove GetBranchCategories

Test plan
1/ enable OpacAddMastheadLibraryPulldown
2/ Defined a group of libraries as searchdomain
and tick 'show in pull down'
3/ At the OPAC, go on the advanced search form, limit by the group of
libraries you have just created.
4/ The group should be selected by default in the dropdown list

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=15294
Comment 26 Martin Renvoize 2015-12-23 05:16:15 UTC
Created attachment 45929 [details] [review]
Bug 15295: Koha::Libraries - Remove GetCategoryTypes

'searchdomain' and 'properties' were hardcoded in this subroutine.
Now there are in the admin script. Not a big deal, we could improve that
later if someone wants to add a third values.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=15294
Comment 27 Martin Renvoize 2015-12-23 05:16:20 UTC
Created attachment 45930 [details] [review]
Bug 15295: Koha::Libraries - Remove GetBranchesCount

This is replaced with Koha::Libraries->search->count.

Signed-off-by: Marc Véron <veron@veron.ch>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=15294
Comment 28 Martin Renvoize 2015-12-23 05:16:26 UTC
Created attachment 45931 [details] [review]
Bug 15295! Koha::Libraries - Remove ModBranchCategoryInfo

This has been replaced with Koha::Library->update_categories and
Koha::Library->add_to_categories

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

http://bugs.koha-community.org/show_bug.cgi?id=15294
Comment 29 Martin Renvoize 2015-12-23 05:17:17 UTC
More foundational work, well done Jonathan.

Not found any regressions and code is much tidier now :)

Passing QA
Comment 30 Brendan Gallagher 2016-01-14 16:18:53 UTC
Pushed to Master - Should be in the May 2016 release
Comment 31 Jonathan Druart 2016-01-15 09:36:44 UTC Comment hidden (obsolete)
Comment 32 Nick Clemens 2016-01-15 13:51:18 UTC
Created attachment 46696 [details] [review]
[SIGNED-OFF] Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount

Fix conflict with bug 11625

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Comment 33 Kyle M Hall 2016-01-19 12:31:28 UTC
Follow pushed to master!