Jonathan Druart
80018625cf
To properly move C4::Koha::GetItemTypes to Koha::ItemTypes we need DBIx::Class to make a join on the localization table to retrieve the possible translated description of the item types. To do so there are 2 possibilities. The first one would have been to rename the localization table to something like itemtype_localization. That way we could have had a relationship between itemtype_localization.code and itemtypes.itemtype That would have meant to create one table per "entity" (here an entity is itemtype) we allow the translability. There are pros and cons for this choice, so I opt for another solution. The other solution is to create a view on top of this localization table. With this new view we can define the missing relationship. That sounds like a quite clean solution and easy to implement. Once we have this relationship, the Koha::ItemTypes->search_with_localization will join on this view an return the same result as GetItemTypes( style => 'array' ). To replace GetItemtypes( style => 'hash' ) which is the default behavior of this subroutine, we can do something like: my $itemtypes = Koha::ItemTypes->search_with_localization; my %itemtypes = map { $_->{itemtype} => $_ } @{ $itemtypes->unblessed }; This patchset must not introduce big changes but it changes certain behaviors (which were wrong) in some scripts. Indeed sometimes the descriptions of the item types were not the translated ones. Moreover it happens that the item types displayed in a dropdown list were not ordered by translated description, but by description of code (itemtypes.itemtype value). These 2 behaviors are what we expect. Test plan: Bugs will be hard to catch since these patches change a lot of file, it will be easier to read the diff and catch possible typos or logic errors. However signoffers can focus on modified files and the item types values. Signed-off-by: Josef Moravec <josef.moravec@gmail.com> Signed-off-by: Lari Taskula <lari.taskula@jns.fi> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com> |
||
---|---|---|
.. | ||
Acquisition | ||
Biblio | ||
Budgets | ||
Circulation | ||
db_dependent | ||
edi_testfiles | ||
External | ||
Koha | ||
lib | ||
Members | ||
Number | ||
Search | ||
Serials | ||
SIP | ||
00-checkdatabase-version.t | ||
00-deprecated.t | ||
00-load.t | ||
00-merge-conflict-markers.t | ||
00-testcritic.t | ||
00-valid-xml.t | ||
Auth_with_shibboleth.t | ||
AuthoritiesMarc_MARC21.t | ||
AuthoritiesMarc_UNIMARC.t | ||
AuthUtils.t | ||
Barcodes_annual.t | ||
Barcodes_EAN13.t | ||
Barcodes_hbyymmincr.t | ||
Barcodes_incremental.t | ||
Biblio.t | ||
Biblio2.t | ||
Bookseller.t | ||
Boolean.t | ||
Breeding.t | ||
Budgets.t | ||
Cache.t | ||
Calendar.t | ||
Charset.t | ||
Circulation_barcodedecode.t | ||
ClassSortRoutine.t | ||
ClassSortRoutine_Dewey.t | ||
ClassSortRoutine_Generic.t | ||
ClassSortRoutine_LCC.t | ||
ClassSource.t | ||
Context.t | ||
Contract.t | ||
Creators.t | ||
DateUtils.t | ||
Debug.t | ||
dummy.t | ||
Edifact.t | ||
EdiInvoice.t | ||
Ediorder.t | ||
Ediordrsp.t | ||
Form_MessagingPreferences.t | ||
Heading.t | ||
Images.t | ||
ImportBatch.t | ||
Installer_PerlDependencies.t | ||
Installer_PerlModules.t | ||
Installer_pm.t | ||
ItemCirculationAlertPreference.t | ||
Koha.t | ||
Koha_Email.t | ||
Koha_ExternalContent_OverDrive.t | ||
Koha_MetadataRecord.t | ||
Koha_Template_Plugin_Cache.t | ||
Koha_Template_Plugin_Koha.t | ||
Koha_Util_FrameworkPlugin.t | ||
Koha_Util_MARC.t | ||
Labels.t | ||
Labels_split_ccn.t | ||
Labels_split_ddcn.t | ||
Labels_split_lccn.t | ||
Languages.t | ||
Letters.t | ||
Log.t | ||
Logger.t | ||
Matcher.t | ||
Members_Attributes.t | ||
Members_AttributeTypes.t | ||
Members_Messaging.t | ||
Message.t | ||
NorwegianPatronDB.t | ||
OpenLibrarySearch.t | ||
Output.t | ||
Output_JSONStream.t | ||
Overdues.t | ||
Patron.t | ||
Patroncards.t | ||
Patroncards_Batch.t | ||
Patroncards_Layout.t | ||
Patroncards_Lib.t | ||
Patroncards_Patroncard.t | ||
Patroncards_Profile.t | ||
Patroncards_Template.t | ||
perlcriticrc | ||
Prices.t | ||
Print.t | ||
QueryParser.t | ||
RecordProcessor.t | ||
Ris.t | ||
RotatingCollections.t | ||
Scheduler.t | ||
Scrubber.t | ||
Search.t | ||
Search_PazPar2.t | ||
SimpleMARC.t | ||
smolder_smoke_signal | ||
SMS.t | ||
SocialData.t | ||
Stats.t | ||
SuggestionEngine.t | ||
SuggestionEngine_AuthorityFile.t | ||
TmplToken.t | ||
Token.t | ||
XSLT.t |