From 265bbd8d80a848c8b2c54f9dc0f0752eb682acad Mon Sep 17 00:00:00 2001 From: Alex Sassmannshausen Date: Thu, 25 May 2017 18:28:41 +0200 Subject: [PATCH] Bug 7317: Add generic Copyright Clearance functionality. * Koha/Illrequest.pm (backend_create): Consider Copyright Clearance syspref. * koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt: Display Copyright Clearance information. Signed-off-by: Magnus Enger --- Koha/Illrequest.pm | 17 +++++++++++++++++ .../intranet-tmpl/prog/en/modules/ill/ill-requests.tt | 15 ++++++++++++++- 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/Koha/Illrequest.pm b/Koha/Illrequest.pm index 145c55a..6677fcd 100644 --- a/Koha/Illrequest.pm +++ b/Koha/Illrequest.pm @@ -467,6 +467,23 @@ pass it $params, as it does not yet have any other data associated with it. sub backend_create { my ( $self, $params ) = @_; + # Establish whether we need to do a generic copyright clearance. + if ( ( !$params->{stage} || $params->{stage} eq 'init' ) + && C4::Context->preference("ILLModuleCopyrightClearance") ) { + return { + error => 0, + status => '', + message => '', + method => 'create', + stage => 'copyrightclearance', + value => { + backend => $self->_backend->name + } + }; + } elsif ( $params->{stage} eq 'copyrightclearance' ) { + $params->{stage} = 'init'; + } + # First perform API action, then... my $args = { request => $self, diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt index 5c2f3fb..c013727 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt @@ -1,4 +1,5 @@ [% USE Branches %] +[% USE Koha %] [% INCLUDE 'doc-head-open.inc' %] Koha › ILL requests › @@ -396,7 +397,19 @@ [% IF query_type == 'create' %]

New ILL request

- [% PROCESS $whole.template %] + [% IF whole.stage == 'copyrightclearance' %] +
+

+ [% Koha.Preference('ILLModuleCopyrightClearance') %] +

+ Yes + No +
+ [% ELSE %] + [% PROCESS $whole.template %] + [% END %] [% ELSIF query_type == 'confirm' %]

Confirm ILL request

-- 2.7.4