Bug 40262: Save and display copyrightclearance_confirmed

Test plan, k-t-d:
1) Enable ILLModule
2) Add a new HTML customization, visit:
<staff_url>/cgi-bin/koha/tools/additional-contents.pl?op=add_form&category=html_customizations&editmode=wysiwyg
3) Pick ILLModuleCopyrightClearance as the 'Display location'
4) Pick a 'Publication date' in the past
5) Add a title and content. Save.
6) Create a new ILL request in the OPAC, visit:
<opac_url>/cgi-bin/koha/opac-illrequests.pl?op=add_form&backend=Standard
7) Notice the copyright clearance step is shown. Click 'Yes'.
8) Enter a 'type' and (optionally) some metadata. Click 'Create'.
9) Go back to the module in Staff UI and pick the request just created through the OPAC, visit:
<staff_url>/cgi-bin/koha/ill/ill-requests.pl
10) Notice the message 'Patron has confirmed copyright clearance for this request' is shown next to the patron in the the request details

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
Pedro Amorim 2025-06-27 14:04:54 +00:00 committed by Lucas Gass
parent b8981d52a4
commit d572cdebcc
No known key found for this signature in database
GPG Key ID: 60B447398B0D36CA
5 changed files with 18 additions and 2 deletions

View File

@ -149,7 +149,7 @@ sub metadata {
my $metadata = {};
my @ignore = (
'requested_partners', 'type', 'type_disclaimer_value', 'type_disclaimer_date', 'unauthenticated_first_name',
'unauthenticated_last_name', 'unauthenticated_email', 'historycheck_requests'
'unauthenticated_last_name', 'unauthenticated_email', 'historycheck_requests', 'copyrightclearance_confirmed'
);
my $core_fields = _get_core_fields();
while ( my $attr = $attrs->next ) {

View File

@ -1106,7 +1106,8 @@ sub backend_create {
} elsif ( defined $params->{stage}
&& $params->{stage} eq 'copyrightclearance' )
{
$params->{stage} = 'init';
$params->{copyrightclearance_confirmed} = 1;
$params->{stage} = 'init';
}
}

View File

@ -633,6 +633,10 @@
<span class="label borrowernumber">Patron:</span>
[% borrowerlink = "/cgi-bin/koha/members/moremember.pl" _ "?borrowernumber=" _ request.patron.borrowernumber %]
<a href="[% borrowerlink | url %]" title="View borrower details"> [% request.patron.firstname _ " " _ request.patron.surname _ " [" _ request.patron.cardnumber _ "]" | html %] </a>
[% copyrightclearance_confirmed = request.extended_attributes.find({'type'=>'copyrightclearance_confirmed'}).value %]
[% IF copyrightclearance_confirmed %]
<i class="fa fa-fw fa-check text-success" aria-hidden="true"></i> <span class="tab-title">Patron has confirmed copyright clearance for this request</span>
[% END %]
</li>
[% END %]
[% IF request.biblio_id %]

View File

@ -124,6 +124,9 @@
<input id="ill-submit" class="btn btn-primary" type="submit" value="Create" />
<a class="cancel" href="/cgi-bin/koha/opac-illrequests.pl">Cancel</a>
</fieldset>
[% IF (whole.value.other.copyrightclearance_confirmed) %]
<input type="hidden" name="copyrightclearance_confirmed" value="1" />
[% END %]
<input type="hidden" name="op" value="cud-create" />
<input type="hidden" name="stage" value="form" />
<input type="hidden" name="backend" value="Standard" />

View File

@ -233,6 +233,14 @@ if ( $op eq 'list' ) {
$session->flush;
print $query->redirect('/cgi-bin/koha/opac-illrequests-unauthenticated.pl');
} else {
$request->extended_attributes(
[
{
type => 'copyrightclearance_confirmed',
value => 1,
}
]
) if $params->{copyrightclearance_confirmed};
print $query->redirect('/cgi-bin/koha/opac-illrequests.pl?message=2');
exit;
}