[Bug 16631] New: Show groups/categories of reports to authorized staff
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Bug ID: 16631 Summary: Show groups/categories of reports to authorized staff Change sponsored?: --- Product: Koha Version: 3.22 Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Reports Assignee: gmcharlt@gmail.com Reporter: cbrannon@cdalibrary.org QA Contact: testopia@bugs.koha-community.org It would be helpful to have reports that are specific groups/categories to be authorized under the reports permissions in a patron account. Not everyone wants to see everyone else's reports, some are similar but are not. Some are for superlibrarians to test, and are not ready for use. It would be great if we could specify groups and even subgroups in the permissions that the staff could access, or specify all groups. All groups should be the norm for a superlibrarian. Christopher -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Katrin Fischer <katrin.fischer@bsz-bw.de> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |katrin.fischer@bsz-bw.de -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Brenda Turnbull <bturnbull@livewirewarrington.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bturnbull@livewirewarringto | |n.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #1 from Brenda Turnbull <bturnbull@livewirewarrington.org> --- This is something we would be interested in to as there are some reports we would like to give to the Stock Librarians only and so restrictions can be places on when they are run too. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Cab Vinton <bibliwho@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bibliwho@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Cab Vinton <bibliwho@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nengard@gmail.com --- Comment #2 from Cab Vinton <bibliwho@gmail.com> --- *** Bug 10903 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=16631 --- Comment #3 from Cab Vinton <bibliwho@gmail.com> --- Would also be nice to limit access to reports by the home library of the staff. Some reports are specific to the needs of just one library. Some reports are in development for a while. And so on. As reports proliferate over time, libraries would welcome any option that reduces the number of reports visible to them. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Owen Leonard <oleonard@myacpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Version|3.22 |master Assignee|gmcharlt@gmail.com |koha-bugs@lists.koha-commun | |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=16631 Daniel Gaghan <daniel.gaghan@pueblolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |daniel.gaghan@pueblolibrary | |.org --- Comment #4 from Daniel Gaghan <daniel.gaghan@pueblolibrary.org> --- Having the ability to limit who can see which reports would help a lot at PCCLD. It would certainly clean up the report module and make relevant reports easier for staff to find. -- 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=16631 --- Comment #5 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Cab Vinton from comment #3)
Would also be nice to limit access to reports by the home library of the staff.
Some reports are specific to the needs of just one library. Some reports are in development for a while. And so on.
As reports proliferate over time, libraries would welcome any option that reduces the number of reports visible to them.
+1 -- 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=16631 --- Comment #6 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Daniel Gaghan from comment #4)
Having the ability to limit who can see which reports would help a lot at PCCLD. It would certainly clean up the report module and make relevant reports easier for staff to find.
+1 -- 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=16631 --- Comment #7 from Christopher Brannon <cbrannon@cdalibrary.org> --- Perhaps a branch field and a borrower field could be added. If the field is empty, it applies to everyone. Otherwise, it would be limited to matching borrower IDs or branches. -- 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=16631 --- Comment #8 from Cab Vinton <bibliwho@gmail.com> --- Shame this enhancement hasn't got any traction, but I thought of a kludge that would work in a pinch -- Add a comment with a unique string to all reports in a particular grouping (e.g., for circ staff, a particular branch, etc.), then use the string in the keyword filter on the left. Only reports with that particular string will then be shown in the Reports module. In theory, multiple strings could be used to cover reports in more than one group. I believe the keyword filter is actually doing a phrase search, though, so some careful planning would be required. As I said, a kludge ... -- 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=16631 Christine <chlee@pascolibraries.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |chlee@pascolibraries.org --- Comment #9 from Christine <chlee@pascolibraries.org> --- We're also interested in this enhancement for reports. We've accumulated a large amount of reports since joining in 2014. Many of these are kept for reference and as a record. Since these are not useful for the majority of our staff, we'd like these to be hidden in a restricted Report Group. It would make it a clutter-free experience for staff to search reports while allowing access to those that may need it. -- 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=16631 Alex Carver <alex@rcls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |alex@rcls.org --- Comment #10 from Alex Carver <alex@rcls.org> --- +1 There are many reports that libraries would like that only apply to their own daily operations. It would be helpful to be able to hide these from most users. In addition, something like this would allow pre-baked reports for cron emailing to be hidden from those libraries not specified in the report parameters. -- 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=16631 Angela Berrett <angela.berrett@familysearch.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |angela.berrett@familysearch | |.org --- Comment #11 from Angela Berrett <angela.berrett@familysearch.org> --- +1 The ability to have smaller lists for each staff to browse through to find the report they want would be very helpful. Some staff only use a handful of reports but they have to memorize the title/number for the reports to find them again. Would love to see this feature. -- 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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |ASSIGNED CC| |casey.conlin@gmail.com Assignee|koha-bugs@lists.koha-commun |casey.conlin@gmail.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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Change sponsored?|--- |Sponsored QA Contact|testopia@bugs.koha-communit |casey.conlin@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=16631 --- Comment #12 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184422 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184422&action=edit koha patch file -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184422|0 |1 is obsolete| | Attachment #184422|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #13 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184508 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184508&action=edit Bug 16631: reports-branches -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #14 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184509 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184509&action=edit Bug 16631 0002-Make-DBversion-in-sync-with-the-Koha-module -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184509|application/mbox |text/plain mime type| | Attachment #184509|Bug 16631 |Bug 16631: description|0002-Make-DBversion-in-sync |0002-Make-DBversion-in-sync |-with-the-Koha-module |-with-the-Koha-module Attachment #184509|0 |1 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184508|Bug 16631: reports-branches |Bug 16631: description| |0001-reports_branches-table | |-SQL-established -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #15 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184510 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184510&action=edit Bug 16631: 0003-Add-Filter-Reports-system-preference.-Add-UI-for-man -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #16 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184511 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184511&action=edit Bug 16631: 0004-Add-ReportsBranch.pm -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #17 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184512 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184512&action=edit Bug 16631: 0005-Not-working.-Trying-to-get-branches-to-show-up-in-gu -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #18 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184513 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184513&action=edit Bug 16631: 0006-The-reports-list-can-be-limited-by-library-via-the-q -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #19 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184514 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184514&action=edit Bug 16631: 0007-Add-branch-libraries-to-reports-edit-view -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #20 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184515 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184515&action=edit Bug 16631: 0008-Populate-Library-limitations-selection-with-librarie -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #21 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184516 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184516&action=edit Bug 16631: 0009-Get-selected-reports-and-save-selected-reports-from- -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #22 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184517 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184517&action=edit Bug 16631: 0010-Refactor-getting-selected-lirbaries -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #23 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184518 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184518&action=edit Bug 16631: 0011-Add-library-limits-info-to-duplicate-section-and-fix -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #24 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184519 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184519&action=edit Bug 16631: 0012-Add-unit-tests-for-reports_branches-updates -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #25 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184520 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184520&action=edit Bug 16631: 0013-Pass-the-current-branch-as-the-filter-branchcode -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #26 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184521 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184521&action=edit Bug 16631: 0014-Fix-library-limit-method-issue-by-defining-use-state -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #27 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184522 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184522&action=edit Bug 16631: 0015-Filtering-the-list-based-on-the-library-limits-works -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dcook@prosentient.com.au Status|ASSIGNED |Failed QA --- Comment #28 from David Cook <dcook@prosentient.com.au> --- A few obvious standout problems here: 1. Not sure what your 0005 file is there but it looks like it's not a patch 2. Database updates aren't done via updatedatabase.pl anymore. You'll want to read through https://wiki.koha-community.org/wiki/Database_updates 3. Commit author sometimes seems to be different to the person uploading. Also, sometimes commit author the default one from KTD. Would be good to fix/clarify these. 4. There are no commit messages and no test plan. Take a look at https://wiki.koha-community.org/wiki/Commit_messages 5. Looks like some patches would fail QA based on whitespace and formatting alone. Would be good for the author to use koha-testing-docker from development to avoid those kinds of errors Probably worth squashing a lot of these overall. I'm not sure about this design, but I haven't exhaustively reviewed the code. In any case, great to see some code trying to better organise the reports! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184512|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184508|0 |1 is obsolete| | Attachment #184508|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184509|0 |1 is obsolete| | Attachment #184509|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184510|1 |0 is patch| | Attachment #184510|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184511|0 |1 is obsolete| | Attachment #184511|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184513|1 |0 is patch| | Attachment #184513|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184514|0 |1 is obsolete| | Attachment #184514|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184515|1 |0 is patch| | Attachment #184515|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184516|0 |1 is obsolete| | Attachment #184516|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184517|1 |0 is patch| | Attachment #184517|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184518|1 |0 is patch| | Attachment #184518|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184519|1 |0 is patch| | Attachment #184519|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184520|1 |0 is patch| | Attachment #184520|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184521|1 |0 is patch| | Attachment #184521|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184522|0 |1 is obsolete| | Attachment #184522|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #29 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184525 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184525&action=edit Bug 16631: Update Report Listing -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184525|0 |1 is obsolete| | Attachment #184525|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #30 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184526 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184526&action=edit Bug 16631: Patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #31 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #28)
Probably worth squashing a lot of these overall.
Apologies. I meant squashing ones that changed the same files. Just trying to keep things a bit more cohesive and coherent. (In reply to Casey Conlin from comment #30)
Created attachment 184526 [details] [review] Bug 16631: Patch
This looks very weird. Looks like you've got a rebase problem there. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184526|0 |1 is obsolete| | --- Comment #32 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184657 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184657&action=edit Bug-16631 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184657|0 |1 is obsolete| | --- Comment #33 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184674 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184674&action=edit Patch file for reports enhancement. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184674|0 |1 is obsolete| | --- Comment #34 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184686 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184686&action=edit This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #35 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184687 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184687&action=edit This patch implements the library_limit concept for Report/Reports. Staff can set libaries to which the report should be visible, if the system preference is enabled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184686|0 |1 is obsolete| | Attachment #184686|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184687|0 |1 is obsolete| | Attachment #184687|1 |0 is patch| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #36 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184688 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184688&action=edit Add library limits to reports. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184688|0 |1 is obsolete| | --- Comment #37 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184689 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184689&action=edit Add-library-limits-to-Reports -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184689|0 |1 is obsolete| | --- Comment #38 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184690 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184690&action=edit Add library limits to Reports -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184690|0 |1 is obsolete| | --- Comment #39 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184691 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184691&action=edit 0001-Bug-16631-Institute-library-limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #40 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184692 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184692&action=edit 0002-Bug-16631-Fix-bug_16631 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #41 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184693 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184693&action=edit 0003-Bug-16631-Fix-missing-double-quote-in-guided_reports -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184691|0 |1 is obsolete| | Attachment #184692|0 |1 is obsolete| | Attachment #184693|0 |1 is obsolete| | --- Comment #42 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184694 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184694&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b (1) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #43 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184695 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184695&action=edit 0002-Bug-16631-Institute-library-limits (1) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184694|0 |1 is obsolete| | Attachment #184695|0 |1 is obsolete| | --- Comment #44 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184845 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184845&action=edit Add schema files for reports_branches and adjust saved_sql table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #45 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184846 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184846&action=edit Bug 16631: Institute library limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184845|Add schema files for |Bug 16631: Add schema files description|reports_branches and adjust |for reports_branches and |saved_sql table |adjust saved_sql table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=40546 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184845|0 |1 is obsolete| | Attachment #184846|0 |1 is obsolete| | --- Comment #46 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184847&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #47 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184848 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184848&action=edit Bug 16631: Institute library limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #48 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to David Cook from comment #31)
(In reply to David Cook from comment #28)
Probably worth squashing a lot of these overall.
Apologies. I meant squashing ones that changed the same files. Just trying to keep things a bit more cohesive and coherent.
(In reply to Casey Conlin from comment #30)
Created attachment 184526 [details] [review] [review] Bug 16631: Patch
This looks very weird. Looks like you've got a rebase problem there.
Thank you for the notes, David! This should be ready for review now. Any questions or comments are welcome. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #49 from Casey Conlin <casey.conlin@gmail.com> --- Comment on attachment 184847 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184847 Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table
From 04bb1e1220d059f1d28b48de8a5d095912311ef6 Mon Sep 17 00:00:00 2001 From: "Cameron E. Tidd" <ctidd@citlink.net> Date: Sat, 26 Jul 2025 02:02:50 +0000 Subject: [PATCH 1/2] Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit
This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches.
Sponsored-by: The Ramapo Catskill Library System Test plan: Confirm Initial Settings 1. Log in to Koha staff and set your library as Centerville if itâs not already. 2. Visit the Saved reports. 3. Three (3) previously created reports should be visible.
Verify Patch Settings 4. From the Koha Sandbox, Apply the patch, then Restart services. 5. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 6. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the EnableFilteringReports option. 7. Enable EnableFilteringReports as described in step 6. 8. Go back to Saved reports as in Step 2. 9. Click Edit in the row menu for Report 1. 10. At the bottom of the Report 1 edit page, you should see a Library limitation select box.
Verify the Library Limitation Settings are Persisted 11. Choose Centerville from the select box and click Update SQL. 12. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 13. Verify that Centerville is still in the Library limitation select box. 14. Add Fairfield in the Library limitation select box and click Update and run SQL. 15. Go back to editing Report 1. 16. Confirm the Library limitation select box has both Centerville and Fairfield selected. 17. Duplicate Report 1. 18. Confirm the Library limitation select box has both Centerville and Fairfield selected. 19. Click Save Report. 20. Confirm the Library limitation select box has both Centerville and Fairfield selected.
Verify Reports are Filtered Based on Library Limitations 21. Go to Saved reports as in Step 2. 22. Click Edit for Report 2. 23. Add Fairfield in the Library limitation select box as the only choice and click Update and run SQL. 24. Go to Saved reports as in Step 2. 25. Confirm you do not see Report 2, and only Report 1 and Report 3. 26. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 27. Set your library to Fairfield. 28. Go to Saved reports as in Step 2. 29. Confirm you do not see Report 1, and only Report 2 and Report 3.
Verify Disabling EnableFilteringReports Preference Shows All Reports 30. Disable EnableFilteringReports preference as in steps 5 to 7. 31. Go to Saved reports as in Step 2. 32. Confirm Report 1, Report 2, Report 3 are visible. 33. Click to edit Report 1 and verify there is no Library limitation select box.
Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 34. Enable EnableFilteringReports preference as in steps 5 to 7. 35. Ensure youâre library is set to Fairfield as in step 26. 36. Go to Saved reports as in Step 2. 37. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 38. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected.
Run Unit Tests 39. In the Koha home directory run the command: prove t/db_dependent/Koha/Reports.t 40. The new unit tests for the reprots_branches tables are in this file 41. All tests should pass.
Signoff 42. Sign off if the steps above checkout. --- Koha/Schema/Result/ReportsBranch.pm | 86 ++++++++++++++ Koha/Schema/Result/SavedSql.pm | 220 ++++++++++++++++++++++++++++++++++++ 2 files changed, 306 insertions(+) create mode 100644 Koha/Schema/Result/ReportsBranch.pm
diff --git a/Koha/Schema/Result/ReportsBranch.pm b/Koha/Schema/Result/ReportsBranch.pm new file mode 100644 index 0000000000..80472a5ff1 --- /dev/null +++ b/Koha/Schema/Result/ReportsBranch.pm @@ -0,0 +1,86 @@ +use utf8; + +package Koha::Schema::Result::ReportsBranch; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::ItemtypesBranch + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C<itemtypes_branches> + +=cut + +__PACKAGE__->table("reports_branches"); + +=head1 ACCESSORS + +=head2 report_id + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 1 + size: 80 + +=head2 branchcode + + data_type: 'varchar' + is_foreign_key: 1 + is_nullable: 0 + size: 10 + +=cut + +__PACKAGE__->add_columns( + "report_id", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 80 }, + "branchcode", + { data_type => "varchar", is_foreign_key => 1, is_nullable => 0, size => 10 }, +); + +=head1 RELATIONS + +=head2 branchcode + +Type: belongs_to + +Related object: L<Koha::Schema::Result::Branch> + +=cut + +__PACKAGE__->belongs_to( + "branchcode", + "Koha::Schema::Result::Branch", + { branchcode => "branchcode" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + +=head2 itemtype + +Type: belongs_to + +Related object: L<Koha::Schema::Result::Itemtype> + +=cut + +__PACKAGE__->belongs_to( + "report_id", + "Koha::Schema::Result::Report", + { report_id => "report_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "RESTRICT" }, +); + +# Created by DBIx::Class::Schema::Loader v0.07048 @ 2019-07-04 04:56:48 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cBTswjKV8VWN1iueB+PygQ + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/SavedSql.pm b/Koha/Schema/Result/SavedSql.pm index 6f75ae3b31..88d54b52ef 100644 --- a/Koha/Schema/Result/SavedSql.pm +++ b/Koha/Schema/Result/SavedSql.pm @@ -185,6 +185,221 @@ __PACKAGE__->add_columns(
__PACKAGE__->set_primary_key("id");
+=head1 RELATIONS + +=head2 reports_branches + +Type: has_many + +Related object: L<Koha::Schema::Result::ReportsBranch> + +=cut + +__PACKAGE__->has_many( + "reports_branches", + "Koha::Schema::Result::ReportsBranch", + { "foreign.report_id" => "self.id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07051 @ 2025-07-26 01:58:59 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:w7XKvOV/ylS6Dq8tsUNmSg +# These lines were loaded from '/kohadevbox/koha/Koha/Schema/Result/SavedSql.pm' found in @INC. +# They are now part of the custom portion of this file +# for you to hand-edit. If you do not either delete +# this section or remove that file from @INC, this section +# will be repeated redundantly when you re-create this +# file again via Loader! See skip_load_external to disable +# this feature. + +use utf8; +package Koha::Schema::Result::SavedSql; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::SavedSql + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C<saved_sql> + +=cut + +__PACKAGE__->table("saved_sql"); + +=head1 ACCESSORS + +=head2 id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +unique id and primary key assigned by Koha + +=head2 borrowernumber + + data_type: 'integer' + is_nullable: 1 + +the staff member who created this report (borrowers.borrowernumber) + +=head2 date_created + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +the date this report was created + +=head2 last_modified + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +the date this report was last edited + +=head2 savedsql + + data_type: 'mediumtext' + is_nullable: 1 + +the SQL for this report + +=head2 last_run + + data_type: 'datetime' + datetime_undef_if_invalid: 1 + is_nullable: 1 + +=head2 report_name + + data_type: 'varchar' + default_value: (empty string) + is_nullable: 0 + size: 255 + +the name of this report + +=head2 type + + data_type: 'varchar' + is_nullable: 1 + size: 255 + +always 1 for tabular + +=head2 notes + + data_type: 'mediumtext' + is_nullable: 1 + +the notes or description given to this report + +=head2 cache_expiry + + data_type: 'integer' + default_value: 300 + is_nullable: 0 + +=head2 public + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=head2 report_area + + data_type: 'varchar' + is_nullable: 1 + size: 6 + +=head2 report_group + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 report_subgroup + + data_type: 'varchar' + is_nullable: 1 + size: 80 + +=head2 mana_id + + data_type: 'integer' + is_nullable: 1 + +=cut + +__PACKAGE__->add_columns( + "id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "borrowernumber", + { data_type => "integer", is_nullable => 1 }, + "date_created", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "last_modified", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "savedsql", + { data_type => "mediumtext", is_nullable => 1 }, + "last_run", + { + data_type => "datetime", + datetime_undef_if_invalid => 1, + is_nullable => 1, + }, + "report_name", + { data_type => "varchar", default_value => "", is_nullable => 0, size => 255 }, + "type", + { data_type => "varchar", is_nullable => 1, size => 255 }, + "notes", + { data_type => "mediumtext", is_nullable => 1 }, + "cache_expiry", + { data_type => "integer", default_value => 300, is_nullable => 0 }, + "public", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, + "report_area", + { data_type => "varchar", is_nullable => 1, size => 6 }, + "report_group", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "report_subgroup", + { data_type => "varchar", is_nullable => 1, size => 80 }, + "mana_id", + { data_type => "integer", is_nullable => 1 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L</id> + +=back + +=cut + +__PACKAGE__->set_primary_key("id"); +
# Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:198dNG9DGQzop+s5IHy7sw @@ -214,3 +429,8 @@ sub koha_objects_class { }
1; +# End of lines loaded from '/kohadevbox/koha/Koha/Schema/Result/SavedSql.pm' + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.15.0
-- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184847|0 |1 is obsolete| | Attachment #184848|0 |1 is obsolete| | --- Comment #50 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184859 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184859&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #51 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 184861 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=184861&action=edit Bug 16631: Institute library limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #52 from Casey Conlin <casey.conlin@gmail.com> --- This patch is ready for review at https://sandboxes.biblibre.eu/ -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 David Nind <david@davidnind.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |david@davidnind.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Anneli Österman <anneli.osterman@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off CC| |anneli.osterman@koha-suomi. | |fi --- Comment #53 from Anneli Österman <anneli.osterman@koha-suomi.fi> --- I tested this in Casey's sandbox and it worked as in the test plan. I can not run the unit test, so maybe someone else could do that part? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lucas@bywatersolutions.com Status|Signed Off |Failed QA --- Comment #54 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Hi Casey, Tests are failing here, can you have a look? t/db_dependent/Koha/Reports.t -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #55 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #54)
Hi Casey,
Tests are failing here, can you have a look?
t/db_dependent/Koha/Reports.t
Hi, Lucas, thanks for taking a look here! When you ran the test command, were you in ktd shell? I omitted that step from my the test plan. run: ktd --shell kohadev-koha@kohadevbox:koha(16631-reports-libraries-filter-patch)$ t/db_dependent/Koha/Reports.t 1..10 ok 1 - Adding a new report should have set the id ok 2 - The 2 reports should have been added ok 3 - Find a report by id should return the correct report ok 4 - Delete should have deleted the report # Subtest: prep_report 1..4 ok 1 - Expected sql generated correctly with single param and name ok 2 - Expected sql generated correctly with multiple params and names ok 3 - Expected sql generated correctly with multiple params and no names ok 4 ok 5 - prep_report # Subtest: is_sql_valid 1..15 ok 1 - Empty sql is missing SELECT ok 2 - Nonsense sql is missing SELECT ok 3 - select FOO is good ok 4 - select FOO with UPDATE BAR ok 5 - UPDATE qux ok 6 - select FOO with DELETE BAR ok 7 - DELETE qux ok 8 - select FOO with DROP BAR ok 9 - DROP qux ok 10 - select FOO with INSERT BAR ok 11 - INSERT qux ok 12 - select FOO with SHOW BAR ok 13 - SHOW qux ok 14 - select FOO with CREATE BAR ok 15 - CREATE qux ok 6 - is_sql_valid # Subtest: check_columns 1..3 ok 1 - Bad column found in SQL ok 2 - No bad column found in SQL ok 3 - Check column_names parameter ok 7 - check_columns # Subtest: _might_add_limit 1..10 ok 1 - Pref is undefined, no changes ok 2 - Pref is zero, no changes ok 3 - Pref is empty, no changes ok 4 - Limit 10 found at the end ok 5 - Already contains a limit ok 6 - Variation, also contains a limit ok 7 - Subquery, limit 10 found at the end ok 8 - Subquery variation, limit 10 found at the end ok 9 - Subquery lc variation, limit 10 found at the end ok 10 - Query refers to limit field, limit 10 found at the end ok 8 - _might_add_limit # Subtest: reports_branches are added and removed from report_branches table 1..4 ok 1 - 3 branches added to report_branches table ok 2 - 1 branch removed from report_branches table ok 3 - Report deleted, count is back to original ok 4 - No branches left in reports_branches table after report deletion ok 9 - reports_branches are added and removed from report_branches table ok 10 - no warnings -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #56 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #54)
Hi Casey,
Tests are failing here, can you have a look?
t/db_dependent/Koha/Reports.t
It might be necessary to run reset_all to update the db with the new tables before running the test command. I can add this to the test plan in the commit if necessary. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|casey.conlin@gmail.com |testopia@bugs.koha-communit | |y.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Myka Kennedy Stephens <mkstephens@fosgail.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mkstephens@fosgail.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #57 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #54)
Hi Casey,
Tests are failing here, can you have a look?
t/db_dependent/Koha/Reports.t
Hi Lucas. I see a couple changes to the status here and it's back at Needs Signoff now. Were you able to run the tests? Are we still at Needs Signoff? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Michael Grgurev <mike.grgurev@mainlib.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mike.grgurev@mainlib.org --- Comment #58 from Michael Grgurev <mike.grgurev@mainlib.org> --- Main Library Alliance would like to make a comment regarding consortium use, partially relating back to the original submission by Christopher Brannon. While this feature may definitely prove useful to us, particularly for test reports, it didn't seem like there was a way for a superlibrarian to "view all" when demoing on the sandbox, unless I missed an option somewhere. In smaller systems this may not be as much of an issue, but in larger systems (56 and counting here, not counting lockers & bookmobiles) an admin having to manually check each branch could be a nuisance. Some pathway for at least superlibrarians to "view all" would be preferable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- See Also| |https://bugs.koha-community | |.org/bugzilla3/show_bug.cgi | |?id=35693 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #184859|0 |1 is obsolete| | Attachment #184861|0 |1 is obsolete| | --- Comment #59 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185627 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185627&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #60 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185628 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185628&action=edit Bug 16631: Institute library limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185627|0 |1 is obsolete| | Attachment #185628|0 |1 is obsolete| | --- Comment #61 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185779 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185779&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b-1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #62 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185780 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185780&action=edit 0002-Bug-16631-Institute-library-limits-1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185780|0 |1 is obsolete| | --- Comment #63 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185781 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185781&action=edit 185780: 0002-Bug-16631-Institute-library-limits-1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185781|0 |1 is obsolete| | --- Comment #64 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185782 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185782&action=edit 0002-Bug-16631-Institute-library-limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185779|0 |1 is obsolete| | --- Comment #65 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185788 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185788&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b-1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185782|0 |1 is obsolete| | --- Comment #66 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185789 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185789&action=edit 0002-Bug-16631-Institute-library-limits -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185788|0 |1 is obsolete| | --- Comment #67 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 185790 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=185790&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b-1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #68 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Michael Grgurev from comment #58)
Main Library Alliance would like to make a comment regarding consortium use, partially relating back to the original submission by Christopher Brannon.
While this feature may definitely prove useful to us, particularly for test reports, it didn't seem like there was a way for a superlibrarian to "view all" when demoing on the sandbox, unless I missed an option somewhere. In smaller systems this may not be as much of an issue, but in larger systems (56 and counting here, not counting lockers & bookmobiles) an admin having to manually check each branch could be a nuisance.
Some pathway for at least superlibrarians to "view all" would be preferable.
Thanks for this note Michael! This is a great point, and the suggestion for a view all button is very helpful. Taking your feedback here into consideration, we've added a new permission that would give a user access to managing limits on reports, and a button that will enable superlibrarians and users with this permission to toggle between viewing all reports and viewing only reports that match the user's current branch. Please let me know if you have any other questions or comments. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> 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=16631 Michelle Spinney <mspinney@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |mspinney@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #69 from Casey Conlin <casey.conlin@gmail.com> --- We have a sandbox set up named b16631 at https://sandboxes.biblibre.eu/ that has some users and reports set up to align with the test plan. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |martin.renvoize@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Ludovic <ludovic.julien@inLibro.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ludovic.julien@inLibro.com Status|Needs Signoff |Patch doesn't apply --- Comment #70 from Ludovic <ludovic.julien@inLibro.com> --- Hello, Thank you for your work on the patch! I tried to apply it to my local Koha instance in order to run some tests, but unfortunately there's a merge conflict preventing me from proceeding. Thanks again and looking forward to your update! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #71 from Ludovic <ludovic.julien@inLibro.com> --- I just realized I forgot to update my previous message — sorry about that. I was able to apply the patch, but when I set EnableFilteringReports to "Enable" in system preferences, I get a 500 error when accessing the "Reports" page. Let me know if there's anything I can provide to help debug this (logs, environment info, etc.). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185790|0 |1 is obsolete| | --- Comment #72 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 186299 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186299&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b-2.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #185789|0 |1 is obsolete| | --- Comment #73 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 186300 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186300&action=edit 0002-Bug-16631-Institute-library-limits-1.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #74 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Ludovic from comment #70)
Hello,
Thank you for your work on the patch! I tried to apply it to my local Koha instance in order to run some tests, but unfortunately there's a merge conflict preventing me from proceeding.
Thanks again and looking forward to your update!
I see your additional comment; just commenting for clarity. I made up new patch files based on a new pull from main and attached them here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #75 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Ludovic from comment #71)
I just realized I forgot to update my previous message — sorry about that.
I was able to apply the patch, but when I set EnableFilteringReports to "Enable" in system preferences, I get a 500 error when accessing the "Reports" page.
Let me know if there's anything I can provide to help debug this (logs, environment info, etc.).
If you're running locally, did you apply the db changes? The test plan is written for testing on the Koha sandbox until the end when unit tests are required. If you can update the db after applying the patch, that issue might go away. The steps related to that are below. 73. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 74. Run command: reset_all to drop and recreate the koha database. Thank you for checking this out and for your feedback! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #76 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Casey, Thanks for your work here, it's looking good. I did notice that if I run updatedatabase twice I get an error. I think you need to wrapped that creation of the table SQL with something like: unless ( TableExists('reports_branches') ) { } -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186300|0 |1 is obsolete| | --- Comment #77 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 186335 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186335&action=edit 0002-Bug-16631-Institute-library-limits-2.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #78 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #76)
Casey,
Thanks for your work here, it's looking good. I did notice that if I run updatedatabase twice I get an error. I think you need to wrapped that creation of the table SQL with something like:
unless ( TableExists('reports_branches') ) {
}
Great feedback! I got the same error you described when running the update command. I updated the bug.pl file to account for an existing table, and I was able to run the update command successfully. Let me know if you have any other questions or feedback. Thanks, Lucas! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186299|0 |1 is obsolete| | --- Comment #79 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 186393 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186393&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186393|0 |1 is obsolete| | --- Comment #80 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 186632 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186632&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186335|0 |1 is obsolete| | --- Comment #81 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 186633 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186633&action=edit 0002-Bug-16631-Institute-library-limits-1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Failed QA --- Comment #82 from David Cook <dcook@prosentient.com.au> --- It would be good to clarify the intention of this change. On one hand, the title is "Show groups/categories of reports to authorized staff", which implies that the change is just a visual/organisational one. On the other hand, on the /cgi-bin/koha/reports/guided_reports.pl page, the hint for "Library limitation" says "Limits the use of this report to the selected libraries.", which implies that the change is restricting usage of reports based on some kind of library setting. In practice, the change appears to only be visual/organisational, since you can bypass "Library limitation" by changing the "id" URL parameter. In my test, I can only see report #2, so I run report #2, but then I am curious about report #1, so I change the URL and now I'm running a report that I'm not supposed to be able to see. It's not 100% clear to me at this stage if that's a bug or a feature. I'm guessing bug, but I figure it's worth asking the question here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #83 from David Cook <dcook@prosentient.com.au> --- Comment on attachment 186633 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=186633 0002-Bug-16631-Institute-library-limits-1 Review of attachment 186633: --> (https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=16631&attachment=186633) ----------------------------------------------------------------- ::: Koha/Reports.pm @@ +33,4 @@
=cut
+=head3 search_with_localization
This function doesn't appear to be used in Koha? Could you clarify its purpose? ::: reports/guided_reports.pl @@ +87,5 @@
+if ( defined $input->param('show_all') ) { + my $param = $input->param('show_all'); + if ( defined $param && $param eq '1' ) { + $show_all = 1; + $session->param( 'show_all', 1 ) if $session;
Since the session is for the whole of Koha, it would be wise to prefix this session parameter key with something like "reports_". That being said, generally speaking we don't use the Koha database session for sticky view settings. This would probably be done better using localStorage or a cookie I would think. Alternatively, I'm not sure it's really necessary for this to be sticky either? @@ +1115,5 @@
my $subgroup = $input->param('subgroup'); $filter->{group} = $group; $filter->{subgroup} = $subgroup; + + my $pref_limit_reports_by_branch = C4::Context->preference("LimitReportsByBranch");
This block seems like it has quite a bit of copy/paste. Ideally we shouldn't be repeating code unnecessarily. The unique conditional code could be done above the repeated part, or you could move the repeated part into a function and call it twice. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #84 from David Cook <dcook@prosentient.com.au> --- I think it would be useful to optionally show the library limitation in the table on /cgi-bin/koha/reports/guided_reports.pl?op=list Like... have it default to not shown, but then use the "Columns" button on the table to show it. Otherwise, I need to check each report one by one to try to figure out which library limitations it has. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #85 from David Cook <dcook@prosentient.com.au> --- (In reply to David Cook from comment #83)
Comment on attachment 186633 [details] [review] 0002-Bug-16631-Institute-library-limits-1
Review of attachment 186633 [details] [review]: -----------------------------------------------------------------
::: Koha/Reports.pm @@ +33,4 @@
=cut
+=head3 search_with_localization
This function doesn't appear to be used in Koha? Could you clarify its purpose?
I think that this is probably a copy/paste error where Koha/Reports.pm was created from Koha/ItemTypes.pm? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #86 from David Cook <dcook@prosentient.com.au> --- Overall, I'm a bit curious about the workflow. Is the idea that there are cross-branch librarians who prepare the reports and assign them to the libraries? If you have create_reports and execute_reports but not manage_report_limits, then your reports are by default open to all libraries. Does this make sense? When "LimitReportsByBranch" is enabled, should reports for non-privileged report creators default to their home library? Should it then be necessary for a privileged user to share that report with other libraries? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #87 from Alex Carver <alex@rcls.org> --- Hi David-- Yes, this is the workflow that we're looking for at RCLS. We have a library headquarters location defined (with a small circulating professional collection) and reports are written by RCLSHQ staff only. We're nearing on 300+ reports in our prod server, and many of them are Admin or Annual State reports that don't concern our member libraries. This bug will keep the reports module clean and useful for library staff while still keeping admin reports available to admins. We're also looking forward to creating pre-baked parameter reports that can be emailed via cron. With 46 member libraries, offering these will exponentially balloon our reports library. The ability to hide them for libraries they don't apply to will keep the interface usable. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #88 from David Cook <dcook@prosentient.com.au> --- (In reply to Alex Carver from comment #87)
Hi David-- Yes, this is the workflow that we're looking for at RCLS. We have a library headquarters location defined (with a small circulating professional collection) and reports are written by RCLSHQ staff only. We're nearing on 300+ reports in our prod server, and many of them are Admin or Annual State reports that don't concern our member libraries. This bug will keep the reports module clean and useful for library staff while still keeping admin reports available to admins.
Thanks for sharing that, Alex. That's good to know. What do you think about my comment about how the reports created by your member libraries will be available to all member libraries. Is that something you'd still want? Or should they be limited so that member libraries only see reports created by their own librarians? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 David Cook <dcook@prosentient.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Summary|Show groups/categories of |Limit listing of reports |reports to authorized staff |using patron library -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #89 from Alex Carver <alex@rcls.org> --- Hi David. In my system--no one can create reports except for me. Thinking through how it would work for other setups, though, it seems to me like anyone who can create a report should be able to assign the reports to libraries as well. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #90 from David Cook <dcook@prosentient.com.au> --- (In reply to Alex Carver from comment #89)
Hi David. In my system--no one can create reports except for me. Thinking through how it would work for other setups, though, it seems to me like anyone who can create a report should be able to assign the reports to libraries as well.
I think that could make sense, especially in the context of Library Groups, although that's not how the patched code works. Actually, now that I'm thinking about Library Groups, limiting by library groups could be interesting as well... -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #91 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to David Cook from comment #90)
(In reply to Alex Carver from comment #89)
Hi David. In my system--no one can create reports except for me. Thinking through how it would work for other setups, though, it seems to me like anyone who can create a report should be able to assign the reports to libraries as well.
I think that could make sense, especially in the context of Library Groups, although that's not how the patched code works.
(In reply to David Cook from comment #90)
(In reply to Alex Carver from comment #89)
Hi David. In my system--no one can create reports except for me. Thinking through how it would work for other setups, though, it seems to me like anyone who can create a report should be able to assign the reports to libraries as well.
I think that could make sense, especially in the context of Library Groups, although that's not how the patched code works.
In the current patch, the ability to limit which libraries can access a report is separated from the ability to create reports. The permission 'Manage Report Limits' was added to allow users besides Superlibrarians to manage who can see reports. This decouples the report access management from report creation, which should be a less-disruptive way to add this enhancement and have admins utilize it; users with the 'Create SQL reports permission' permission will not automatically be able to limit report access, which would be the case if the ability to manage filters were tied directly to this permission. Regarding which users can see reports outlined in comment 82 (snippet below), the intention at this point is to limit what's shown in the reports list, but not limit access to limited reports. The language clarifying the preference in System preferences, "limiting report access based on staff home library," needs to be amended to reflect this more clearly.
From comment 82: In my test, I can only see report #2, so I run report #2, but then I am curious about report #1, so I change the URL and now I'm running a report that I'm not supposed to be able to see.
It's not 100% clear to me at this stage if that's a bug or a feature. I'm guessing bug, but I figure it's worth asking the question here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Danielle <dmeininger591@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dmeininger591@gmail.com -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186632|0 |1 is obsolete| | --- Comment #92 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 188444 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188444&action=edit 0001-Bug-16631-DO-NOT-PUSH-Add-schema-files-for-reports_b.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #186633|0 |1 is obsolete| | --- Comment #93 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 188445 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=188445&action=edit 0002-Bug-16631-Institute-library-limits.patch -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #94 from Casey Conlin <casey.conlin@gmail.com> --- After some discussion, we've implemented restrictions on reports users aren't permitted to access. Please let us know if you have any questions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #95 from Chris Cormack <chris@bigballofwax.co.nz> --- Automatic patch test results: â ï¸ The patch applies with fuzzy option (ignoring whitespace). This may indicate minor conflicts that need to be resolved. Details: Patch applies with fuzzy option (ignoring whitespace) This is an automated message from the patch testing system. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #96 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 189818 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189818&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #97 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 189819 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=189819&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable EnableFilteringReports preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show CPL (Centerville), Re port 2 should show FFL (Fairfield), and Report 3 should show no limitations). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188444|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=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #188445|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=16631 Brendan Lawlor <blawlor@clamsnet.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |blawlor@clamsnet.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189818|0 |1 is obsolete| | --- Comment #98 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190276 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190276&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #99 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190277 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190277&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable EnableFilteringReports preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show CPL (Centerville), Re port 2 should show FFL (Fairfield), and Report 3 should show no limitations). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #189819|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=16631 carthur@slolibrary.org <carthur@slolibrary.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |carthur@slolibrary.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #100 from carthur@slolibrary.org <carthur@slolibrary.org> --- +1 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Elizabeth Hoffman <ehoffman@plumcreeklibrary.net> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |ehoffman@plumcreeklibrary.n | |et -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Jason Robb <jrobb@sekls.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jrobb@sekls.org Status|Needs Signoff |Failed QA --- Comment #101 from Jason Robb <jrobb@sekls.org> --- In the section starting with step 68, logging in with a patron that does *not* have the permission, the "Actions" column in the "Saved reports" table is consistently hidden by default. Otherwise, up to that point everything seems to be working well as described! Some other considerations: It would be nice if the "Library limitation" multi-select used a select2 element like Koha uses elsewhere. That would also allow that input to fit nicely in the area above the SQL block since it takes up less space. You can see an example at Administration > Item Types > Edit (/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK) Likewise, it would be nice if the "Library limits" column were consistent with the style that the Item types table uses, where it says the number of limitations and hovering that gives the library names and codes. That's visible under Administration > Item types after you've set some limitations on an item type (/cgi-bin/koha/admin/itemtypes.pl) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190276|0 |1 is obsolete| | --- Comment #102 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190573 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190573&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190277|0 |1 is obsolete| | --- Comment #103 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190574 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190574&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable EnableFilteringReports preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show CPL (Centerville), Re port 2 should show FFL (Fairfield), and Report 3 should show no limitations). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Fix actions column, add select2 to limits, move limits, update limits column. Fix actions column, add select2 to limits, move limits, update limits column. Update column visibility handling. Remove note. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Needs Signoff --- Comment #104 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Jason Robb from comment #101)
In the section starting with step 68, logging in with a patron that does *not* have the permission, the "Actions" column in the "Saved reports" table is consistently hidden by default.
Otherwise, up to that point everything seems to be working well as described!
Some other considerations:
It would be nice if the "Library limitation" multi-select used a select2 element like Koha uses elsewhere. That would also allow that input to fit nicely in the area above the SQL block since it takes up less space.
You can see an example at Administration > Item Types > Edit (/cgi-bin/koha/admin/itemtypes.pl?op=add_form&itemtype=BK)
Likewise, it would be nice if the "Library limits" column were consistent with the style that the Item types table uses, where it says the number of limitations and hovering that gives the library names and codes.
That's visible under Administration > Item types after you've set some limitations on an item type (/cgi-bin/koha/admin/itemtypes.pl)
Thank you for this feedback Jason! We were able to address each of the items you mentioned.
In the section starting with step 68, logging in with a patron that does *not* have the permission, the "Actions" column in the "Saved reports" table is consistently hidden by default.
Great catch here! This has been fixed.
It would be nice if the "Library limitation" multi-select used a select2 element like Koha uses elsewhere. That would also allow that input to fit nicely in the area above the SQL block since it takes up less space.
Thank you for this suggestion (and for the lead on where to find a similar implementation). This has been implemented in the new patch files, and it looks and functions better.
Likewise, it would be nice if the "Library limits" column were consistent with the style that the Item types table uses, where it says the number of limitations and hovering that gives the library names and codes.
This is also a great suggestion. We've implemented this, and the result is a much cleaner-looking table. Thank you again for this feedback. Please let me know if you find anything else we can improve here. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190573|0 |1 is obsolete| | --- Comment #105 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190749 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190749&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190574|0 |1 is obsolete| | --- Comment #106 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190750 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190750&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable EnableFilteringReports preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and FFL (Fairfield) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190749|0 |1 is obsolete| | --- Comment #107 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190751 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190751&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190750|0 |1 is obsolete| | --- Comment #108 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 190752 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=190752&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable EnableFilteringReports preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Katie Bliss <kebliss@dmpl.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |kebliss@dmpl.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply --- Comment #109 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- doesnt apply cleanly -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190751|0 |1 is obsolete| | --- Comment #110 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 191601 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191601&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #190752|0 |1 is obsolete| | --- Comment #111 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 191602 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=191602&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable EnableFilteringReports preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #112 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Lucas Gass (lukeg) from comment #109)
doesnt apply cleanly
This should be fixed now. Sorry to miss that. Thanks for catching, Luke! -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |emmi.takkinen@koha-suomi.fi -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #113 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Doesn't apply cleanly to current main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191601|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=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #191602|0 |1 is obsolete| | --- Comment #114 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192980 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192980&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable EnableFilteringReports preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #115 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- Created attachment 192981 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=192981&action=edit Bug 16631: DBIC changes DO NOT PUSH -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Needs Signoff --- Comment #116 from Lucas Gass (lukeg) <lucas@bywatersolutions.com> --- rebased for current main -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #117 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Testing this right now, could the ReportsBranch.pm be included to the schema files? Without it editing reports results to error 500 and it has to be generated manually. Also EnableFilteringReports mentioned in test plan (step 42.) is only mentioned in file UsageStats.pm and no where else in code. Syspref LimitReportsByBranch on the other hand is not in UsageStats.pm. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #118 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 193063 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193063&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192980|0 |1 is obsolete| | --- Comment #119 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 193064 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193064&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193063|0 |1 is obsolete| | --- Comment #120 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 193075 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193075&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193064|0 |1 is obsolete| | --- Comment #121 from Casey Conlin <casey.conlin@gmail.com> --- Created attachment 193076 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193076&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #192981|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=16631 --- Comment #122 from Casey Conlin <casey.conlin@gmail.com> --- (In reply to Emmi Takkinen from comment #117)
Testing this right now, could the ReportsBranch.pm be included to the schema files? Without it editing reports results to error 500 and it has to be generated manually.
Also EnableFilteringReports mentioned in test plan (step 42.) is only mentioned in file UsageStats.pm and no where else in code. Syspref LimitReportsByBranch on the other hand is not in UsageStats.pm.
Thank you for testing Emmi! It looks like ReportsBranch.pm was dropped in a previous rebase, but it should be back now. You're right, EnableFilteringReports should be LimitReportsByBranch. It has been updated in UsageStats.pm and in step 42. This was a name that was ultimately updated, but missed in these to places. Thank you! Nice catch! Please let me know if you see any other issues. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193075|0 |1 is obsolete| | --- Comment #123 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 193167 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193167&action=edit Bug 16631: [DONOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193076|0 |1 is obsolete| | --- Comment #124 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Created attachment 193168 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=193168&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Emmi Takkinen <emmi.takkinen@koha-suomi.fi> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off --- Comment #125 from Emmi Takkinen <emmi.takkinen@koha-suomi.fi> --- Works as described, signing off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #126 from Casey Conlin <casey.conlin@gmail.com> --- Updates to Koha manual were made in this MR for the Koha manual repo: https://gitlab.com/koha-community/koha-manual/-/merge_requests/1171 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Text to go in the| |This enhancement adds the release notes| |ability to limit saved | |reports to users based on | |the user’s home library. | |When enabled via the new | |LimitReportsByBranch system | |preference, staff members | |with the | |manage_report_limits | |permission and | |superlibrarians can | |restrict which libraries | |have access to individual | |reports. Staff members will | |only see reports assigned | |to their home library (or | |reports with no | |limitations), ensuring that | |catalogers and staff at | |different libraries only | |have access to the reports | |relevant to their library. | | | |To use this feature, enable | |the LimitReportsByBranch | |system preference in | |Administration > System | |Preferences > Reports. Then | |grant the | |manage_report_limits | |permission to staff members | |who should be able to | |manage which libraries can | |access reports. When | |editing a saved report, | |users with this permission | |will see a "Library | |limitation" select box at | |the bottom of the edit | |form, where they can choose | |one or more libraries that | |should have access to the | |report. Reports with no | |library limitations remain | |visible to all users. | | | |The saved reports list | |includes a new "Library | |limits" column (visible | |only to users with the | |manage_report_limits | |permission or | |superlibrarians) that | |displays how many libraries | |each report is limited to. | |Hovering over the count | |shows a tooltip with the | |full library names and | |codes. Users with the | |manage_report_limits | |permission also have access | |to a "Show reports" filter | |with options to view all | |reports ("Show all | |reports") or only reports | |available to their home | |library ("Show my branch | |reports"). | | | |When upgrading, a new table | |(reports_branches) is | |created to track the | |relationships between | |reports and libraries. A | |new system preference | |(LimitReportsByBranch) is | |added to enable the | |feature, and a new | |permission | |(manage_report_limits) is | |added to control who can | |manage report limitations. | |Library limitations are | |preserved when duplicating | |reports and persist when | |the LimitReportsByBranch | |preference is toggled on or | |off. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #193167|0 |1 is obsolete| | Attachment #193168|0 |1 is obsolete| | --- Comment #127 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 194443 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194443&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #128 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 194444 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=194444&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com --- Comment #129 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Where you've used the term "branch," you should instead use "library" (https://wiki.koha-community.org/wiki/Terminology) The model here is a bit inconsistent with how Koha manages library limitations and the related permission in other cases. For patron data, we have the permissions "edit_borrowers" and "view_borrower_infos_from_any_libraries." With just "edit_borrowers," one can interact with only patrons from one's own library/group and any patron one creates is automatically set to one's own library/group. When "view_borrower_infos_from_any_libraries" is added, one can interact with patrons from any library and choose any library when creating a patron. As you've implemented this, users without "Manage report limits" can only create reports that are shown to the whole system. It would be helpful if such a user were able to limit a report they create to only their own library. Similarly, it would be helpful if such a user were able to filter the list of saved reports to show only the reports limited to their library (hiding the reports without limits). I'd like to see the "Manage report limits" permission here changed to "View all reports" and for these permissions to be enforced such that: - a user with create_reports but not view_all_reports can save a report as either un-limited or limited to only their own library. - a user with execute_reports but not view_all_reports can see reports without library limit or reports limited to their library and can use the library filter on the list of saved reports - a user with delete_reports but not view_all_reports can *only* delete reports limited to their own library. This makes deletion inconsistent with creation and execution, but I think that inconsistency is outweighed by the worry that a user will delete system-wide reports that other libraries depend on. Maybe we also need a distinct delete_all_reports permission? The issue of system-wide report deletion also exists with the existing permissions structure of your patches. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #130 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- My feedback above is partly based on discussions already underway in the community to rework permissions as a whole to follow a structure of: - allow an action only at one's own library - allow an action at one's own library and in any associated group - allow an action at any library For reports, I think that would mean a set of library/group/all permissions for each action (execute, create, and delete). That's a lot more work than you've set out for here -- especially the part involving library groups -- but I think what I've suggested above allows a meaningful short term gain that does not complicate plans for future work. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |lisette@bywatersolutions.co | |m -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #131 from Christopher Brannon <cbrannon@cdalibrary.org> --- If we are going to follow other examples in Koha, should we also allow reports to be private? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #132 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Thinking on this some more, it feels like if LimitReportsByBranch system preference is on then a user without the broader permission should be constrained to only interacting with reports connected to their own branch. A report that's available to all branches should be assumed to be important/privileged. Users with only base-level reports permissions should not be allowed to crowd the list of reports for all users or delete reports that are available to all users. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #133 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Christopher Brannon from comment #131)
If we are going to follow other examples in Koha, should we also allow reports to be private?
Sure, but that feels like a separate ask and therefore a separate bug. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #134 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Andrew Fuerste-Henry from comment #133)
(In reply to Christopher Brannon from comment #131)
If we are going to follow other examples in Koha, should we also allow reports to be private?
Sure, but that feels like a separate ask and therefore a separate bug.
I'm just going off an earlier comment about keeping permissions consistent. We can make it as inconsistent as we want, if that flies with the community. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #135 from Christopher Brannon <cbrannon@cdalibrary.org> --- (In reply to Andrew Fuerste-Henry from comment #132)
Thinking on this some more, it feels like if LimitReportsByBranch system preference is on then a user without the broader permission should be constrained to only interacting with reports connected to their own branch. A report that's available to all branches should be assumed to be important/privileged. Users with only base-level reports permissions should not be allowed to crowd the list of reports for all users or delete reports that are available to all users.
That seems reasonable, but a little late in planning maybe. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194443|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=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #194444|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=16631 --- Comment #136 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 196120 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196120&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #137 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 196121 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=196121&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it’s not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch, then Restart services. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for “StaffReportLimitUser” in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you’re viewing only your branch’s reports in the filter. 53. Under Filter in the left sidebar, type “2” in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type “1” in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user’s library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as a previously created staff user without report permissions. 70. Confirm the staff user’s library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. Verify limited reports are not visible to users without permissions 76. Log out of the staff user account without permissions. 77. Log in as a superlibrarian or a user with the Manage Report Limits permission. 78. Copy the URL for the edit page of Report 1, and log out of the superlibrarian or user with permissions account. 79. Log in as, StaffNoLimitPermission, the user without the Manage Report Limits permission. 80. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 81. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 82. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 83. Run command: reset_all to drop and recreate the koha database. 84. Run command prove t/db_dependent/Koha/Reports.t to run the test. 85. The new unit tests for the reports_branches tables are in this file. 86. All tests should pass. 87. Run command prove t/Koha/Auth/Permissions.t 88. Permissions unit tests in this file were updated. 89. All tests should pass 90. Run command prove t/db_dependent/Reports/Guided.t 91. The Guided report tests were updated to account for the new library limitations and permissions. 92. All tests should pass. Signoff 93. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Failed QA --- Comment #138 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- These patches apply, but I get errors when trying to create a new report or view the list of saved reports. New report: Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt line 2917: unexpected end of input at /kohadevbox/koha/C4/Templates.pm line 146 Saved reports: Template process failed: file error - parse error - /kohadevbox/koha/koha-tmpl/intranet-tmpl/prog/en/modules/reports/guided_reports_start.tt line 2917: unexpected end of input at /kohadevbox/koha/C4/Templates.pm line 146 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #139 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- After some discussion and contemplation, I'm happy to walk back most of my thoughts about how this should work differently. A lot of this will change with the upcoming permissions rewrite, but this is a great step in the right direction and will be helpful in the meantime. Two things that do need to change: - Where you've used the term "branch," you should instead use "library" (https://wiki.koha-community.org/wiki/Terminology) - When the LimitReportsByBranch system preference is enabled, reports created by users without manage_report_limits permission should default to being limited to the library of the user -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- QA Contact|testopia@bugs.koha-communit |andrew@bywatersolutions.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=16631 --- Comment #140 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- (In reply to Andrew Fuerste-Henry from comment #139)
After some discussion and contemplation, I'm happy to walk back most of my thoughts about how this should work differently. A lot of this will change with the upcoming permissions rewrite, but this is a great step in the right direction and will be helpful in the meantime.
Two things that do need to change: - Where you've used the term "branch," you should instead use "library" (https://wiki.koha-community.org/wiki/Terminology)
- When the LimitReportsByBranch system preference is enabled, reports created by users without manage_report_limits permission should default to being limited to the library of the user
Thanks for this, Andrew. The first item is straightforward, and we'll implement it. Regarding the second item, I wanted to try to clarify the expected behavior. - When the system preference is initially enabled, should the availability of existing reports change for users? The current behavior is a large pool of shared reports all users can see, but in the proposed behavior it sounds like by default reports would be "private" to a user's home library. - When a user with permissions enables the system preference, would most of the reports disappear for most users? - Or would the existing pool of reports still be there, available to everyone until a user with the manage_report_limits permission changes it? -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #141 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- (In reply to Andrew Fuerste-Henry from comment #139)
After some discussion and contemplation, I'm happy to walk back most of my thoughts about how this should work differently. A lot of this will change with the upcoming permissions rewrite, but this is a great step in the right direction and will be helpful in the meantime.
Two things that do need to change: - Where you've used the term "branch," you should instead use "library" (https://wiki.koha-community.org/wiki/Terminology)
- When the LimitReportsByBranch system preference is enabled, reports created by users without manage_report_limits permission should default to being limited to the library of the user
One more thing, this time on renaming "branch" to "library". Would that change be mostly for user-facing UI? Like: 1. “My branch reports” to “My library reports” 2. “Show my branch reports” to “Show my library reports” 3. Any other visible “branch” wording introduced by this patch Or would we want to rename things that happen "behind the scenes" in the code, too? Like: 1. LimitReportsByBranch 2. reports_branches 3. branchcode 4. mybranch 5. function parameters/relationship keys that already use branch `branch` seems to be used a lot in the koha repo for things like `branchcode`, `mybranch`, `branchname`, etc. Keeping my variable and functions as `branch` seems like it would be more consistent with the rest of the repo, but if we're trying to shift away from this, I can work `library` in place of `branch`. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #142 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Casey Conlin - mattermost @Casey246 from comment #141)
One more thing, this time on renaming "branch" to "library".
Would that change be mostly for user-facing UI? Like: 1. “My branch reports” to “My library reports” 2. “Show my branch reports” to “Show my library reports” 3. Any other visible “branch” wording introduced by this patch
Or would we want to rename things that happen "behind the scenes" in the code, too? Like: 1. LimitReportsByBranch 2. reports_branches 3. branchcode 4. mybranch 5. function parameters/relationship keys that already use branch
`branch` seems to be used a lot in the koha repo for things like `branchcode`, `mybranch`, `branchname`, etc. Keeping my variable and functions as `branch` seems like it would be more consistent with the rest of the repo, but if we're trying to shift away from this, I can work `library` in place of `branch`.
You're absolutely right that there's a lot of usage of "branch" in the code and database. You don't need to worry about changing any of that and can absolutely use "branch" as a variable and table/field name. You're correct in the 3 UI things you listed in the first group. In the second group, I'd maybe change the system preference name but the other 4 things are fine as they are. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #143 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- (In reply to Casey Conlin - mattermost @Casey246 from comment #140)
(In reply to Andrew Fuerste-Henry from comment #139) Regarding the second item, I wanted to try to clarify the expected behavior. - When the system preference is initially enabled, should the availability of existing reports change for users? The current behavior is a large pool of shared reports all users can see, but in the proposed behavior it sounds like by default reports would be "private" to a user's home library. - When a user with permissions enables the system preference, would most of the reports disappear for most users? - Or would the existing pool of reports still be there, available to everyone until a user with the manage_report_limits permission changes it?
Casey and I messaged about this on Mattermost, but I should put my answer here for transparency: The availability of existing reports should not change. Reports without any library limitations should still be accessible to all users, regardless of library or permission, until a user with the manage_reports_limits permission changes them. Users without the permission would only be able to create reports limited to their own library. The manage_reports_limits permission would be required in order to make a report visible to libraries other than one's own or visible to all users. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196120|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=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #196121|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=16631 --- Comment #144 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 197133 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197133&action=edit Bug 16631: [DO NOT PUSH] Add schema files for reports_branches and adjust saved_sql table This patch adds the reports_branches table to enforce library limits for reports, and adjusts the saved_sql table to point to reports_branches. Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Sponsored-by: Ramapo Catskill Library System Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #145 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 197134 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197134&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|Failed QA |RESOLVED --- Comment #146 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- The patch was updated to address Andrew's comments below. - Where you've used the term "branch," you should instead use "library" (https://wiki.koha-community.org/wiki/Terminology) - When the LimitReportsByBranch system preference is enabled, reports created by users without manage_report_limits permission should default to being limited to the library of the user The terms have been updated for public facing UI, and for the preference. We continue to use "branch" in the code consistent with the rest of the codebase. Logic has been added so that reports created by non-permissioned users are limited to that user's home library. Limits are not changed when non-permissioned users edit a report to avoid overwriting limits intentionally set by permissioned users. Unit tests were added and the test plan was updated to include the updated functionality. Thank you for the feedback, and please let me know if there are any questions. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|FIXED |--- Status|RESOLVED |REOPENED --- Comment #147 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Looking at the Bugzilla documentation, it sounds like Koha folks use the "resolved" status in a non-standard way that we should document clearly somewhere. We put bugs at resolved after they've been pushed to release. I'm re-opening this one in order to QA it. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|REOPENED |ASSIGNED -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|ASSIGNED |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Signed Off |Passed QA Comma delimited| |Ramapo Catskill Library list of Sponsors| |System -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197134|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=16631 --- Comment #148 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197229 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197229&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #149 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197230 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197230&action=edit Bug 16631: [DO NOT PUSH] dbic changes Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #150 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197231 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197231&action=edit Bug 16631: [QA follow-up] Missing new line at end of file Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197133|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=16631 --- Comment #151 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- There's a test failure in t/db_dependent/Reports/Guided.t that exists on main without these patches. Passing QA. # Failed test 'no warnings' # at /usr/share/perl/5.36/Test/Builder.pm line 193. # There were 1 warning(s) # Previous test 9 'Without id delete_report returns undef' # Use of uninitialized value in concatenation (.) or string at /kohadevbox/koha/C4/Reports/Guided.pm line 798. # at /kohadevbox/koha/C4/Reports/Guided.pm line 798. # C4::Reports::Guided::delete_report(55) called at /kohadevbox/koha/t/db_dependent/Reports/Guided.t line 263 # main::__ANON__() called at /usr/share/perl/5.36/Test/Builder.pm line 374 # eval {...} called at /usr/share/perl/5.36/Test/Builder.pm line 374 # Test::Builder::subtest(Test::Builder=HASH(0xaaaad69f9dc8), "get_saved_reports", CODE(0xaaaae1c89c10)) called at /usr/share/perl/5.36/Test/More.pm line 809 # Test::More::subtest("get_saved_reports", CODE(0xaaaae1c89c10)) called at /kohadevbox/koha/t/db_dependent/Reports/Guided.t line 325 # # Looks like you failed 1 test of 15. /kohadevbox/koha/t/db_dependent/Reports/Guided.t .. Dubious, test returned 1 (wstat 256, 0x100) Failed 1/15 subtests (less 1 skipped subtest: 13 okay) Test Summary Report ------------------- /kohadevbox/koha/t/db_dependent/Reports/Guided.t (Wstat: 256 (exited 1) Tests: 15 Failed: 1) Failed test: 15 Non-zero exit status: 1 Files=1, Tests=15, 3 wallclock secs ( 0.02 usr 0.00 sys + 0.93 cusr 0.18 csys = 1.13 CPU) Result: FAIL -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #152 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Filed bug 42359 for this test failure, which only occurs when ReportsLog is enabled. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197229|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=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197230|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=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197231|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=16631 --- Comment #153 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197339 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197339&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #154 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197340 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197340&action=edit Bug 16631: [QA follow-up] Missing new line at end of file Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #155 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 197341 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197341&action=edit Bug 16631: [DO NOT PUSH] updated dbic Patch from commit 8219ccb -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Lucas Gass (lukeg) <lucas@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197339|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=16631 --- Comment #156 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 197535 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197535&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Nick Clemens (kidclamp) <nick@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nick@bywatersolutions.com Status|Passed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197340|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=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197341|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=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197535|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=16631 --- Comment #157 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 197724 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197724&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #158 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 197725 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=197725&action=edit Bug 16631: [DO NOT PUSH] updated dbic Patch from commit c7bb4fa -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |42621 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=42621 [Bug 42621] Extend report limitations by library to use library groups -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197724|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=16631 --- Comment #159 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 199520 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=199520&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Cab Vinton <bibliwho@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC|bibliwho@gmail.com | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 koha-US bug tracker <bugzilla@koha-us.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |bugzilla@koha-us.org -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |pedro.amorim@openfifth.co.u | |k Status|Passed QA |Patch doesn't apply -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #197725|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=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #199520|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=16631 --- Comment #160 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201218 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201218&action=edit Bug 16631: [DO NOT PUSH] updated dbic Patch from commit 66be007 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201218|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=16631 --- Comment #161 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201221 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201221&action=edit Bug 16631: [DO NOT PUSH] updated dbic Patch from commit 66be007 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #162 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201222 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201222&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201221|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=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201222|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=16631 --- Comment #163 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201223 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201223&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #164 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201224 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201224&action=edit Bug 16631: [DO NOT PUSH] updated dbic Patch from commit 2965781 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Patch doesn't apply |Passed QA --- Comment #165 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Update to resolve conflicts. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Passed QA |Failed QA --- Comment #166 from Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> --- Blockers: 1) This patch is removing the 'templates' template param in guided_reports.pl that was passed to reports-toolbar.inc. It is (unintentionally?) removing the 'Run with template' functionality, and this becomes dead code in reports-toolbar.inc: [% IF templates.count %] 2) Reports.t contains syntax errors: syntax error at /kohadevbox/koha/t/db_dependent/Koha/Reports.t line 290, near "subtest " Execution of /kohadevbox/koha/t/db_dependent/Koha/Reports.t aborted due to compilation errors. 3) The following path in guided_reports.pl is meant to expect the 'template_code' param (introduced in bug 38621): if ( $format eq 'template' ) But this patch is reverting that back to expect the 'template' param. reports-toolbar.inc sends format=template&template_code=<code> so the 'template' param there will be empty. This is almost certainly breaking the functionality introduced by 38621. Please double-check. Non-blockers: 1) Double-check that the author is as intended: "Cameron E. Tidd" <ctidd@citlink.net> 2) The functional changes are all in a single large commit. Splitting by concern (model changes, CGI changes, template changes, tests) would make review easier and history more useful. 3) The test plan is overly long. Sometimes less is more and that applies here, in my opinion. -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Pedro Amorim (ammopt) <pedro.amorim@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |olivia.reynolds@openfifth.c | |o.uk -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201223|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=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #201224|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=16631 --- Comment #167 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201314 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201314&action=edit Bug 16631: Institute library limits This patch implements the library_limit concept for Report/Reports. Staff with the correct permission and superlibrarians can set libaries to which the report should be visible, if the system preference is enabled. Test plan: Confirm Initial Settings 1. Log in to Koha staff with username: koha and password: koha and set your library as Centerville if it's not already. 2. Visit the Saved reports page, and create and save three reports: Report 1, Report 2, and Report 3. The SQL query for each report doesn't matter, it should just be something valid. 3. Visit the Patrons page and create two staff users: StaffReportLimitUser and StaffNoLimitPermission. Set their home libraries to Centerville and Fairfield, respectively. 4. Under Allow access to the reports module, ensure both users have report management permissions for Create, Delete, Execute. Verify Patch Settings 5. Apply the patch and restart services. If using Koha Testing Docker (KTD): from the Koha repo directory, apply the patch (e.g. `git bz apply 16631`, or check out the patched branch with `git fetch && git checkout <branch>`), then run `ktd --shell` to enter the KTD shell and run `restart_all`. If the patched branch is already checked out, just enter the KTD shell and run `restart_all`. 6. Click Patrons in the top navbar to go to the Patrons page. 7. Search for "StaffReportLimitUser" in the patron search field. 8. Click StaffReportLimitUser to edit the patron record for this user. 9. Click More -> Set permissions to access the permissions screens for the StaffReportLimitUser. 10. In the row for Allow access to the reports module (reports), click Show details to view relevant permissions. 11. Confirm Manage Report Limits (manage_report_limits) is an option under Allow access to the reports module (reports). 12. Click the checkbox for Manage Report Limits to give this user this permission, and click Save. 13. Go to the System Preferences page (Click the More dropdown from the top nav bar, click Administration, click System Preferences). 14. Verify Reports is an option in the left side navigation bar, and that when clicked, you see the LimitReportsByBranch option. 15. Enable LimitReportsByBranch as described in step 14. 16. Go back to Saved reports as in Step 2. 17. Click Edit in the row menu for Report 1. 18. At the bottom of the Report 1 edit page, you should see a Library limitation select box. Verify the Library Limitation Settings are Persisted 19. Choose Centerville from the select box and click Update SQL. 20. Reload the page, or navigate away from the page and go back to the edit screen for Report 1. 21. Verify that Centerville is still in the Library limitation select box. 22. Add Fairfield in the Library limitation select box and click Update and run SQL. 23. Go back to editing Report 1. 24. Confirm the Library limitation select box has both Centerville and Fairfield selected. 25. Duplicate Report 1. 26. Confirm the Library limitation select box has both Centerville and Fairfield selected. 27. Click Save Report. 28. Confirm the Library limitation select box has both Centerville and Fairfield selected. Verify Reports are Limited Based on Library Limitations 29. Edit Report 1 to add Centerville in the Library limitation select box as the only choice and click Update SQL. 30. Edit Report 2 to add Fairfield in the Library limitation select box as the only choice and click Update SQL. 31. Report 3 should have no library limitations, so it should be visible to all libraries. 32. Go to Saved reports as in Step 2. 33. Confirm you do not see Report 2, and only Report 1 and Report 3. 34. In the upper right corner, click the drop down that says koha Centerville and click Set library to change your library. 35. Set your library to Fairfield. 36. Go to Saved reports as in Step 2. 37. Confirm you do not see Report 1, and only Report 2 and Report 3. Verify Disabling LimitReportsByBranch Preference Shows All Reports 38. Disable LimitReportsByBranch preference as in steps 13 to 15. 39. Go to Saved reports as in Step 2. 40. Confirm Report 1, Report 2, Report 3 are visible. 41. Click to edit Report 1 and verify there is no Library limitation select box. Verify Library limitations are Persisted When EnableFilteringReports is Toggled On or Off 42. Enable LimitReportsByBranch preference as in steps 13 to 15. 43. Ensure your library is set to Fairfield as in step 35. 44. Go to Saved reports as in Step 2. 45. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible. 46. Click to edit Report 2 and verify the Library limitation select box is at the bottom of the page and that it has Fairfield selected. Verify the Show all reports option shows all reports for users with the Manage Report Limits permission and superlibrarians 47. Go to Saved reports as in Step 2 and in the Show reports dropdown, select Show all reports, and click Apply filter. 48. Confirm the page reloads with all reports visible: Report 1, Report 2, and Report 3 should be visible. 49. Select Show my branch reports from the dropdown and click Apply filter. 50. Confirm Report 1 is not visible, and Report 2 and Report 3 are visible (you should only see reports for your branch, Fairfield). Verify Report filters return the correct results 51. Go to Saved reports as in Step 2. 52. Verify you're viewing only your branch's reports in the filter. 53. Under Filter in the left sidebar, type "2" in the Keyword field and click Apply filter. 54. Confirm only Report 2 is visible. 55. Under Filter in the left sidebar, type "1" in the Keyword field and click Apply filter. 56. Confirm there are no reports visible, and the message "No saved reports match your criteria" is displayed. Verify Library Limits column is available to superlibrarians and users with the Manage Report Limits permission 57. Go to Saved reports as in Step 2. 58. Click the Columns dropdown and ensure that the Library limits column is available to select for display. Select it. 59. Confirm that the Library limits column is now visible in the list of reports and that it shows the correct library limitations for each report (e.g., Report 1 should show 1 library limitation and Centerville (CPL) on hover, Report 2 should show 1 library limitation and Fairfield (FFL) on hover, and Report 3 should show no limitation). Verify the Show all reports and Limit reports options are available to users that are not superlibrarian but have the Manage Report Limits permission 60. For the StaffReportLimitUser, add the permission for Manage Report Limits as described in steps 9 to 12. This will allow this user to see the Show all reports and Limit reports options. 61. Log out of the koha admin account. In the upper right corner, click the drop down that says koha Fairfield and click Log out. 62. Log in as StaffReportLimitUser, the previously created staff user with report permissions. 63. Confirm the staff user's library is Centerville in the upper right corner of the screen. 64. Go to Saved reports as in Step 2. 65. Confirm the filter option for Show reports is visible. 66. Click to edit Report 1. 67. Verify there is a Library limitation select box and that it can be interacted with. Verify the Show all reports and Limit reports options are not available to users that are not superlibrarian and do not have the Manage Report Limits permission 68. Log out of the StaffReportLimitUser account. 69. Log in as StaffNoLimitPermission, the previously created staff user without the Manage Report Limits permission. 70. Confirm the staff user's library is Fairfield in the upper right corner of the screen. 71. Go to Saved reports as in Step 2. 72. Click the Columns dropdown and ensure that the Library limits column is not in the list of available columns to select for display. 73. Confirm the filter option for Show reports is not available. 74. Click to edit Report 2. 75. Verify there is no Library limitation select box at the bottom of the page. [NEW] Verify library limits are auto-assigned and preserved correctly for non-permissioned users 76. Still logged in as StaffNoLimitPermission (Fairfield) from the previous section. Go to Saved reports and click New report. Enter "Limit Auto-Assign Test" as the report name and SELECT 1 as the SQL. Confirm there is no Library limitations select box visible on the form. Click Save. 77. Go back to Saved reports. Click Edit for Report 2 (limited to Fairfield). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that already has limits. 78. Go back to Saved reports. Click Edit for Report 3 (no library limits). Add `-- test` as a trailing SQL comment and click Update SQL. This simulates a non-permissioned user saving an existing report that has no limits. 79. Log out and log back in as StaffReportLimitUser (Centerville, has manage_report_limits). 80. Go to Saved reports. Use Show all reports if needed. Find "Limit Auto-Assign Test" and click Edit. Confirm the Library limitations select box shows Fairfield as the only selected library — the report was automatically limited to the creator's home library on create. 81. Find Report 2 and click Edit. Confirm the Library limitations select box still shows only Fairfield — the existing limit was preserved when the non-permissioned user saved the report. 82. Find Report 3 and click Edit. Confirm the Library limitations select box is empty — no limits were introduced when the non-permissioned user saved a report that had no existing limits. Verify limited reports are not visible to users without permissions 83. While still logged in as StaffReportLimitUser from step 79, copy the URL for the edit page of Report 1. 84. Log out of the StaffReportLimitUser account. 85. Log in as StaffNoLimitPermission, the user without the Manage Report Limits permission. 86. Paste the copied URL for the edit page of Report 1 into the browser and navigate to it. 87. Confirm that you see an error message that says "This report is restricted and cannot be accessed by the current user." and that the page does not load the report details. Run Unit Tests 88. Using Koha Testing Docker, in the Koha home directory run the command: ktd --shell to start the ktd shell. 89. Run command: reset_all to drop and recreate the koha database. 90. Run command prove t/db_dependent/Koha/Reports.t to run the test. 91. This file contains the unit tests for the reports_branches table and the new subtest `library limits enforcement on save and update`, which covers auto-assignment of branch limits on create and preservation of limits on update for non-permissioned users. 92. All tests should pass. 93. Run command prove t/Koha/Auth/Permissions.t 94. Permissions unit tests in this file were updated. 95. All tests should pass. 96. Run command prove t/db_dependent/Reports/Guided.t 97. The Guided report tests were updated to account for the new library limitations and permissions. 98. All tests should pass. Signoff 99. Sign off if the steps above check out. Sponsored-by: Ramapo Catskill Library System Co-authored-by: Casey Conlin <casey.conlin@gmail.com> Signed-off-by: Emmi Takkinen <emmi.takkinen@koha-suomi.fi> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #168 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201315 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201315&action=edit Bug 16631: [DO NOT PUSH] updated dbic Patch from commit c8d8562 -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 --- Comment #169 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- Created attachment 201316 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=201316&action=edit Bring back template. Fix test syntax. Patch from commit 741765a -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=16631 Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Failed QA |Passed QA --- Comment #170 from Casey Conlin - mattermost @Casey246 <casey.conlin@gmail.com> --- (In reply to Pedro Amorim (ammopt) from comment #166)
Blockers: 1) This patch is removing the 'templates' template param in guided_reports.pl that was passed to reports-toolbar.inc. It is (unintentionally?) removing the 'Run with template' functionality, and this becomes dead code in reports-toolbar.inc: [% IF templates.count %]
2) Reports.t contains syntax errors: syntax error at /kohadevbox/koha/t/db_dependent/Koha/Reports.t line 290, near "subtest " Execution of /kohadevbox/koha/t/db_dependent/Koha/Reports.t aborted due to compilation errors.
3) The following path in guided_reports.pl is meant to expect the 'template_code' param (introduced in bug 38621): if ( $format eq 'template' )
But this patch is reverting that back to expect the 'template' param. reports-toolbar.inc sends format=template&template_code=<code> so the 'template' param there will be empty.
This is almost certainly breaking the functionality introduced by 38621. Please double-check.
Non-blockers: 1) Double-check that the author is as intended: "Cameron E. Tidd" <ctidd@citlink.net> 2) The functional changes are all in a single large commit. Splitting by concern (model changes, CGI changes, template changes, tests) would make review easier and history more useful. 3) The test plan is overly long. Sometimes less is more and that applies here, in my opinion.
Hi Pedro, The templates should be back and the tests are passing. The author is my partner. In the future, I can break the test plan up more. Your guidance here to split it up by concern is appreciated, and if there are any other larger features you could point to as good examples, I'd definitely appreciate it. -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org