Bug 28642

Summary: Add IndependentBranches syspref to hide other items and libraries
Product: Koha Reporter: Michael Hafen <michael.hafen>
Component: Staff interfaceAssignee: Bugs List <koha-bugs>
Status: Patch doesn't apply --- QA Contact: Testopia <testopia>
Severity: enhancement    
Priority: P5 - low CC: caroline.cyr-la-rose, gmcharlt, lucas, mengu, mspinney, patrick.robitaille
Version: unspecified   
Hardware: All   
OS: All   
See Also: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=12793
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:
Attachments: Proposed patch
Fresh patch with test plan
Bug 28642: Expand IndependentBranches to hide others items and libraries
Bug 28642: [master 2022-06-02] Expand IndependentBranches to hide others items and libraries

Description Michael Hafen 2021-06-30 15:03:15 UTC
Independent Branches should not see items from other libraries in the staff client.
Also don't show other libraries in the many library selects.
Comment 1 Michael Hafen 2021-06-30 15:07:12 UTC
Created attachment 122509 [details] [review]
Proposed patch

Proposed patch
Comment 2 Caroline Cyr La Rose 2021-09-07 21:00:16 UTC
I think this needs to be rebased, I wasn't able to apply the patch cleanly.

Also, Michael, could you provide a test plan for your patch? I was going to try to test it, but without a test plan, it's a bit hard to know what to look at specifically, especially the "Also don't show other libraries in the many library selects" part. Which many library selects?

Thank you!

Caroline
Comment 3 Michael Hafen 2021-09-10 22:05:34 UTC
Created attachment 124786 [details] [review]
Fresh patch with test plan

Test Plan:

Apply patch and run koha-upgrade-schema or manually create IndependentBranchesHideOtherBranchesItems system preference.
Login with an account that is not Super Librarian.
Set the IndependentBranchesHideOtherBranchesItems system preference to yes.
On the Item Search page observe that only your library shows in the home and current library fields.
On the Advanced Search page observe that only your library shows in the location -> individual libraries field.
Search the catalog for a title with an item at your library and also at another library.
Observe that you only see your library listed in the facets panel (Refine your search -> Home Libraries section)
Observe that you only see the item at your library in the search results, title details, MARC details, Items, Checkout history, and Edit Items pages.
On the title details page Save the title as a text format, for example MARCXML, and observe that only item(s) at your library are in the export.
On the Place hold page, search for a patron and observe that only patrons at your library are found.
After selecting a patron observe that only items at your library are displaed.
In the Circulation -> Overdues page observe that you only see items at your library.
In the Check out quick search search for patrons.  Observe that only patrons at your school are found unless you search by cardnumber.
On the Patrons page observe that only your library shows in the library field of the search form.
In the Search Patrons tab of the quick search click the '+' to open the other fields.  Observe that only your library shows in the Library field.
On the Modify Patron page (edit patron) observe that only your library shows in the library field in the library management section.
In Serials start a new subscription and observe that only your library shows in the library field.
In Serials -> Check expiration observe that only your library show in the library field.
In Reports observe that only your library shows in the following reports: Acquisitions statistics, Patrons statistics, Catalog statistics, Circulation statistics, Serials statistics, Cash register statistics, Holds statistics, Patrons with the most checkouts, Most-circulated items, Items with no checkouts, Items lost, Catalog by item type, Average loan time.
In Suggestions observe that only your library shows in the library field on the Suggestion management and New purchase suggestion pages.
In Tools -> Patron Lists when adding patrons to a list observe that only patrons at your library are found by name.
In Patron Clubs observe that the library field only shows your library in the Club Template and Club edit pages.
In Comments observe that only comments at your library are shown.
In Import Patrons observe that the library field in the defaults section only shows your library.
In Batch patron modification observe that your library is the only library in the library field.
In Batch item modification observe that your library is the only library in the Home and Current library fields.
In Export data observe that only your library shows in the 'With items owned by the following libraries' field and it is selected.
In Inventory observe that only your library shows in the library field.
In News observe that only your library shows in the library field in the Filter on the home page and the Edit entry page.
Open the Opac and log in.
On the Advanced search page observe that your library is the only library in the Location field.
Search for a title with items at multiple libraries.  Observe that only your library shows in the libraries facets (refine your search).
Comment 4 Lucas Gass (lukeg) 2022-04-27 15:23:23 UTC
This patchset no longer applies cleanly to current master
Comment 5 Michael Hafen 2022-04-27 17:32:20 UTC
Created attachment 134174 [details] [review]
Bug 28642: Expand IndependentBranches to hide others items  and libraries

