Bug 7508 - Collapsable items on items tab
Summary: Collapsable items on items tab
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Templates (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: Owen Leonard
QA Contact: Jonathan Druart
URL: /cgi-bin/koha/catalogue/moredetail.pl...
Keywords: additional_work_needed
Depends on:
Blocks: 39189
  Show dependency treegraph
 
Reported: 2012-02-07 16:58 UTC by Nicole C. Engard
Modified: 2025-02-24 12:35 UTC (History)
7 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement to the staff interface bibliographic record items detail tab: 1. Adds a sidebar sub-menu showing barcodes (or item numbers) so that staff can jump directly to an item. (The sub-menu uses a scrollbar if the record has around 15 or more items.) 2. Makes each item on the page collapsible, so item details are hidden when clicking the item header. Note: The heading for each item is "Barcode ...". For an item without a barcode, the heading is "Item number ...". Technical changes: - JavaScript code moved from the authority and MARC editors into the global JavaScript file. This is the code that helps you jump to a specific part of a page. - staff-global.scss modified to improve the readability of the sidebar sub-menu and removes CSS which was specific to the system preferences page. This makes the sub-menus on the item details and system preferences pages consistent with each other.
Version(s) released in:
25.05.00
Circulation function:


Attachments
Screenshot showing the proposed menu expansion (24.52 KB, image/png)
2019-04-15 16:08 UTC, Owen Leonard
Details
Bug 7508: Collapsable items on items tab (8.90 KB, patch)
2024-07-17 16:19 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7508: Collapsable items on items tab (8.96 KB, patch)
2024-08-21 18:42 UTC, Brendan Lawlor
Details | Diff | Splinter Review
Bug 7508: (follow-up) Show item number if item has no barcode (5.67 KB, patch)
2024-11-26 18:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7508: Collapsable items on items tab (9.00 KB, patch)
2024-12-03 00:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 7508: (follow-up) Show item number if item has no barcode (5.72 KB, patch)
2024-12-03 00:14 UTC, David Nind
Details | Diff | Splinter Review
Bug 7508: Collapsable items on items tab (9.08 KB, patch)
2025-01-16 11:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7508: (follow-up) Show item number if item has no barcode (5.80 KB, patch)
2025-01-16 11:21 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 7508: Collapsable items on items tab (8.99 KB, patch)
2025-02-12 13:37 UTC, Owen Leonard
Details | Diff | Splinter Review
Bug 7508: (follow-up) Show item number if item has no barcode (5.76 KB, patch)
2025-02-12 13:37 UTC, Owen Leonard
Details | Diff | Splinter Review
ERMSideBar (20.39 KB, image/jpeg)
2025-02-21 14:53 UTC, Pedro Amorim
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicole C. Engard 2012-02-07 16:58:52 UTC
It would be nice if on the items detail tab in the staff client you could click a little arrow to collapse the item details so you only see the one or ones you want without having to scroll too much.
Comment 1 Owen Leonard 2019-04-15 16:08:41 UTC
Created attachment 88025 [details]
Screenshot showing the proposed menu expansion

I don't know if this is still an issue for anyone, but this screenshot shows an idea I had about making it easier to navigate to specific items. I suspect barcode wouldn't necessarily be the best identifier for everyone, but not sure what would make more sense.
Comment 2 Katrin Fischer 2019-04-28 21:46:15 UTC
Hi Owen, I like the idea :)

Wondering about the best identifier too. The only other thing I could think of is using callnumber + copynumber. But that might not differ for all libraries.

Could some kind of accordeon view also make sense? The selected or linked to item would be uncollapsed, the others collapsed.
Comment 3 Owen Leonard 2024-07-17 16:19:28 UTC
Created attachment 169102 [details] [review]
Bug 7508: Collapsable items on items tab

Since we recently updated the patron entry form in the staff interface
to have more visibly-collapsible sections I thought there might be
interest in picking up this old bug.

