Summary: | Add support for multiple tags to the itemcallnumber system preference | ||
---|---|---|---|
Product: | Koha | Reporter: | Chris Cormack <chris> |
Component: | Cataloging | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | CLOSED FIXED | QA Contact: | Bugs List <koha-bugs> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | 1joynelson, andrew, cookie.wolfrom, egpetridis, ephetteplace, jzairo, marjorie.barry-vila, martin.renvoize, nick |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: | http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=9156 | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: |
The itemcallnumber system preference now allows to specify multiple fields from which Koha can pull a suggestion for the itemcallnumber to use when adding items.
|
|
Version(s) released in: |
20.05.00
|
Circulation function: | |
Bug Depends on: | 9156 | ||
Bug Blocks: | |||
Attachments: |
Bug 3426: Allow for multiple fields in itemcallnumber syspref
Bug 3426: Allow for multiple fields in itemcallnumber syspref Bug 3426: Allow for multiple fields in itemcallnumber syspref Bug 3426: Allow for multiple fields in itemcallnumber syspref Bug 3426: Allow for multiple fields in itemcallnumber syspref Bug 3426: Keep note about sequence of subfields |
Description
Chris Cormack
2010-05-21 01:10:22 UTC
Retargeting to 3.4 and taking this on. Besides allowing multiple values in the system preference, there are few other ways this could go: - letting the call number tag hierarchy vary by library (or collection or shelving location) - if there's more than one call number field in the record, letting the user choose which one to use in case they don't like the default. This might be as simple as displaying all of the call number fields from the bib record on the item editing form so that the user can copy in paste an alternative value if they don't like the default. It would be nice if the feature would display all options for a repeatable field. At the moment it only copies the first value into the callnumber field as suggestion. There's a another variation to consider -- a customer of ours hit on the idea of setting the system preference to '952o'. Doing this sets the initial call number of a new item to that of the "first" existing item. This certainly seems like a useful variation, but there should probably be something coded to make this more explicit, as it depends on an a mechanism (embedding item fields in the MARC bib) that isn't necessarily going to survive potential ways that the item editor might be redone in the future. While this is still open to discussion, allow me to propose some added functionality/flexibility, i.e. complex expressions in the itemcallnumber system preference. For example, I would prefer having call numbers formatted as "999.99 Aut YYYY" where - 999.99 are the first five digits of DDC code (in MARC21 092ab entry if filled, otherwise 082ab), padded with trailing zeroes so that DDC 920 would become 920.00 - Aut are the first three characters of the SOUNDEX of Author name "LEFT(LTRIM(RTRIM(SOUNDEX(biblio.author))), 3)" and - YYYY is the copyright year "CONVERT(biblio.copyrightdate, CHAR(4))", Hi all! Giving this old bug a bump. I talk to lots of libraries that would like to be able to define something like "050ab, 090ab" so that Koha will first check the 050 and use that call number if present, but, if no 050 is found, will then check the 090 and use that call number instead. I can confirm, this is something we get requests from libraries pretty frequently. This would be a helpful enhancement to be able to define multiple call numbers to check. Created attachment 96468 [details] [review] Bug 3426: Allow for multiple fields in itemcallnumber syspref Note that we change both cataloguing/additem.pl and C4/Items->PrepareItemrecordfordisplay I can find no code that uses callnumber from the C4/Items sub, except for the itemrecorddisplay script which is not called with an itemnumber from Koha and should be deprecated for REST or ILSDI or OAI (imho) To test: 1 - Define itemcallnumber syspref as "082ab,092ab,9520,245a" 2 - Find a record with no items 3 - Ensure it has no 082 field, but an 092 field 4 - Go to add an item - itemcallnumber is empty 5 - Apply patch 6 - Go to add item, itemcallnumber should be the 092ab fields 7 - Delete the 092 field 8 - Go to add item, itemcallnumber should be the 245a 9 - Edit the callnumber to be "testing" and save item 10 - For should now show itemcallnumber="testing" as default 11 - Browse to http://localhost:8081/cgi-bin/koha/services/itemrecorddisplay.pl?itemnumber=## subbing the correct itemnumber 12 - Ensure the callnumber is defaulting to testing 13 - delete the item you created 14 - browse to URL above - callnumber should now be 245 again 15 - Add an 092 field to record and ensure it is now default callnumber 16 - Add an 082 field, it should now be default You probably want to base this on bug 9156. Also, failing this because it's not properly checking each field in order -- in your example, when the system finds that the 082 is empty it jumps straight to the 245 at the end of the list without checking the 092 and 952. Also, if we're gonna change how this works then we need to change the syspref text. How about: List multiple comma-separated fields to check them sequentially. Each field can include multiple subfields. For example: "082ab,092ab" will look in the 082$a and 082$b, then the 092$a and 092$b. Examples (for MARC21 records): Dewey: 082ab,092ab; LOC: 050ab,090ab; from the item record: 952hi Created attachment 96498 [details] [review] Bug 3426: Allow for multiple fields in itemcallnumber syspref Note that we change both cataloguing/additem.pl and C4/Items->PrepareItemrecordfordisplay I can find no code that uses callnumber from the C4/Items sub, except for the itemrecorddisplay script which is not called with an itemnumber from Koha and should be deprecated for REST or ILSDI or OAI (imho) To test: 1 - Define itemcallnumber syspref as "082ab,092ab,9520,245a" 2 - Find a record with no items 3 - Ensure it has no 082 field, but an 092 field 4 - Go to add an item - itemcallnumber is empty 5 - Apply patch 6 - Go to add item, itemcallnumber should be the 092ab fields 7 - Delete the 092 field 8 - Go to add item, itemcallnumber should be the 245a 9 - Edit the callnumber to be "testing" and save item 10 - For should now show itemcallnumber="testing" as default 11 - Browse to http://localhost:8081/cgi-bin/koha/services/itemrecorddisplay.pl?itemnumber=## subbing the correct itemnumber 12 - Ensure the callnumber is defaulting to testing 13 - delete the item you created 14 - browse to URL above - callnumber should now be 245 again 15 - Add an 092 field to record and ensure it is now default callnumber 16 - Add an 082 field, it should now be default Created attachment 96501 [details] [review] Bug 3426: Allow for multiple fields in itemcallnumber syspref Note that we change both cataloguing/additem.pl and C4/Items->PrepareItemrecordfordisplay I can find no code that uses callnumber from the C4/Items sub, except for the itemrecorddisplay script which is not called with an itemnumber from Koha and should be deprecated for REST or ILSDI or OAI (imho) To test: 1 - Define itemcallnumber syspref as "082ab,092ab,9520,245a" 2 - Find a record with no items 3 - Ensure it has no 082 field, but an 092 field 4 - Go to add an item - itemcallnumber is empty 5 - Apply patch 6 - Go to add item, itemcallnumber should be the 092ab fields 7 - Delete the 092 field 8 - Go to add item, itemcallnumber should be the 245a 9 - Edit the callnumber to be "testing" and save item 10 - For should now show itemcallnumber="testing" as default 11 - Browse to http://localhost:8081/cgi-bin/koha/services/itemrecorddisplay.pl?itemnumber=## subbing the correct itemnumber 12 - Ensure the callnumber is defaulting to testing 13 - delete the item you created 14 - browse to URL above - callnumber should now be 245 again 15 - Add an 092 field to record and ensure it is now default callnumber 16 - Add an 082 field, it should now be default Created attachment 96559 [details] [review] Bug 3426: Allow for multiple fields in itemcallnumber syspref Note that we change both cataloguing/additem.pl and C4/Items->PrepareItemrecordfordisplay I can find no code that uses callnumber from the C4/Items sub, except for the itemrecorddisplay script which is not called with an itemnumber from Koha and should be deprecated for REST or ILSDI or OAI (imho) To test: 1 - Define itemcallnumber syspref as "082ab,092ab,9520,245a" 2 - Find a record with no items 3 - Ensure it has no 082 field, but an 092 field 4 - Go to add an item - itemcallnumber is empty 5 - Apply patch 6 - Go to add item, itemcallnumber should be the 092ab fields 7 - Delete the 092 field 8 - Go to add item, itemcallnumber should be the 245a 9 - Edit the callnumber to be "testing" and save item 10 - For should now show itemcallnumber="testing" as default 11 - Browse to http://localhost:8081/cgi-bin/koha/services/itemrecorddisplay.pl?itemnumber=## subbing the correct itemnumber 12 - Ensure the callnumber is defaulting to testing 13 - delete the item you created 14 - browse to URL above - callnumber should now be 245 again 15 - Add an 092 field to record and ensure it is now default callnumber 16 - Add an 082 field, it should now be default Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> I've got a small quibble over on bug 9156, but this part of things worked as desired. Thanks! Blocked by FQA on bug 9156 - please switch back once this is resolved. Switching back to signed off based on work in 9156 Created attachment 97636 [details] [review] Bug 3426: Allow for multiple fields in itemcallnumber syspref Note that we change both cataloguing/additem.pl and C4/Items->PrepareItemrecordfordisplay I can find no code that uses callnumber from the C4/Items sub, except for the itemrecorddisplay script which is not called with an itemnumber from Koha and should be deprecated for REST or ILSDI or OAI (imho) To test: 1 - Define itemcallnumber syspref as "082ab,092ab,9520,245a" 2 - Find a record with no items 3 - Ensure it has no 082 field, but an 092 field 4 - Go to add an item - itemcallnumber is empty 5 - Apply patch 6 - Go to add item, itemcallnumber should be the 092ab fields 7 - Delete the 092 field 8 - Go to add item, itemcallnumber should be the 245a 9 - Edit the callnumber to be "testing" and save item 10 - For should now show itemcallnumber="testing" as default 11 - Browse to http://localhost:8081/cgi-bin/koha/services/itemrecorddisplay.pl?itemnumber=## subbing the correct itemnumber 12 - Ensure the callnumber is defaulting to testing 13 - delete the item you created 14 - browse to URL above - callnumber should now be 245 again 15 - Add an 092 field to record and ensure it is now default callnumber 16 - Add an 082 field, it should now be default Signed-off-by: Andrew Fuerste-Henry <andrew@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Created attachment 97637 [details] [review] Bug 3426: Keep note about sequence of subfields Bug 9156 changed the wording of the pref slightly to make it clear that the subfield sequence of the record will be used, not the sequence of the subfields defined in the pref. This just reinstates the note: The order of the subfields in the record will be preserved. Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Love seeing these golden oldies getting some attention! Nice work everyone! Pushed to master for 20.05 Enhancement not backported to 19.11 branch Enhancement not backported to 19.11.x |