Bug 15295 - Move the C4::Branch related code to Koha::Libraries - part 2
Summary: Move the C4::Branch related code to Koha::Libraries - part 2
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Jonathan Druart
QA Contact: Testopia
URL:
Keywords:
Depends on: 15294
Blocks: 4941 15293 15568 17142 19389
  Show dependency treegraph
 
Reported: 2015-12-03 15:13 UTC by Jonathan Druart
Modified: 2017-10-02 17:30 UTC (History)
4 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:


Attachments
Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory (2.98 KB, patch)
2015-12-03 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique (2.28 KB, patch)
2015-12-03 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode (3.48 KB, patch)
2015-12-03 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchCategory (2.79 KB, patch)
2015-12-03 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchCategories (10.06 KB, patch)
2015-12-03 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetCategoryTypes (2.53 KB, patch)
2015-12-03 16:15 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchesCount (4.77 KB, patch)
2015-12-03 16:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15295! Koha::Libraries - Remove ModBranchCategoryInfo (3.69 KB, patch)
2015-12-03 16:16 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 15294: Koha::Libraries - Rewrite the admin scripts (58.62 KB, patch)
2015-12-17 10:40 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory (2.99 KB, patch)
2015-12-17 10:54 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique (2.41 KB, patch)
2015-12-17 10:55 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode (3.62 KB, patch)
2015-12-17 10:56 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchCategory (2.92 KB, patch)
2015-12-17 10:57 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchCategories (10.20 KB, patch)
2015-12-17 10:58 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetCategoryTypes (2.67 KB, patch)
2015-12-17 11:00 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchesCount (4.91 KB, patch)
2015-12-17 11:01 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295! Koha::Libraries - Remove ModBranchCategoryInfo (3.70 KB, patch)
2015-12-17 11:01 UTC, Marc Véron
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove DelBranch and DelBranchCategory (3.05 KB, patch)
2015-12-23 05:15 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove CheckCategoryUnique (2.52 KB, patch)
2015-12-23 05:15 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove CheckBranchCategorycode (3.73 KB, patch)
2015-12-23 05:15 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchCategory (3.03 KB, patch)
2015-12-23 05:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchCategories (10.30 KB, patch)
2015-12-23 05:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetCategoryTypes (2.78 KB, patch)
2015-12-23 05:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295: Koha::Libraries - Remove GetBranchesCount (5.02 KB, patch)
2015-12-23 05:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295! Koha::Libraries - Remove ModBranchCategoryInfo (3.81 KB, patch)
2015-12-23 05:16 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount (2.02 KB, patch)
2016-01-15 09:36 UTC, Jonathan Druart
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 15295: (follow-up) Koha::Libraries - Remove GetBranchesCount (2.09 KB, patch)
2016-01-15 13:51 UTC, Nick Clemens (kidclamp)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
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 (kidclamp) 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!