Bug 26861 - Indicate that a record is using OpacHiddenItems in the staff interface
Summary: Indicate that a record is using OpacHiddenItems in the staff interface
Status: NEW
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Bugs List
QA Contact: Testopia
URL:
Keywords:
: 28827 (view as bug list)
Depends on:
Blocks:
 
Reported: 2020-10-29 14:20 UTC by Barbara Johnson
Modified: 2023-12-20 21:41 UTC (History)
11 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

Note You need to log in before you can comment on or make changes to this bug.
Description Barbara Johnson 2020-10-29 14:20:22 UTC
It would be helpful to indicate in the staff client that a record you are viewing is using the OpacHiddenItems system preference for the OPAC.  It could display 'Hidden in OPAC' similar to the way is displays 'Suppressed in OPAC' for suppressed bibs.
Comment 1 Andrew Fuerste-Henry 2020-10-29 14:34:36 UTC
+1 -- we indicate that a bib is suppressed. Why not also a note on hidden items? I'm asked fairly frequently why something or other hidden by OPACHidden isn't visible.
Comment 2 Katrin Fischer 2021-01-21 20:04:53 UTC
+1
Comment 3 Fridolin Somers 2021-01-27 14:21:10 UTC
+1
Comment 4 Rebecca Coert 2021-04-13 22:11:01 UTC
+1
Comment 5 Katrin Fischer 2021-08-07 13:55:49 UTC
*** Bug 28827 has been marked as a duplicate of this bug. ***
Comment 6 Christopher Brannon 2021-08-10 14:33:42 UTC
+1
Comment 7 Fridolin Somers 2023-12-12 01:12:35 UTC
A new column in items table ?
Comment 8 David Cook 2023-12-12 01:22:36 UTC
(In reply to Fridolin Somers from comment #7)
> A new column in items table ?

I think that points back to a conversation we've had elsewhere about how challenging OpacHiddenItems is, since it's based off a multi-factor calculation and not just a database flag. 

If you changed OpacHiddenItems, you'd have to iterate through every item row in the database to check if the column in the items table is hidden.

And even then there's other system preferences to check to see whether or not the actual bib record is hidden.

--

I think this would be a useful feature, but it would be very difficult to do without overhauling OpacHiddenItems, which is going to be a high effort activity I think.
Comment 9 David Cook 2023-12-12 01:23:46 UTC
(In reply to David Cook from comment #8)
> I think this would be a useful feature, but it would be very difficult to do
> without overhauling OpacHiddenItems, which is going to be a high effort
> activity I think.

I mean if we did it in terms of a database field.

I think for now we could just perform the calculation on the load of the detail page. That should be all right. (Although it would be slow for a bib record with a high number of items, so it would probably be best to do asynchronously...)
Comment 10 Fridolin Somers 2023-12-12 07:24:31 UTC
(In reply to Fridolin Somers from comment #7)
> A new column in items table ?

I meant a column in the HTML table of items, in details page.
Comment 11 Katrin Fischer 2023-12-12 09:33:45 UTC
(In reply to Fridolin Somers from comment #10)
> (In reply to Fridolin Somers from comment #7)
> > A new column in items table ?
> 
> I meant a column in the HTML table of items, in details page.

I like the idea. Do we expect a performance hit by it? 
Or could it be an indicator somehow, maybe in one of the existing columns, like a small icon with a tool tip?
Comment 12 David Cook 2023-12-12 23:05:18 UTC
(In reply to Katrin Fischer from comment #11)
> (In reply to Fridolin Somers from comment #10)
> > (In reply to Fridolin Somers from comment #7)
> > > A new column in items table ?
> > 
> > I meant a column in the HTML table of items, in details page.
> 
> I like the idea. Do we expect a performance hit by it? 
> Or could it be an indicator somehow, maybe in one of the existing columns,
> like a small icon with a tool tip?

Sorry, Frido. Now I feel embarrassed ﷐[U+1F605]﷑.

I think that we could expect a performance hit, but the work should be CPU bound rather than I/O bound, so hopefully it won't be too much. The more rules and the more holdings you have, the worse it will be. 

If we want to show if the bib is hidden by OpacHiddenItems, then I think it gets more complicated, because Koha::Biblio->hidden_in_opac performs the calculation once, and then when building the item array for display, we'd need to perform the calculation again. This would be suboptimal. 

Perhaps Koha::Biblio->hidden_in_opac should take an optional argument of "items", and Koha::Item->hidden_in_opac should store its calculation in itself. 

Alternatively, Koha::Biblio->hidden_in_opac could return a hashref of itemnumbers denoting hidden status, and then on detail.pl when processing items this hashref could be checked to determine hidden status. 

Or we could just worry about optimizing this later if it's an issue. For a small number of holdings and a small number of rules, it probably wouldn't be noticeable. It would probably just have an impact on a higher number of holdings.

But then that's where bug 33568 saves the day...