[Bug 15407] New: Move the patron categories related code to Koha::Patron::Categories - part 2
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Bug ID: 15407 Summary: Move the patron categories related code to Koha::Patron::Categories - part 2 Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: ASSIGNED Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: jonathan.druart@bugs.koha-community.org Reporter: jonathan.druart@bugs.koha-community.org QA Contact: testopia@bugs.koha-community.org Depends on: 14836 This second part will move - C4::Category - the subroutines related to the patron categories in C4::Members (GetBorrowercategory, GetBorrowercategoryList and GetborCatFromCatType) - the sql queries in some pl script to Koha::Patron::Categories Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=14836 [Bug 14836] Move the patron categories related code to Koha::PatronCategories -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45906 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45906&action=edit Bug 15407: Koha::Patron::Categories - remove sql queries in some pl and pm This patch replaces sql queries done in some pl script and in C4::Reports::Guided. Since we have now a Koha::Patron::Categories module, we should use it where it is possible. Test plan: - Prerequisite: Be sure you have several patron categories created, with different option enabled, and limit some to certain libraries. - On the 'Circulation and fine rules' admin page (admin/smart-rules.pl), all the patron categories should be displayed (even the ones limited to another library), ordered by description. Try to add/update existing rules. - On the overdue rules page (tools/overduerules.pl), all the patron categories with overduenoticerequired set should be displayed. Try to add/update existing rules. - On the following reports: reports/borrowers_stats.pl reports/issues_avg_stats.pl The patron categories should be displayed. Note that there is an inconsistency with these 2 reports: the patron categories limited to other libraries are displayed on them, when they are not on the other reports. This should certainly be fixed (on another bug report). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #2 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45907 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45907&action=edit Bug 15407: Koha::Patron::Categories - replace C4::Category->all The C4::Category module contained only 1 method to return the patron categories available for the logged in user. The new method Koha::Patron::Categories->search_limited does exactly the same thing (see tests) and must be used in place of it. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. - On the 'Item circulation alerts' admin page (admin/item_circulation_alerts.pl), modify the settings for check-in and checkout (NOTE: Should not we display all patron categories on this page? If yes, it must be done in another bug report to ease backporting it). - Search for patrons in the admin (budget) and acquisition (order) module. - On the patron home page (search form in the header) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #3 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45908 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45908&action=edit Bug 15407: Koha::Patron::Categories - replace GetBorrowercategory The purpose of C4::Members::GetBorrowercategory was to return the patron category for a given categorycode. This can be done easily with the Koha::Patron::Categories->find method. Test plan: - Same prerequisite as before - Edit a guarantor and confirm the information will be updated for his/her guarantee(s). - Update a child to adult patron (Note: Should not we hide the patron categories limited to others libraries? If yes, it must be done on another bug report). There is a special behavior if there is only 1 adult category, the user does not need to select a category. So the same as before with only 1 adult patron category. - Import a patron with a category_code which does not exist. You should be warned. - Modify some patron using the batch patron modification tool. The patron category descriptions should correctly be displayed. Note that the overduerules page has already been tested in a previous patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #4 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45909 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45909&action=edit Bug 15407: Koha::Patron::Categories - replace GetBorrowercategoryList C4::Members::GetBorrowercategoryList returned all the patron categories, ordered by description. This can be done using the search method of the Koha::Patron::Categories module. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. They should be ordered as before this patch, by description. - On the "patron attribute types" admin page (admin/patron-attr-types.pl). - On the "Batch patron deletion/anonymization" (tools/cleanborrowers.pl), the dropdown list should be filled correctly. - On the following report: reports/reserves_stats.pl Confirm that the patron categories are displayed and that the report still works as before. Note; tools/import_borrowers.pl and tools/modborrowers.pl have already been tested previously. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45910 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45910&action=edit Bug 15407: Koha::Patron::Categories - replace GetborCatFromCatType This unnecessary complicated subroutine returned an arrayref and an hashref of the patron categories available for the logged in user, for a given category_type, ordered by categorycode. This can now be done with the search_limited method. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. They should be ordered as before this patch, by categorycode. - Add/edit a patron, change his/her patron category value. - On the 3 following reports: reports/bor_issues_top.pl reports/borrowers_out.pl reports/cat_issues_top.pl The display for these 3 reports are different than the 2 from the first patch (borrowers_stats.pl issues_avg_stats.pl): they are ordered by categorycode and the ones limited to other libraries are not displayed (should certainly be fixed). Note that the big part of this patch has already been tested before (update child related: CATCODE_MULTI). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #6 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- QA note: A false positive is raised by the qa script *** ERROR: Spurious =cut command at line 1021 in file C4/Members.pm It already exists before this patch set. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Marc Véron <veron@veron.ch> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |veron@veron.ch --- Comment #7 from Marc Véron <veron@veron.ch> --- I went through all tests with all patches applied, no problems found. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #8 from Marc Véron <veron@veron.ch> --- Sorry, I missed one: In Batch patron deletion / anonymization I see a branch restricted category in the dropdown. Category restricted to Midway Staff meber's library is set to Centerville. With patches the category is visible in dropdown (should not) Removed patches - now the category is no longer visible (as expected) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45909|0 |1 is obsolete| | --- Comment #9 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45913 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45913&action=edit Bug 15407: Koha::Patron::Categories - replace GetBorrowercategoryList C4::Members::GetBorrowercategoryList returned all the patron categories, ordered by description. This can be done using the search method of the Koha::Patron::Categories module. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. They should be ordered as before this patch, by description. - On the "patron attribute types" admin page (admin/patron-attr-types.pl). - On the "Batch patron deletion/anonymization" (tools/cleanborrowers.pl), the dropdown list should be filled correctly. - On the import patron tool - On the following report: reports/reserves_stats.pl Confirm that the patron categories are displayed and that the report still works as before. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45910|0 |1 is obsolete| | --- Comment #10 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 45914 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=45914&action=edit :x Bug 15407: Koha::Patron::Categories - replace GetborCatFromCatType This unnecessary complicated subroutine returned an arrayref and an hashref of the patron categories available for the logged in user, for a given category_type, ordered by categorycode. This can now be done with the search_limited method. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. They should be ordered as before this patch, by categorycode. - Add/edit a patron, change his/her patron category value. - On the 3 following reports: reports/bor_issues_top.pl reports/borrowers_out.pl reports/cat_issues_top.pl The display for these 3 reports are different than the 2 from the first patch (borrowers_stats.pl issues_avg_stats.pl): they are ordered by categorycode and the ones limited to other libraries are not displayed (should certainly be fixed). Note that the big part of this patch has already been tested before (update child related: CATCODE_MULTI). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #11 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- (In reply to Marc Véron from comment #8)
Sorry, I missed one:
In Batch patron deletion / anonymization I see a branch restricted category in the dropdown.
Category restricted to Midway Staff meber's library is set to Centerville.
With patches the category is visible in dropdown (should not)
Removed patches - now the category is no longer visible (as expected)
Ho yes, the entire patch (replace GetBorrowercategoryList) was wrong actually. I have updated it, to use the search_limited instead of search method. Thanks for the catch! -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #45906|0 |1 is obsolete| | Attachment #45907|0 |1 is obsolete| | Attachment #45908|0 |1 is obsolete| | Attachment #45913|0 |1 is obsolete| | Attachment #45914|0 |1 is obsolete| | --- Comment #12 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 47098 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47098&action=edit Bug 15407: Koha::Patron::Categories - remove sql queries in some pl and pm This patch replaces sql queries done in some pl script and in C4::Reports::Guided. Since we have now a Koha::Patron::Categories module, we should use it where it is possible. Test plan: - Prerequisite: Be sure you have several patron categories created, with different option enabled, and limit some to certain libraries. - On the 'Circulation and fine rules' admin page (admin/smart-rules.pl), all the patron categories should be displayed (even the ones limited to another library), ordered by description. Try to add/update existing rules. - On the overdue rules page (tools/overduerules.pl), all the patron categories with overduenoticerequired set should be displayed. Try to add/update existing rules. - On the following reports: reports/borrowers_stats.pl reports/issues_avg_stats.pl The patron categories should be displayed. Note that there is an inconsistency with these 2 reports: the patron categories limited to other libraries are displayed on them, when they are not on the other reports. This should certainly be fixed (on another bug report). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #13 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 47099 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47099&action=edit Bug 15407: Koha::Patron::Categories - replace C4::Category->all The C4::Category module contained only 1 method to return the patron categories available for the logged in user. The new method Koha::Patron::Categories->search_limited does exactly the same thing (see tests) and must be used in place of it. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. - On the 'Item circulation alerts' admin page (admin/item_circulation_alerts.pl), modify the settings for check-in and checkout (NOTE: Should not we display all patron categories on this page? If yes, it must be done in another bug report to ease backporting it). - Search for patrons in the admin (budget) and acquisition (order) module. - On the patron home page (search form in the header) -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #14 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 47100 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47100&action=edit Bug 15407: Koha::Patron::Categories - replace GetBorrowercategory The purpose of C4::Members::GetBorrowercategory was to return the patron category for a given categorycode. This can be done easily with the Koha::Patron::Categories->find method. Test plan: - Same prerequisite as before - Edit a guarantor and confirm the information will be updated for his/her guarantee(s). - Update a child to adult patron (Note: Should not we hide the patron categories limited to others libraries? If yes, it must be done on another bug report). There is a special behavior if there is only 1 adult category, the user does not need to select a category. So the same as before with only 1 adult patron category. - Import a patron with a category_code which does not exist. You should be warned. - Modify some patron using the batch patron modification tool. The patron category descriptions should correctly be displayed. Note that the overduerules page has already been tested in a previous patch. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #15 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 47101 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47101&action=edit Bug 15407: Koha::Patron::Categories - replace GetBorrowercategoryList C4::Members::GetBorrowercategoryList returned all the patron categories, ordered by description. This can be done using the search method of the Koha::Patron::Categories module. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. They should be ordered as before this patch, by description. - On the "patron attribute types" admin page (admin/patron-attr-types.pl). - On the "Batch patron deletion/anonymization" (tools/cleanborrowers.pl), the dropdown list should be filled correctly. - On the import patron tool - On the following report: reports/reserves_stats.pl Confirm that the patron categories are displayed and that the report still works as before. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #16 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 47102 --> http://bugs.koha-community.org/bugzilla3/attachment.cgi?id=47102&action=edit Bug 15407: Koha::Patron::Categories - replace GetborCatFromCatType This unnecessary complicated subroutine returned an arrayref and an hashref of the patron categories available for the logged in user, for a given category_type, ordered by categorycode. This can now be done with the search_limited method. Test plan: - Same prerequisite as before For the following pages, you should not see patron categories limited to other libraries. They should be ordered as before this patch, by categorycode. - Add/edit a patron, change his/her patron category value. - On the 3 following reports: reports/bor_issues_top.pl reports/borrowers_out.pl reports/cat_issues_top.pl The display for these 3 reports are different than the 2 from the first patch (borrowers_stats.pl issues_avg_stats.pl): they are ordered by categorycode and the ones limited to other libraries are not displayed (should certainly be fixed). Note that the big part of this patch has already been tested before (update child related: CATCODE_MULTI). -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 --- Comment #17 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- patches rebased. -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |15449 Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15449 [Bug 15449] Move stuffs to the Koha namespace -- You are receiving this mail because: You are watching all bug changes.
http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15407 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |15449 Depends on|15449 | Referenced Bugs: http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=15449 [Bug 15449] Move stuffs to the Koha namespace -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org