In catalogue/detail.pl, if items.materials is linked to an authorised values list, show label instead of code.
Created attachment 30290 [details] [review] Bug 12670: Show materials label instead of code In catalogue/detail.pl, if items.materials is linked to an authorised values list, show label instead of code. Test plan: 1/ Create an authorised values list 'MATERIALS' with some values 2/ In default MARC biblio framework, link an item subfield to 'items.materials', and to the AV list 'MATERIALS' 3/ Edit an item and give a value for this subfield 4/ Go to biblio record detail page (catalogue/detail.pl) 5/ In the items table, the authorised value label should be displayed.
When testing I found that if I entered any value defined as an AV into subfield 3/materials sepcified it displayed the label whether or not the field was linked i.e. 1 - apply patch 2 - do not link any fields 3 - enter 'CART' into subfield 3 (defined as "Book Cart" in LOC category of AV) 4 - 'Book Cart' displays on catalogue/detail.pl
Hi Nick, are you sure there is nothing linked to the subfield $3 ? In any framework ? Does master have the same behaviour ? Does it also happen with another subfield ? Could you also check the "Koha to MARC mappings" page (cgi-bin/koha/admin/koha2marclinks.pl) ? Thanks.
I cannot now recreate, still had some oddness going on but I think it was me so reverting to sign off and will test again when I have a chnace
Created attachment 32765 [details] [review] Bug 12670: Show materials label instead of code In catalogue/detail.pl, if items.materials is linked to an authorised values list, show label instead of code. Test plan: 1/ Create an authorised values list 'MATERIALS' with some values 2/ In default MARC biblio framework, link an item subfield to 'items.materials', and to the AV list 'MATERIALS' 3/ Edit an item and give a value for this subfield 4/ Go to biblio record detail page (catalogue/detail.pl) 5/ In the items table, the authorised value label should be displayed. Signed-off-by: Frederic Demians <f.demians@tamil.fr> Works as described. As soon as an AV list is linked to items.materials, this patch is necessary to display materials value rather than code from the AV. Side note: items.materials is displayed in item tab on catalog/detail.pl page, but isn't displayed on catalogue/moredetail.pl.
Ok, I see a problem here that keeps me from testing. I have changed my framework to link 952$3 (default for MARC21 materials) to an authorized value. But now when I edit an item, there is no pull down and no input field. I can't enter a new value?
Turns out... it was the 'collapsed' flag causing some weirdness, back to testing.
I have tested this some more and I don't feel like this is working well: - The check-in and check-out messages still show the code and not the description. - The code is not specific enough. It doesn't check if the subfield is mapped to an authorized value. The translation to a description will also happen, if you haven't mapped your framework to an authorized value at all. - It doesn't look for a specific authorized value category, so if you have the same codes in multiple categories, the display is kinda random.
(In reply to Katrin Fischer from comment #8) > - The check-in and check-out messages still show the code and not the > description. Do you mean that a follow-up patch is required? I agree that if this patch is necessary on catalogue/details.pl page, other pages displaying items.materials should be updated. > - The code is not specific enough. It doesn't check if the subfield is mapped > to an authorized value. The translation to a description will also happen, if > you haven't mapped your framework to an authorized value at all. I don't understand. How can the translation to a description happen without AV? > - It doesn't look for a specific authorized value category, so if you have > the same codes in multiple categories, the display is kinda random. I think you're wrong. The call to GetAuthValCode() returns the name of the AV list linked to items.materials. And then, the available values for this specific AV are retrieved by calling GetAuthorisedValues.
Hi Frederic, I was surprised as well. I first linked it to the reports group authorized value and added ACC - it worked and translated the display to Accounts. Then I removed the linking, it still showed Accounts. Then I changed the code to ADDR - a code from another authorized value, and it translated it to the description given there.
(In reply to Katrin Fischer from comment #10) > Hi Frederic, I was surprised as well. > I first linked it to the reports group authorized value and added ACC - it > worked and translated the display to Accounts. > Then I removed the linking, it still showed Accounts. > Then I changed the code to ADDR - a code from another authorized value, and > it translated it to the description given there. I can't reproduce that! Are you sure you're modifying the correct framework? the one used for the biblio record you test?
I was using the default framework. I have a feeling like we should test that the routine actually returns an AV, but I haven't taken a closer look. The check-in/check-out messages could be fixed in a separate bug, but I think we should aim to make this a complete feature.
(In reply to Katrin Fischer from comment #12) > I was using the default framework. I have a feeling like we should test that > the routine actually returns an AV, but I haven't taken a closer look. > > The check-in/check-out messages could be fixed in a separate bug, but I > think we should aim to make this a complete feature. Looking closely at the code (detail.pl), It seems that code refactoring should be welcome on the way all AV are decoded... For a lot of fields, GetKohaAuhtorisedValues/GetAuthValCode are called: location, ccode, copynumber, itemlost, damaged, etc. We could have a new function doing all the decoding in once: DecodeAuthValues( $item, $fw, qw/ items.location items. ccode / ); And in C4::Koha, authorized values are not cached... So it means that if we have to display, let say, 30 items, having each 5 AV, 150 SQL queries are sent to MySQL.
Created attachment 40671 [details] [review] Bug 12670: Show materials label instead of code Rebased on master + fixed issues when items.materials is not linked to AV list
Katrin or Frédéric, could you be more specific about check-in and check-out messages? I don't see what you are talking about.
Julian, when you check-in or check-out an item with materials set, there is a little dialog box showing up with the text from the field.
Created attachment 41888 [details] [review] Bug 12670: Show materials label in checkin/checkout messages
CONFLICT (content): Merge conflict in circ/circulation.pl
Created attachment 48298 [details] [review] Bug 12670: Show materials label in checkin/checkout messages
Created attachment 48299 [details] [review] Bug 12670: Show materials label instead of code In catalogue/detail.pl, if items.materials is linked to an authorised values list, show label instead of code. Test plan: 1/ Create an authorised values list 'MATERIALS' with some values 2/ In default MARC biblio framework, link an item subfield to 'items.materials', and to the AV list 'MATERIALS' 3/ Edit an item and give a value for this subfield 4/ Go to biblio record detail page (catalogue/detail.pl) 5/ In the items table, the authorised value label should be displayed.
Created attachment 48300 [details] [review] Bug 12670: Show materials label in checkin/checkout messages
Created attachment 48301 [details] [review] Bug 12670: Show materials label instead of code In catalogue/detail.pl, if items.materials is linked to an authorised values list, show label instead of code. Test plan: 1/ Create an authorised values list 'MATERIALS' with some values 2/ In default MARC biblio framework, link an item subfield to 'items.materials', and to the AV list 'MATERIALS' 3/ Edit an item and give a value for this subfield 4/ Go to biblio record detail page (catalogue/detail.pl) 5/ In the items table, the authorised value label should be displayed. Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 48302 [details] [review] Bug 12670: Show materials label in checkin/checkout messages Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Created attachment 49512 [details] [review] [PASSED QA] Bug 12670: Show materials label instead of code In catalogue/detail.pl, if items.materials is linked to an authorised values list, show label instead of code. Test plan: 1/ Create an authorised values list 'MATERIALS' with some values 2/ In default MARC biblio framework, link an item subfield to 'items.materials', and to the AV list 'MATERIALS' 3/ Edit an item and give a value for this subfield 4/ Go to biblio record detail page (catalogue/detail.pl) 5/ In the items table, the authorised value label should be displayed. Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Created attachment 49513 [details] [review] [PASSED QA] Bug 12670: Show materials label in checkin/checkout messages Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Tested checkout, checkin and detail page view with and without authorised value.
Pushed to Master - Should be in the May 2016 release. Thanks!