[Bug 20226] New: Get rid of CATCODE_MULTI param decision in patron perl scripts
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Bug ID: 20226 Summary: Get rid of CATCODE_MULTI param decision in patron perl scripts Change sponsored?: --- Product: Koha Version: master Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: josef.moravec@gmail.com QA Contact: testopia@bugs.koha-community.org In all scripts for patrons management are this few lines of code: if ( $patron->is_child) { my $patron_categories = Koha::Patron::Categories->search_limited({ category_type => 'A' }, {order_by => ['categorycode']}); $template->param( 'CATCODE_MULTI' => 1) if $patron_categories->count > 1; $template->param( 'catcode' => $patron_categories->next->categorycode ) if $patron_categories->count == 1; } This is needed only in members-toolbar.inc for updating child to adult. I don't think it is good idea to have these 5 lines of code repeated 10 times in our code. Should be refactored and centralized. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |18789 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18789 [Bug 18789] Send a Koha::Patron object to the templates -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Bug 20226 depends on bug 18789, which changed state. Bug 18789 Summary: Send a Koha::Patron object to the templates https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=18789 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=20805 Status|NEW |ASSIGNED CC| |jonathan.druart@bugs.koha-c | |ommunity.org Assignee|koha-bugs@lists.koha-commun |jonathan.druart@bugs.koha-c |ity.org |ommunity.org -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 --- Comment #1 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Created attachment 77062 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77062&action=edit Bug 20226: Centralize update child code (CATCODE_MULTI) Code and variables to deal with the update child feature are not centralized but copied/pasted in several scripts. Which leads to issues obsviously (bug 20805 for instance). Moreover the strings used by the templates are also in several template files (or .inc) To deal with that this patch introduces the idea to create 1 .inc file per .js file Here we have members-menu.inc for members-menu.js Test plan: - Remove all your adult categories (categories.category_type='A') - Create a patron with a child category - Try to update to adult category => The entry does no longer appears! (This is a change in the behaviour) - Create one adult category - Update to adult category => There is a JS confirmation message, if you accept the patron will be updated to the adult category - Create (at least) another adult category - Create another child - Update to adult category => No more confirmation message but a popup to select the adult category - Pick one => The patron has been updated to the adult category -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Depends on| |20287 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20287 [Bug 20287] Move AddMember and ModMember to Koha::Patron -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=21072 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #77062|0 |1 is obsolete| | --- Comment #2 from Owen Leonard <oleonard@myacpl.org> --- Created attachment 77103 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77103&action=edit Bug 20226: Centralize update child code (CATCODE_MULTI) Code and variables to deal with the update child feature are not centralized but copied/pasted in several scripts. Which leads to issues obsviously (bug 20805 for instance). Moreover the strings used by the templates are also in several template files (or .inc) To deal with that this patch introduces the idea to create 1 .inc file per .js file Here we have members-menu.inc for members-menu.js Test plan: - Remove all your adult categories (categories.category_type='A') - Create a patron with a child category - Try to update to adult category => The entry does no longer appears! (This is a change in the behaviour) - Create one adult category - Update to adult category => There is a JS confirmation message, if you accept the patron will be updated to the adult category - Create (at least) another adult category - Create another child - Update to adult category => No more confirmation message but a popup to select the adult category - Pick one => The patron has been updated to the adult category Signed-off-by: Owen Leonard <oleonard@myacpl.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Patch complexity|--- |Medium patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |20813 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20813 [Bug 20813] Revamp user permissions system -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Bug 20226 depends on bug 20287, which changed state. Bug 20287 Summary: Move AddMember and ModMember to Koha::Patron https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20287 What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED Resolution|--- |FIXED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |josef.moravec@gmail.com |y.org | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Josef Moravec <josef.moravec@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #77103|0 |1 is obsolete| | --- Comment #3 from Josef Moravec <josef.moravec@gmail.com> --- Created attachment 77359 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=77359&action=edit Bug 20226: Centralize update child code (CATCODE_MULTI) Code and variables to deal with the update child feature are not centralized but copied/pasted in several scripts. Which leads to issues obsviously (bug 20805 for instance). Moreover the strings used by the templates are also in several template files (or .inc) To deal with that this patch introduces the idea to create 1 .inc file per .js file Here we have members-menu.inc for members-menu.js Test plan: - Remove all your adult categories (categories.category_type='A') - Create a patron with a child category - Try to update to adult category => The entry does no longer appears! (This is a change in the behaviour) - Create one adult category - Update to adult category => There is a JS confirmation message, if you accept the patron will be updated to the adult category - Create (at least) another adult category - Create another child - Update to adult category => No more confirmation message but a popup to select the adult category - Pick one => The patron has been updated to the adult category Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Josef Moravec <josef.moravec@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Nick Clemens <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Pushed to Master CC| |nick@bywatersolutions.com --- Comment #4 from Nick Clemens <nick@bywatersolutions.com> --- Awesome work all! Pushed to master for 18.11 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 --- Comment #5 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- Patron's creation is broken! Template process failed: undef error - DBIC result _type isn't of the _type Category at /home/vagrant/kohaclone/koha-tmpl/intranet-tmpl/prog/en/includes/str/members-menu.inc line 22. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |21222 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=21222 [Bug 21222] Patron's creation is broken -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Martin Renvoize <martin.renvoize@ptfs-europe.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Pushed to Master |RESOLVED CC| |martin.renvoize@ptfs-europe | |.com Resolution|--- |FIXED --- Comment #6 from Martin Renvoize <martin.renvoize@ptfs-europe.com> --- Enhancement, will not be backported to 18.05.x series. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 --- Comment #7 from Jonathan Druart <jonathan.druart@bugs.koha-community.org> --- *** Bug 21072 has been marked as a duplicate of this bug. *** -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20226 Jonathan Druart <jonathan.druart@bugs.koha-community.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |22928 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22928 [Bug 22928] "Update child to adult patron" link no longer displayed -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org