The patch implements collapsible sections on the item detail page,
allowing the user to hide sections by clicking the item barcode header.
The patch includes relocation of some JS code from the authority and
MARC editors into the global JS file. This is the code that helps jump
the user to a certain scroll point on the page.

To test, apply the patch and clear your browser cache.

- In the staff interface, locate a bibliographic record with items and
  view the detail page.
- Click the "Items" tab in the sidebar.
- On the item detail page, each section should have an icon indicating
  that they are expanded. Hovering your mouse over the section heading
  should highlight the clickable area.
- Test that each section collapses correctly and that the next section
  is moved into view.

- Go to Cataloging -> New record. Test that the links to specific tags
  under the main tab bar still work to jump you to the correct part of
  the page.
- Go to Authorities -> New authority and perform the same test.

Sponsored-by: Athens County Public Libraries
Comment 4 Owen Leonard 2024-07-17 16:20:28 UTC
I don't know if this is a change that folks want, but I thought it would be fun to try it out. Please comment if you think it's a bad idea.
Comment 5 Martin Renvoize (ashimema) 2024-07-22 08:08:06 UTC
I quite like this.. but I also like the screenshot where you proposed a collapsible left side menu addition.
Comment 6 Myka Kennedy Stephens 2024-07-23 14:15:02 UTC
I haven't had a chance to test the patch yet, but this does sound like it would help library systems that have a lot of items on a record. Another similar suggestion I received from a librarian was to make clicking the barcode from the holdings table in the bib record show only the item with that barcode with a link to view all items -- the same behavior that Koha has when clicking on a barcode from the holds queue or the patron checkouts table. Would these collapsible sections in the items detail tab replace the need for that hidden items and view all link behavior? In other words, could clicking a barcode from all these places take you to the item details page (moredetail.pl) where all items are collapsed except for the one related to the barcode that was clicked on?
Comment 7 Brendan Lawlor 2024-08-21 18:42:11 UTC
Created attachment 170575 [details] [review]
Bug 7508: Collapsable items on items tab

Since we recently updated the patron entry form in the staff interface
to have more visibly-collapsible sections I thought there might be
interest in picking up this old bug.

The patch implements collapsible sections on the item detail page,
allowing the user to hide sections by clicking the item barcode header.
The patch includes relocation of some JS code from the authority and
MARC editors into the global JS file. This is the code that helps jump
the user to a certain scroll point on the page.

To test, apply the patch and clear your browser cache.

- In the staff interface, locate a bibliographic record with items and
  view the detail page.
- Click the "Items" tab in the sidebar.
- On the item detail page, each section should have an icon indicating
  that they are expanded. Hovering your mouse over the section heading
  should highlight the clickable area.
- Test that each section collapses correctly and that the next section
  is moved into view.

- Go to Cataloging -> New record. Test that the links to specific tags
  under the main tab bar still work to jump you to the correct part of
  the page.
- Go to Authorities -> New authority and perform the same test.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Comment 8 Brendan Lawlor 2024-08-21 18:45:33 UTC
This works well and would be really useful on records with many items attached.

By the way I also like the idea from the og screenshot of the collapsible list of barcodes under items in the left pane menu.
Comment 9 Lucas Gass (lukeg) 2024-11-22 18:52:52 UTC
This is wonderful and gives me pure joy.
Comment 10 Lucas Gass (lukeg) 2024-11-22 19:08:55 UTC
Koha does allow me to create items without barcodes, I don't know how common that is but I can do it. Without a barcode the heading just reads 'Barcode' that is a bit confusing. 

Can we use itemnumber, or fall back to itemnumber?
Comment 11 Owen Leonard 2024-11-26 18:37:56 UTC
Created attachment 174993 [details] [review]
Bug 7508: (follow-up) Show item number if item has no barcode

This follow-up adds item number as a fallback for display when an item
doesn't have a barcode.

The patch also implements a sidebar sub-menu showing barcodes (or item
numbers) so that the user can jump directly to a particular section. The
sub-menu will show a scrollbar if the record has more than around 15
items.