Rebased on 2022-04-27

Adds a system preference: IndependentBranchesHideOtherBranchesItems.
When on:
  All library select's will be limited to just the users library.
  Item lists in search results, title details, item details, holds, and exports
    will only show items at the users library.

Test Plan:

Apply patch and run koha-upgrade-schema or manually create IndependentBranchesHideOtherBranchesItems system preference.
Login with an account that is not Super Librarian.
Set the IndependentBranchesHideOtherBranchesItems system preference to yes.
On the Item Search page observe that only your library shows in the home and current library fields.
On the Advanced Search page observe that only your library shows in the location -> individual libraries field.
Search the catalog for a title with an item at your library and also at another library.
Observe that you only see your library listed in the facets panel (Refine your search -> Home Libraries section)
Observe that you only see the item at your library in the search results, title details, MARC details, Items, Checkout history, and Edit Items pages.
On the title details page Save the title as a text format, for example MARCXML, and observe that only item(s) at your library are in the export.
On the Place hold page, search for a patron and observe that only patrons at your library are found.
After selecting a patron observe that only items at your library are displaed.
In the Circulation -> Overdues page observe that you only see items at your library.
In the Check out quick search search for patrons.  Observe that only patrons at your school are found unless you search by cardnumber.
On the Patrons page observe that only your library shows in the library field of the search form.
In the Search Patrons tab of the quick search click the '+' to open the other fields.  Observe that only your library shows in the Library field.
On the Modify Patron page (edit patron) observe that only your library shows in the library field in the library management section.
In Serials start a new subscription and observe that only your library shows in the library field.
In Serials -> Check expiration observe that only your library show in the library field.
In Reports observe that only your library shows in the following reports: Acquis
itions statistics, Patrons statistics, Catalog statistics, Circulation statistics, Serials statistics, Cash register statistics, Holds statistics, Patrons with the most checkouts, Most-circulated items, Items with no checkouts, Items lost, Catalog by item type, Average loan time.
In Suggestions observe that only your library shows in the library field on the Suggestion management and New purchase suggestion pages.
In Tools -> Patron Lists when adding patrons to a list observe that only patrons at your library are found by name.
In Patron Clubs observe that the library field only shows your library in the Club Template and Club edit pages.
In Comments observe that only comments at your library are shown.
In Import Patrons observe that the library field in the defaults section only shows your library.
In Batch patron modification observe that your library is the only library in the library field.
In Batch item modification observe that your library is the only library in the Home and Current library fields.
In Export data observe that only your library shows in the 'With items owned by the following libraries' field and it is selected.
In Inventory observe that only your library shows in the library field.
In News observe that only your library shows in the library field in the Filter on the home page and the Edit entry page.
Open the Opac and log in.
On the Advanced search page observe that your library is the only library in the Location field.
Search for a title with items at multiple libraries.  Observe that only your library shows in the libraries facets (refine your search).
Comment 6 Lucas Gass (lukeg) 2022-06-01 14:56:37 UTC
This doesn't apply cleanly to current master.
Comment 7 Michael Hafen 2022-06-02 19:12:16 UTC
Created attachment 135630 [details] [review]
Bug 28642: [master 2022-06-02] Expand IndependentBranches to hide others items  and libraries

