Bug 10278 - Add ability to hide items and records from search results for Independent Branches
Summary: Add ability to hide items and records from search results for Independent Bra...
Status: CLOSED WONTFIX
Alias: None
Product: Koha
Classification: Unclassified
Component: Architecture, internals, and plumbing (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Kyle M Hall
QA Contact:
URL:
Keywords:
Depends on: 10276
Blocks: 10263
  Show dependency treegraph
 
Reported: 2013-05-17 15:07 UTC by Kyle M Hall
Modified: 2016-12-05 21:23 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (28.46 KB, patch)
2013-05-17 15:09 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (29.77 KB, patch)
2013-05-28 12:00 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (29.38 KB, patch)
2013-05-30 14:06 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (29.50 KB, patch)
2013-06-06 18:10 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (34.91 KB, patch)
2013-09-04 11:14 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (33.16 KB, patch)
2013-09-17 16:58 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (33.16 KB, patch)
2013-12-12 16:33 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (33.22 KB, patch)
2013-12-18 16:48 UTC, Melissa Lefebvre
Details | Diff | Splinter Review
Bug 10278 - Add ability to hide items and records from search results for Independent Branches (18.28 KB, patch)
2015-02-19 12:59 UTC, Kyle M Hall (khall)
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2013-05-17 15:07:53 UTC
IndependentBranches will hide other library's patrons, and limit editing of items, but it does not hide the items the way it hides library patrons. This new preference would do just that.
Comment 1 Kyle M Hall (khall) 2013-05-17 15:09:32 UTC Comment hidden (obsolete)
Comment 2 Kyle M Hall (khall) 2013-05-28 12:00:40 UTC Comment hidden (obsolete)
Comment 3 Kyle M Hall (khall) 2013-05-30 14:06:22 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall (khall) 2013-06-06 18:10:37 UTC Comment hidden (obsolete)
Comment 5 Kyle M Hall (khall) 2013-09-04 11:14:31 UTC Comment hidden (obsolete)
Comment 6 Kyle M Hall (khall) 2013-09-17 16:58:20 UTC Comment hidden (obsolete)
Comment 7 I'm just a bot 2013-09-18 11:18:58 UTC
Applying: Bug 10278 - Add ability to hide items and records from search results for Independent Branches
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 Bug 10278 - Add ability to hide items and records from search results for Independent Branches
The copy of the patch that failed is found in:
   /home/christopher/git/koha/.git/rebase-apply/patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
Comment 8 Kyle M Hall (khall) 2013-12-12 16:33:23 UTC Comment hidden (obsolete)
Comment 9 Joel Sasse 2013-12-18 16:39:15 UTC
I tested this and want to sign off on it.

Joel Sasse
Comment 10 Melissa Lefebvre 2013-12-18 16:48:37 UTC Comment hidden (obsolete)
Comment 11 Katrin Fischer 2013-12-29 16:28:47 UTC
Comment on attachment 23638 [details] [review]
Bug 10278 - Add ability to hide items and records from search results for Independent Branches

Review of attachment 23638 [details] [review]:
-----------------------------------------------------------------

Can't apply this patch, as the dependency doesn't apply, but starting with a code review:

1) We need some unit tests for the new routine GetCategoriesForBranch (UT). 
   Also regression tests, additional tests, any tests for some of the other routines would be nice.

Failed QA for the missing unit tests.

::: C4/Branch.pm
@@ +42,4 @@
>  		&GetCategoryTypes
>  		&GetBranchCategories
>  		&GetBranchesInCategory
> +        &GetCategoriesForBranch

UT

::: koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/admin.pref
@@ +75,5 @@
> +              default: 0
> +              choices:
> +                  yes: Prevent
> +                  no: "Don't prevent"
> +            - staff from seeing items owned by other libraries, and records without any items the library.

I think there is a word missing in the last bit. 

I wonder a bit about the consequences - it will be required to always add at least one 'fake' item to every record, that you want to show up in the OPAC. Thinking about serials and electronic resources, but also set and traced serial record as used in Germany.

::: koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbooks.tt
@@ +32,2 @@
>              strQuery += "&" + "[% z3950_search_param.name %]" + "=" + "[% z3950_search_param.encvalue %]";
> +*/

Why are you commenting this bit out?
Comment 12 Kyle M Hall (khall) 2015-02-19 12:59:12 UTC
Created attachment 36033 [details] [review]
Bug 10278 - Add ability to hide items and records from search results for Independent Branches

For the staff intranet, enabling IndependentBranchesRecordsAndItems
will automatically add a branch limit filter to the search results
thus hiding all records without one or more items owned by the logged
in library. In add addition, all items whose homebranch is not that
libraries will be filtered and hidden from the search results and
record details.

This system preference will not affect the OPAC, unless the environment
variable BRANCHCODE is defined in the koha-httpd.conf file. If it is
defined, the same filters are applied to the OPAC, but based on the
branchcode value of the environment variable BRANCHCODE, rather than the
logged in branch.

Test Plan:
1) Apply patch
2) Run updatedatabase.pl
3) Perform a search that will give results for both records which
   have items owned by the logged in library, and records which have
   no items owned by the logged in library.
4) Enable the new system preference IndependentBranchesRecordesAndItems
5) Perform the same search again, any records without items owned
   by the currently logged in library should not appear.

Signed-off-by:  Joel Sasse <jsasse@plumcreeklibrary.net>