Bug 4255 - Add item type to facet list
Summary: Add item type to facet list
Status: CLOSED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: OPAC (show other bugs)
Version: 3.10
Hardware: PC All
: P5 - low enhancement (vote)
Assignee: Meenakshi
QA Contact: Bugs List
URL:
Keywords:
Depends on: 3216
Blocks:
  Show dependency treegraph
 
Reported: 2010-02-23 06:07 UTC by Zachary Spalding
Modified: 2013-12-05 20:05 UTC (History)
5 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Version(s) released in:


Attachments
Attaching Patch. (6.26 KB, patch)
2012-05-30 10:52 UTC, Meenakshi
Details | Diff | Splinter Review
[SIGNED-OFF] Bug 4255 - Add item type to facet list (6.33 KB, patch)
2012-06-11 11:27 UTC, Kyle M Hall
Details | Diff | Splinter Review
[PASSED QA] Bug 4255 - Add item type to facet list (6.51 KB, patch)
2012-06-15 14:42 UTC, Ian Walls
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Cormack 2010-05-21 01:25:00 UTC


---- Reported by spalding@senylrc.org 2010-02-23 18:07:11 ----

Item Type would be a great feature to be added to the facet list.



--- Bug imported by chris@bigballofwax.co.nz 2010-05-21 01:25 UTC  ---

This bug was previously known as _bug_ 4255 at http://bugs.koha.org/cgi-bin/bugzilla3/show_bug.cgi?id=4255

Unknown operating system Windows 2000. Setting to default OS "All".
Actual time not defined. Setting to 0.0
Setting qa contact to the default for this product.
   This bug either had no qa contact or an invalid one.

Comment 1 Ian Walls 2011-12-01 22:54:35 UTC
This is probably one of the more difficult cases!

While it is possible to dump multiple MARC fields into a facet, it is NOT possible to look in different subfields across those facets.  Since item type is stored at both the item level AND the biblio level, then we need to be able to mix and match both.  In MARC21, those fields are 942$c and 952$y.

Either we need to remap 942$c to 942$y in MARC21, or we need to modify C4::Search::getRecords in a such a way that it can handle subfields tied to specific fields.
Comment 2 Savitra Sirohi 2012-05-30 10:36:59 UTC
This is for MARC 21 only.

Made following changed:

- In Getfacets in C4/Koha.pm added item type facet for 952y and 942c
- In getrecords in C4:Search.pm added code to get description of itemtype codes
- facets.inc in both staff and opac to show item types related label in the facets block

To test:

Add records such that a certain itype (say BK) is present in both 942c and 952y in two DIFFERENT records. 

Run a search where both test records are present. Test to see if itype types are presented in the facets block (both OPAC and staff). 

Click on the itype (say BK), both the test records should appear in the refined results. This shows that the feature works for both 942c and 952y.
Comment 3 Meenakshi 2012-05-30 10:52:04 UTC Comment hidden (obsolete)
Comment 4 Kyle M Hall 2012-06-11 11:27:26 UTC Comment hidden (obsolete)
Comment 5 Ian Walls 2012-06-15 14:42:58 UTC
Created attachment 10296 [details] [review]
[PASSED QA] Bug 4255 - Add item type to facet list

This is for MARC 21 only.

Made following changed:

- In getFacets in C4/Koha.pm added item type facet for 952y and 942c
- In getRecords in C4:Search.pm added code to get description of itemtype codes
- facets.inc in both staff and opac to show item types related label in the facets block

To test:

Add records such that a certain itype (say BK) is present in both 942c and 952y in two DIFFERENT records.

Run a search where both test records are present. Test to see if itype types are presented in the facets block (both OPAC and staff).

Click on the itype (say BK), both the test records should appear in the refined results. This shows that the feature works for both 942c and 952y.

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>

Signed-off-by: Ian Walls <koha.sekjal@gmail.com>

QA Comment: fixed capitalization in template includes according to HTML4 coding
guideline ("Item types" instead of "ItemTypes")
Comment 6 Ian Walls 2012-06-15 14:43:25 UTC
According to coding guideline HTML4, the string in the templates should be "Item types" not "ItemTypes".

Otherwise, this patch is very good, even if it's MARC21-only.  I'm so pleased with it, I've made the capitalization fixes myself, and resubmitted with QA signoff.
Comment 7 Paul Poulain 2012-06-20 20:55:17 UTC
Patch pushed, a follow-up for UNIMARC would be usefull, will ask claire
Comment 8 Jared Camins-Esakov 2012-12-31 01:13:48 UTC
There have been no further reports of problems so I am marking this bug resolved.