[master 2022-06-02]
Adds a system preference: IndependentBranchesHideOtherBranchesItems.
When on:
  All library select's will be limited to just the users library.
  Item lists in search results, title details, item details, holds, and exports
    will only show items at the users library.

Test Plan:

Apply patch and run koha-upgrade-schema or manually create IndependentBranchesHideOtherBranchesItems system preference.
Login with an account that is not Super Librarian.
Set the IndependentBranchesHideOtherBranchesItems system preference to yes.
On the Item Search page observe that only your library shows in the home and current library fields.
On the Advanced Search page observe that only your library shows in the location -> individual libraries field.
Search the catalog for a title with an item at your library and also at another library.
Observe that you only see your library listed in the facets panel (Refine your search -> Home Libraries section)
Observe that you only see the item at your library in the search results, title details, MARC details, Items, Checkout history, and Edit Items pages.
On the title details page Save the title as a text format, for example MARCXML, and observe that only item(s) at your library are in the export.
On the Place hold page, search for a patron and observe that only patrons at your library are found.
After selecting a patron observe that only items at your library are displaed.
In the Circulation -> Overdues page observe that you only see items at your library.
In the Check out quick search search for patrons.  Observe that only patrons at your school are found unless you search by cardnumber.
On the Patrons page observe that only your library shows in the library field of the search form.
In the Search Patrons tab of the quick search click the '+' to open the other fields.  Observe that only your library shows in the Library field.
On the Modify Patron page (edit patron) observe that only your library shows in the library field in the library management section.
In Serials start a new subscription and observe that only your library shows in the library field.
In Serials -> Check expiration observe that only your library show in the library field.
In Reports observe that only your library shows in the following reports: Acquisitions statistics, Patrons statistics, Catalog statistics, Circulation statistics, Serials statistics, Cash register statistics, Holds statistics, Patrons with the most checkouts, Most-circulated items, Items with no checkouts, Items lost, Catalog by item type, Average loan time.
In Suggestions observe that only your library shows in the library field on the Suggestion management and New purchase suggestion pages.
In Tools -> Patron Lists when adding patrons to a list observe that only patrons at your library are found by name.
In Patron Clubs observe that the library field only shows your library in the Club Template and Club edit pages.
In Comments observe that only comments at your library are shown.
In Import Patrons observe that the library field in the defaults section only shows your library.
In Batch patron modification observe that your library is the only library in the library field.
In Batch item modification observe that your library is the only library in the Home and Current library fields.
In Export data observe that only your library shows in the 'With items owned by the following libraries' field and it is selected.
In Inventory observe that only your library shows in the library field.
In News observe that only your library shows in the library field in the Filter on the home page and the Edit entry page.
Open the Opac and log in.
On the Advanced search page observe that your library is the only library in the Location field.
Search for a title with items at multiple libraries.  Observe that only your library shows in the libraries facets (refine your search).
Comment 8 Katrin Fischer 2024-04-13 12:20:26 UTC
I feel like this should be really moved into the newer library groups concept that already allows us to control which groups (and therefore libraries) can edit items.
Comment 9 Caroline Cyr La Rose 2024-04-15 14:32:01 UTC
With independent branches, you don't really have groups though?

Will we need to create a group per branch?
Comment 10 Michael Hafen 2024-04-15 14:45:51 UTC
Such a branch group type would probably use the same groups as the item editing type. In my case it would mean a group with that type per branch to mimic independent branches. Which I would already need if all of the independent branches feature was moved to branch groups, so that's not really a problem
Comment 11 Katrin Fischer 2024-04-15 19:36:20 UTC
(In reply to Caroline Cyr La Rose from comment #9)
> With independent branches, you don't really have groups though?
> 
> Will we need to create a group per branch?

That's true, but I think we are moving into maybe retiring IndependentBranches at some point. A lot of its functionality is now covered by the library groups in a better and more reliable way. Visibility of patrons and editing of items at least.

See: Bug 12599 - IndependentBranches Holes