Bug 39610 - Allow for customizing the metadata shown on OPAC ILL request table
Summary: Allow for customizing the metadata shown on OPAC ILL request table
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: ILL (show other bugs)
Version: Main
Hardware: All All
: P5 - low enhancement
Assignee: HKS3 Tadeusz Sośnierz
QA Contact: Pedro Amorim
URL:
Keywords:
Depends on: 39600
Blocks:
  Show dependency treegraph
 
Reported: 2025-04-11 10:10 UTC by HKS3 Tadeusz Sośnierz
Modified: 2025-04-11 16:03 UTC (History)
2 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:


Attachments
Bug 39610: Make ILL request metadata fields shown in OPAC table configurable (5.56 KB, patch)
2025-04-11 10:39 UTC, HKS3 Tadeusz Sośnierz
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description HKS3 Tadeusz Sośnierz 2025-04-11 10:10:18 UTC
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.
Comment 1 HKS3 Tadeusz Sośnierz 2025-04-11 10:39:02 UTC
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/)
Comment 2 HKS3 Tadeusz Sośnierz 2025-04-11 10:40:32 UTC
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.
Comment 3 Pedro Amorim 2025-04-11 10:49:59 UTC
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)
Comment 4 Pedro Amorim 2025-04-11 16:03:22 UTC
(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!