Bug 31634 - Add part_number and part_name in OPAC result browser
Summary: Add part_number and part_name in OPAC result browser
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Caroline Cyr La Rose
QA Contact: Testopia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-09-27 14:03 UTC by Caroline Cyr La Rose
Modified: 2023-12-28 20:43 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: Small patch
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds the title's part number and part name in the OPAC result browser.
Version(s) released in:
22.11.00


Attachments
Sample records (45.38 KB, text/plain)
2022-09-27 14:03 UTC, Caroline Cyr La Rose
Details
Screenshot of results browser (63.55 KB, image/png)
2022-09-27 14:10 UTC, Caroline Cyr La Rose
Details
Bug 31634: Add part_number and part_name in opac result browser (6.32 KB, patch)
2022-09-27 15:35 UTC, Caroline Cyr La Rose
Details | Diff | Splinter Review
Bug 31634: Add part_number and part_name in opac result browser (6.36 KB, patch)
2022-09-28 08:00 UTC, David Nind
Details | Diff | Splinter Review
Bug 31634: Add part_number and part_name in opac result browser (6.36 KB, patch)
2022-09-28 22:07 UTC, Lucas Gass
Details | Diff | Splinter Review
Bug 31634: Add part_number and part_name in opac result browser (6.42 KB, patch)
2022-09-28 22:08 UTC, Lucas Gass
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Caroline Cyr La Rose 2022-09-27 14:03:10 UTC
Created attachment 141031 [details]
Sample records

When there are a lot of results for a series, the result browser in the OPAC only shows the main title (245$a in MARC21), which is the same for all the titles in the series. It would be great if we could also see the part number (245$n) and part name (245$p) in that view. These informations are available in the biblio table under part_name and part_number.

I included a .mrc file with sample records of two series (MARC21). If you want to use your own records, search for or create records for a series that has the main title in 245$a and the volume number in 245$n and the volume title in 245$p.

To test:
1. Download the sample records and import into Koha
1.1. Download the sample mrc file
1.2. In Koha staff interface, go to Tools > Stage MARC records for import
1.3. Click 'Browse' and choose the file
1.4. Click 'Upload file'
1.5. Click 'Stage for import'
1.6. Click 'Manage staged records'
1.7. Click 'Import this batch into the catalog'

2. Make sure OpacBrowseResults is enabled
2.1. In Koha staff interface, go to Administration > Global system preferences
2.2. Search for OpacBrowseResults
2.3. If necessary, change to 'enable' and click 'Save all OPAC preferences'

3. In OPAC, search for BFF and browse the results
3.1. In Koha OPAC, search for BFF
3.2. Click on one of the titles to access the opac-detail page
3.3. Click 'Browse results'
--> Note that all results are for 'BFF' with no other title information
Comment 1 Caroline Cyr La Rose 2022-09-27 14:10:49 UTC
Created attachment 141032 [details]
Screenshot of results browser

Here is a screenshot of the results browser in a sandbox with the sample records.
Comment 2 Caroline Cyr La Rose 2022-09-27 15:35:47 UTC
Created attachment 141034 [details] [review]
Bug 31634: Add part_number and part_name in opac result browser

This patch adds the part_number and part_name in the opac results browser.

To test:
0. Apply patch

1. Download the sample records and import into Koha
1.1. Download the sample mrc file
1.2. In Koha staff interface, go to Tools > Stage MARC records for import
1.3. Click 'Browse' and choose the file
1.4. Click 'Upload file'
1.5. Click 'Stage for import'
1.6. Click 'Manage staged records'
1.7. Click 'Import this batch into the catalog'

2. Make sure OpacBrowseResults is enabled
2.1. In Koha staff interface, go to Administration > Global system preferences
2.2. Search for OpacBrowseResults
2.3. If necessary, change to 'enable' and click 'Save all OPAC preferences'

3. In OPAC, search for BFF and browse the results
3.1. In Koha OPAC, search for BFF
3.2. Click on one of the titles to access the opac-detail page
3.3. Click 'Browse results'
--> The browser should show the main title, along with the number and volume title.
Comment 3 Caroline Cyr La Rose 2022-09-27 15:36:52 UTC
I tried something... not sure if it's 100% ok, I did a lot of copy/pasting stuff that I didn't necessarily understand. Feel free to redo the patch if needed.
Comment 4 David Nind 2022-09-28 08:00:14 UTC
Created attachment 141042 [details] [review]
Bug 31634: Add part_number and part_name in opac result browser

