Bug 3426: Allow for multiple fields in itemcallnumber syspref
authorNick Clemens <nick@bywatersolutions.com>
Thu, 19 Dec 2019 05:29:47 +0000 (05:29 +0000)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Tue, 21 Jan 2020 11:26:18 +0000 (11:26 +0000)
commit2aa49ebab4cb4d36bea42f094df9ccb03945454e
tree08fda923fc307832249534fc0224296cb8ca8eb6
parent637e82729b76e406517c140f69e9071cc48ca199
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>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
C4/Items.pm
cataloguing/additem.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/cataloguing.pref