The patch modifies staff-global.scss to improve readability of the
sidebar sub-menu and removes CSS which was specific to the system
preferences page. This make the sub-menus on the item details and system
preferences pages consistent with each other.
Comment 12 David Nind 2024-11-27 06:42:54 UTC
Are all the "Barcode XXX" and "Item number XXX" supposed to all be open by default?

For me, if I go to a record with multiple items, click the items section, all the items are open by default (that is, not collapsed).
Comment 13 Owen Leonard 2024-12-02 13:16:06 UTC
(In reply to David Nind from comment #12)
> Are all the "Barcode XXX" and "Item number XXX" supposed to all be open by
> default?

Here's my reasoning, and I'm happy to be argued with:

We already have the functionality of showing only one item if a particular barcode link is clicked, e.g. from the bibliographic details holdings table. I think having all sections expanded if you're not arriving from a specific barcode link is consistent with how it works now.

We could change it so that all other items were loaded but collapsed, but I'm concerned that it would negate the goal of making the page quicker to load, especially on records with lots of items.
Comment 14 David Nind 2024-12-03 00:03:43 UTC
(In reply to Owen Leonard from comment #13)
> Here's my reasoning, and I'm happy to be argued with:
> 
> We already have the functionality of showing only one item if a particular
> barcode link is clicked, e.g. from the bibliographic details holdings table.
> I think having all sections expanded if you're not arriving from a specific
> barcode link is consistent with how it works now.
> 
> We could change it so that all other items were loaded but collapsed, but
> I'm concerned that it would negate the goal of making the page quicker to
> load, especially on records with lots of items.

Thanks for the rationale Owen!

I don't think I'll argue with you 8-)

David
Comment 15 David Nind 2024-12-03 00:14:19 UTC
Created attachment 175064 [details] [review]
Bug 7508: Collapsable items on items tab

Since we recently updated the patron entry form in the staff interface
to have more visibly-collapsible sections I thought there might be
interest in picking up this old bug.

The patch implements collapsible sections on the item detail page,
allowing the user to hide sections by clicking the item barcode header.
The patch includes relocation of some JS code from the authority and
MARC editors into the global JS file. This is the code that helps jump
the user to a certain scroll point on the page.

To test, apply the patch and clear your browser cache.

- In the staff interface, locate a bibliographic record with items and
  view the detail page.
- Click the "Items" tab in the sidebar.
- On the item detail page, each section should have an icon indicating
  that they are expanded. Hovering your mouse over the section heading
  should highlight the clickable area.
- Test that each section collapses correctly and that the next section
  is moved into view.

- Go to Cataloging -> New record. Test that the links to specific tags
  under the main tab bar still work to jump you to the correct part of
  the page.
- Go to Authorities -> New authority and perform the same test.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: David Nind <david@davidnind.com>
Comment 16 David Nind 2024-12-03 00:14:22 UTC
Created attachment 175065 [details] [review]
Bug 7508: (follow-up) Show item number if item has no barcode

This follow-up adds item number as a fallback for display when an item
doesn't have a barcode.

The patch also implements a sidebar sub-menu showing barcodes (or item
numbers) so that the user can jump directly to a particular section. The
sub-menu will show a scrollbar if the record has more than around 15
items.

The patch modifies staff-global.scss to improve readability of the
sidebar sub-menu and removes CSS which was specific to the system
preferences page. This make the sub-menus on the item details and system
preferences pages consistent with each other.

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 Jonathan Druart 2025-01-16 11:21:09 UTC
Created attachment 176632 [details] [review]
Bug 7508: Collapsable items on items tab

Since we recently updated the patron entry form in the staff interface
to have more visibly-collapsible sections I thought there might be
interest in picking up this old bug.

The patch implements collapsible sections on the item detail page,
allowing the user to hide sections by clicking the item barcode header.
The patch includes relocation of some JS code from the authority and
MARC editors into the global JS file. This is the code that helps jump
the user to a certain scroll point on the page.

To test, apply the patch and clear your browser cache.

- In the staff interface, locate a bibliographic record with items and
  view the detail page.
- Click the "Items" tab in the sidebar.
- On the item detail page, each section should have an icon indicating
  that they are expanded. Hovering your mouse over the section heading
  should highlight the clickable area.
- Test that each section collapses correctly and that the next section
  is moved into view.

- Go to Cataloging -> New record. Test that the links to specific tags
  under the main tab bar still work to jump you to the correct part of
  the page.
- Go to Authorities -> New authority and perform the same test.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 18 Jonathan Druart 2025-01-16 11:21:12 UTC
Created attachment 176633 [details] [review]
Bug 7508: (follow-up) Show item number if item has no barcode

This follow-up adds item number as a fallback for display when an item
doesn't have a barcode.

The patch also implements a sidebar sub-menu showing barcodes (or item
numbers) so that the user can jump directly to a particular section. The
sub-menu will show a scrollbar if the record has more than around 15
items.

The patch modifies staff-global.scss to improve readability of the
sidebar sub-menu and removes CSS which was specific to the system
preferences page. This make the sub-menus on the item details and system
preferences pages consistent with each other.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 19 Owen Leonard 2025-02-12 13:37:56 UTC
Created attachment 177873 [details] [review]
Bug 7508: Collapsable items on items tab

Since we recently updated the patron entry form in the staff interface
to have more visibly-collapsible sections I thought there might be
interest in picking up this old bug.

The patch implements collapsible sections on the item detail page,
allowing the user to hide sections by clicking the item barcode header.
The patch includes relocation of some JS code from the authority and
MARC editors into the global JS file. This is the code that helps jump
the user to a certain scroll point on the page.

To test, apply the patch and clear your browser cache.

- In the staff interface, locate a bibliographic record with items and
  view the detail page.
- Click the "Items" tab in the sidebar.
- On the item detail page, each section should have an icon indicating
  that they are expanded. Hovering your mouse over the section heading
  should highlight the clickable area.
- Test that each section collapses correctly and that the next section
  is moved into view.

- Go to Cataloging -> New record. Test that the links to specific tags
  under the main tab bar still work to jump you to the correct part of
  the page.
- Go to Authorities -> New authority and perform the same test.

Sponsored-by: Athens County Public Libraries
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 20 Owen Leonard 2025-02-12 13:37:59 UTC
Created attachment 177874 [details] [review]
Bug 7508: (follow-up) Show item number if item has no barcode

This follow-up adds item number as a fallback for display when an item
doesn't have a barcode.

The patch also implements a sidebar sub-menu showing barcodes (or item
numbers) so that the user can jump directly to a particular section. The
sub-menu will show a scrollbar if the record has more than around 15
items.

The patch modifies staff-global.scss to improve readability of the
sidebar sub-menu and removes CSS which was specific to the system
preferences page. This make the sub-menus on the item details and system
preferences pages consistent with each other.

Signed-off-by: David Nind <david@davidnind.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Comment 21 Katrin Fischer 2025-02-18 09:15:48 UTC
Hi Owen,

can you please check these fails?

 FAIL	koha-tmpl/intranet-tmpl/prog/en/includes/biblio-view-menu.inc
   FAIL	  tt_valid
		lines 7, 12, 18, 24, 29, 47, 53, 59, 65, 78, 83, 89, 95

Thanks!
Comment 22 Owen Leonard 2025-02-19 12:39:50 UTC
(In reply to Katrin Fischer from comment #21)
>    FAIL	  tt_valid

I believe this is another case of the QA tool giving incorrect errors because it hasn't been updated for Bug 38720
Comment 23 Katrin Fischer 2025-02-19 16:07:19 UTC
Pushed for 25.05!

Well done everyone, thank you!
Comment 24 Pedro Amorim 2025-02-21 14:53:29 UTC
Created attachment 178505 [details]
ERMSideBar

This commit:
https://github.com/Koha-Community/Koha/commit/a4531fd

Is causing unintended style changes to ERM's sidebar menu. Picture on the left is how it was before, picture on the right is how it is now.