The stock ILL table only displays the Author and Title for each request. This is a bit bare-bones even for the Standard backend – for other backends it may be either completely invalid (if they use different fields) or insufficient. It would be useful to have a way to configure the displayed fields.
Created attachment 180825 [details] [review] Bug 39610: Make ILL request metadata fields shown in OPAC table configurable Test plan: 1. In KTD, go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=master+switch and enable the ILL module 2. Run the following script to populate the request list for user `koha`: use strict; use warnings; use Koha::ILL::Request; my $backend = 'Standard'; my $branchcode = 'CPL'; for my $n (1..100) { my $req = Koha::ILL::Request->new->load_backend($backend); my $fields = $req->_backend->_get_core_fields(); my @extended_attributes = map { +{ type => $_, value => "$_ for $n" } } keys %$fields; $req->_backend->create_api({ backend => $backend, branchcode => $branchcode, borrowernumber => 51, type => 'book', extended_attributes => \@extended_attributes, }, $req); } 3. Navigate to http://localhost:8080/cgi-bin/koha/opac-illrequests.pl, log in as `koha` as needed 4. Observe only the default Author and Title being displayed 5. Go to http://localhost:8081/cgi-bin/koha/admin/preferences.pl?tab=&op=search&searchfield=ILLOpacMetadataFields and set `author|article_author(Article Author)` as the new value 6. On http://localhost:8080/cgi-bin/koha/opac-illrequests.pl, observe how the configured metadata values are now shown, with configured names Sponsored-by: Wiko (https://www.wiko-berlin.de/)
The patch above builds on top of https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=39600 and applies cleanly on its commit b89287d213f9ac74d6c2bdae34a66c5883fed415 (cleanup). I'm not super-stoked on manipulating dataTables definition with TT, I'd be curious to hear your ideas for alternatives.
Hi Tadeusz, thank you for this work. Please change the bug status to 'Needs Sign-off' if patch ready to be looked at or 'In Discussion' if it's just a PoC that you want feedback on (either status should be fine tbh)
(In reply to HKS3 Tadeusz Sośnierz from comment #2) > I'm not super-stoked on manipulating dataTables definition with TT, I'd be > curious to hear your ideas for alternatives. I wouldn't worry too much about manipulating dataTables definition with TT, it's an established pattern utilized elsewhere (see patron-search.inc). I like the idea here but we're losing i18n. Previously, the 'Author' and 'Title' - even though hardcoded - were translatable. Now, we're relying on the table column headers to be inserted directly in the syspref within parenthesis, which works, but doesn't look ideal, and certainly not translatable. See bug 38339, it's making the display names of the attributes translatable. Even though that can't be applied here directly (because we don't have an ILL request - to know its backend - when defining the table column headers) I feel like using that in some way could be an option? I'm not sure, but I don't have a better idea at the moment either!