This patch adds the part_number and part_name in the opac results browser.

To test:
0. Apply patch

1. Download the sample records and import into Koha
1.1. Download the sample mrc file
1.2. In Koha staff interface, go to Tools > Stage MARC records for import
1.3. Click 'Browse' and choose the file
1.4. Click 'Upload file'
1.5. Click 'Stage for import'
1.6. Click 'Manage staged records'
1.7. Click 'Import this batch into the catalog'

2. Make sure OpacBrowseResults is enabled
2.1. In Koha staff interface, go to Administration > Global system preferences
2.2. Search for OpacBrowseResults
2.3. If necessary, change to 'enable' and click 'Save all OPAC preferences'

3. In OPAC, search for BFF and browse the results
3.1. In Koha OPAC, search for BFF
3.2. Click on one of the titles to access the opac-detail page
3.3. Click 'Browse results'
--> The browser should show the main title, along with the number and volume title.

Signed-off-by: David Nind <david@davidnind.com>
Comment 5 David Nind 2022-09-28 08:10:24 UTC
(In reply to Caroline Cyr La Rose from comment #3)
> I tried something... not sure if it's 100% ok, I did a lot of copy/pasting
> stuff that I didn't necessarily understand. Feel free to redo the patch if
> needed.

Everything works as per the test plan. 8-)
Comment 6 Lucas Gass 2022-09-28 22:06:43 UTC
Looks great to me! A simple edit to the listResults aray in opac-detail.pl so the part name and number are available to you in the template. 

The template changes look good and I think this is a great addition.

QA scripts are happy too!
Comment 7 Lucas Gass 2022-09-28 22:07:19 UTC
Created attachment 141072 [details] [review]
Bug 31634: Add part_number and part_name in opac result browser

This patch adds the part_number and part_name in the opac results browser.

To test:
0. Apply patch

1. Download the sample records and import into Koha
1.1. Download the sample mrc file
1.2. In Koha staff interface, go to Tools > Stage MARC records for import
1.3. Click 'Browse' and choose the file
1.4. Click 'Upload file'
1.5. Click 'Stage for import'
1.6. Click 'Manage staged records'
1.7. Click 'Import this batch into the catalog'

2. Make sure OpacBrowseResults is enabled
2.1. In Koha staff interface, go to Administration > Global system preferences
2.2. Search for OpacBrowseResults
2.3. If necessary, change to 'enable' and click 'Save all OPAC preferences'

3. In OPAC, search for BFF and browse the results
3.1. In Koha OPAC, search for BFF
3.2. Click on one of the titles to access the opac-detail page
3.3. Click 'Browse results'
--> The browser should show the main title, along with the number and volume title.

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 Lucas Gass 2022-09-28 22:08:30 UTC
Oops, I will re-attach this one with my sign-off included.
Comment 9 Lucas Gass 2022-09-28 22:08:55 UTC
Created attachment 141073 [details] [review]
Bug 31634: Add part_number and part_name in opac result browser

This patch adds the part_number and part_name in the opac results browser.

To test:
0. Apply patch

1. Download the sample records and import into Koha
1.1. Download the sample mrc file
1.2. In Koha staff interface, go to Tools > Stage MARC records for import
1.3. Click 'Browse' and choose the file
1.4. Click 'Upload file'
1.5. Click 'Stage for import'
1.6. Click 'Manage staged records'
1.7. Click 'Import this batch into the catalog'

2. Make sure OpacBrowseResults is enabled
2.1. In Koha staff interface, go to Administration > Global system preferences
2.2. Search for OpacBrowseResults
2.3. If necessary, change to 'enable' and click 'Save all OPAC preferences'

3. In OPAC, search for BFF and browse the results
3.1. In Koha OPAC, search for BFF
3.2. Click on one of the titles to access the opac-detail page
3.3. Click 'Browse results'
--> The browser should show the main title, along with the number and volume title.

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

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 10 Tomás Cohen Arazi 2022-10-03 17:37:23 UTC
Pushed to master for 22.11.

Nice work everyone, thanks!