[Bug 44228] New: Add option on patron account page to create SIP account
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44228 Bug ID: 44228 Summary: Add option on patron account page to create SIP account Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Patrons Assignee: koha-bugs@lists.koha-community.org Reporter: andrew@bywatersolutions.com QA Contact: testopia@bugs.koha-community.org CC: gmcharlt@gmail.com, kyle@bywatersolutions.com Target Milestone: --- It would be helpful to have a link on the patron account page to create a SIP account tied to that patron. This option could show in More dropdown and only be enabled when the logged-in user has manage_sip2 permissions. Clicking it could take the user to the SIP2 module new account page (/cgi-bin/koha/sip2/accounts/add) with the staff userid field pre-populated with the patron. -- 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=44228 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |andrew@bywatersolutions.com |ity.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=44228 --- Comment #1 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212398 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212398&action=edit Bug 44228: Add option on patron account page to create SIP account This patch adds a "Create SIP account" option to the More menu on the patron account toolbar. It links to the SIP2 module's new account form with the staff userid field pre-populated with the patron's userid. The option is disabled (with a tooltip) when the logged-in user lacks the manage_sip2 permission, or when the patron has no username. The SIP2 account form now accepts a login_id query parameter as the default value for the staff userid field. Test plan: 1. Apply patch, run yarn js:build, restart_all. You may also need to clear your browser cache. 2. As a superlibrarian, open a patron that has a username 3. Click More -> Create SIP account 4. Confirm you land on the SIP2 New account form with the staff userid field set to that patron 5. Fill in an institution, save, confirm the account is created with that login_id 6. Open a patron with no username, confirm the More menu option is disabled with the tooltip "Patron has no username" (the staff interface will auto-populate a username when creating or editing a patron, but the field is nullable in the database) 7. Log in as a staff user who has edit_borrowers but not manage_sip2, confirm the option is disabled with the tooltip "You are not authorized to manage SIP2 accounts" 8. Go to Administration -> SIP2 -> Accounts -> New account directly, confirm the staff userid field is empty as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44228 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212398|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44228 --- Comment #2 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212418 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212418&action=edit Bug 44228: Add option on patron account page to create SIP account This patch adds a "Create SIP account" option to the More menu on the patron account toolbar. It links to the SIP2 module's new account form with the staff userid field pre-populated with the patron's userid. The option is disabled (with a tooltip) when the logged-in user lacks the manage_sip2 permission, or when the patron has no username. The SIP2 account form now accepts a login_id query parameter as the default value for the staff userid field. Test plan: 1. Apply patch, run yarn js:build, restart_all. You may also need to clear your browser cache. 2. As a superlibrarian, open a patron that has a username 3. Click More -> Create SIP account 4. Confirm you land on the SIP2 New account form with the staff userid field set to that patron 5. Fill in an institution, save, confirm the account is created with that login_id 6. Open a patron with no username, confirm the More menu option is disabled with the tooltip "Patron has no username" (the staff interface will auto-populate a username when creating or editing a patron, but the field is nullable in the database) 7. Log in as a staff user who has edit_borrowers but not manage_sip2, confirm the option is disabled with the tooltip "You are not authorized to manage SIP2 accounts" 8. Go to Administration -> SIP2 -> Accounts -> New account directly, confirm the staff userid field is empty as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44228 --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212419 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212419&action=edit Bug 44228: (follow-up) Disable Create SIP account if patron already has one SIP accounts have a unique login_id, so a patron whose userid is already used by a SIP account cannot have another one. This patch adds Koha::Patron->sip_account, which returns the Koha::SIP2::Account whose login_id matches the patron's userid, and uses it to disable the "Create SIP account" option with the tooltip "Patron already has a SIP account". Test plan: 1. Apply patch, restart_all 2. prove t/db_dependent/Koha/Patron.t 3. Open a patron whose userid matches an existing SIP account login_id (in KTD: koha_sip, matching the term1 account) 4. Click More, confirm Create SIP account is disabled with the tooltip "Patron already has a SIP account" 5. Open a patron with a userid that has no SIP account, confirm the option is still enabled and works as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44228 Andrew Fuerste-Henry <andrew@bywatersolutions.com> 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=44228 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #212418|0 |1 is obsolete| | Attachment #212419|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44228 --- Comment #4 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212443 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212443&action=edit Bug 44228: Add option on patron account page to create SIP account This patch adds a "Create SIP account" option to the More menu on the patron account toolbar. It links to the SIP2 module's new account form with the staff userid field pre-populated with the patron's userid. The option is disabled (with a tooltip) when the logged-in user lacks the manage_sip2 permission, or when the patron has no username. The SIP2 account form now accepts a login_id query parameter as the default value for the staff userid field. Test plan: 1. Apply patch, run yarn js:build, restart_all. You may also need to clear your browser cache. 2. As a superlibrarian, open a patron that has a username 3. Click More -> Create SIP account 4. Confirm you land on the SIP2 New account form with the staff userid field set to that patron 5. Fill in an institution, save, confirm the account is created with that login_id 6. Open a patron with no username, confirm the More menu option is disabled with the tooltip "Patron has no username" (the staff interface will auto-populate a username when creating or editing a patron, but the field is nullable in the database) 7. Log in as a staff user who has edit_borrowers but not manage_sip2, confirm the option is disabled with the tooltip "You are not authorized to manage SIP2 accounts" 8. Go to Administration -> SIP2 -> Accounts -> New account directly, confirm the staff userid field is empty as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Mary Teal <mteal@greenvillelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44228 --- Comment #5 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 212444 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=212444&action=edit Bug 44228: (follow-up) Disable Create SIP account if patron already has one SIP accounts have a unique login_id, so a patron whose userid is already used by a SIP account cannot have another one. This patch adds Koha::Patron->sip_account, which returns the Koha::SIP2::Account whose login_id matches the patron's userid, and uses it to disable the "Create SIP account" option with the tooltip "Patron already has a SIP account". Test plan: 1. Apply patch, restart_all 2. prove t/db_dependent/Koha/Patron.t 3. Open a patron whose userid matches an existing SIP account login_id (in KTD: koha_sip, matching the term1 account) 4. Click More, confirm Create SIP account is disabled with the tooltip "Patron already has a SIP account" 5. Open a patron with a userid that has no SIP account, confirm the option is still enabled and works as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Mary Teal <mteal@greenvillelibrary.org> -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org