The first patch (bug 10363) did not take care of the subroutines from C4::Koha. This module contains several subroutines which could be either moved or replaced with a call to Koha::AuthorisedValues: - GetKohaImageurlFromAuthorisedValues - GetAuthValCode - GetAuthValCodeFromField - GetAuthorisedValues - GetAuthorisedValueCategories - GetAuthorisedValueByCode - GetKohaAuthorisedValues - GetKohaAuthorisedValuesFromField - GetKohaAuthorisedValuesMapping - GetKohaAuthorisedValueLib - GetAuthvalueDropbox
IsAuthorisedValueCategory is on bug 15800
GetKohaImageurlFromAuthorisedValues is removed by bug 15797
Bug 15803 - Koha::AuthorisedValues - Remove GetAuthorisedValueCategories
We have already started to move the authorised values related code to the Koha namespace, but some are still missing. To continue and move C4::Koha::*AuthorisedValues* subroutines to Koha::AuthorisedValues, we will need to join on marc_subfield_structure(.authorised_value which is actually an authorised value category). To do so we need to define a relationship (fk) between the two tables. But we have "special AV" like Asort1 (and friends) , LOST, DAMAGED, etc.) Which could not be in the authorised_values table [yet]. And 3 other "special special AV) like itemtypes, branches and cn_source. Others (undetermined so far) are linked to a marc_subfield_structure from installer/**/marcflavour/**/*framework*.sql, like STACK. My idea would be to move all the AV categories to a new table authorised_value_categories. It will contain only 1 column category_name refered by 1. authorised_values.category, 2. additional_fields.authorised_value_category (others authorised_value field should be renamed like that when they refer AV categories) and 3. iitems_search_fields.authorised_value_category. And, maybe later, auth_subfield_structure, auth_tag_structure, borrower_attribute_types, marc_tag_structure (some are varchar(10) et 20 when they should be 32!) We could imagine more attributes to this table, but don't ask me to add a authorised_value_categories.id as pk please :) We will have to use temporary tables to deal with the DB constraints, to add more fun. Finally the .sql will have to be updated to reflect these changes. I have just started but before to enter in this tunnel I'd like to know if there are a couple of volunteers to test? :)
(In reply to Jonathan Druart from comment #4) New table created on bug 17216 - Add a new table to store authorized value categories.
Bug 17248 - Koha::AuthorisedValues - Remove GetKohaAuthorisedValueLib
Bug 17249 - Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesFromField
Bug 17250 - Koha::AuthorisedValues - Remove GetAuthValCode
Bug 17251 - Koha::AuthorisedValues - Remove GetKohaAuthorisedValuesMapping
Bug 17252 - Koha::AuthorisedValues - Remove GetAuthorisedValueByCode
Bug 17253 - Koha::AuthorisedValues - Remove GetKohaAuthorisedValues
Bug 17844 - Move C4::Koha::get_notforloan_label_of to Koha::AuthorisedValues
Bug 17847 - Move C4::Koha::GetAuthvalueDropbox to Koha::AuthorisedValues
All dependent bugs have been closed - yay!