Bugzilla – Attachment 151033 Details for
Bug 33716
ILL - Allow for a disclaimer stage per request type
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33716: ILL Type Disclaimer - Staff
Bug-33716-ILL-Type-Disclaimer---Staff.patch (text/plain), 7.67 KB, created by
Pedro Amorim
on 2023-05-10 18:57:57 UTC
(
hide
)
Description:
Bug 33716: ILL Type Disclaimer - Staff
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-05-10 18:57:57 UTC
Size:
7.67 KB
patch
obsolete
>From 5059308f1c3b0d210462d2070acbb3f9e60ac5e0 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 4 May 2023 13:34:18 +0000 >Subject: [PATCH] Bug 33716: ILL Type Disclaimer - Staff > >Update the way Availability is handled >Add the new type disclaimer workflow operation >after Availability >--- > ill/ill-requests.pl | 70 ++++++++----------- > .../prog/en/modules/ill/ill-requests.tt | 39 +++++++++++ > 2 files changed, 68 insertions(+), 41 deletions(-) > >diff --git a/ill/ill-requests.pl b/ill/ill-requests.pl >index fc7da41710..8f0f02cef9 100755 >--- a/ill/ill-requests.pl >+++ b/ill/ill-requests.pl >@@ -27,7 +27,8 @@ use Koha::Notice::Templates; > use Koha::AuthorisedValues; > use Koha::Illcomment; > use Koha::Illrequests; >-use Koha::Illrequest::Availability; >+use Koha::Illrequest::Workflow::Availability; >+use Koha::Illrequest::Workflow::TypeDisclaimer; > use Koha::Libraries; > use Koha::Token; > >@@ -104,55 +105,42 @@ if ( $backends_available ) { > > > } elsif ( $op eq 'create' ) { >- # We're in the process of creating a request >+ # Load the ILL backend > my $request = Koha::Illrequest->new->load_backend( $params->{backend} ); >- # Does this backend enable us to insert an availability stage and should >- # we? If not, proceed as normal. >- if ( >- # If the user has elected to continue with the request despite >- # having viewed availability info, this flag will be set >- C4::Context->preference("ILLCheckAvailability") >- && !$params->{checked_availability} >- && $request->_backend_capability( 'should_display_availability', $params ) >- ) { >- # Establish which of the installed availability providers >- # can service our metadata >- my $availability = Koha::Illrequest::Availability->new($params); >- my $services = $availability->get_services({ >- ui_context => 'staff' >- }); >- if (scalar @{$services} > 0) { >- # Modify our method so we use the correct part of the >- # template >- $op = 'availability'; >- $params->{method} = 'availability'; >- delete $params->{stage}; >- # Prepare the metadata we're sending them >- my $metadata = $availability->prep_metadata($params); >- $template->param( >- whole => $params, >- metadata => $metadata, >- services_json => scalar encode_json($services), >- services => $services >- ); >- } else { >- # No services can process this metadata, so continue as normal >- my $backend_result = $request->backend_create($params); >- $template->param( >- whole => $backend_result, >- request => $request >- ); >- handle_commit_maybe($backend_result, $request); >- } >+ >+ # Before request creation operations - Preparation >+ my $availability = >+ Koha::Illrequest::Workflow::Availability->new( $params, 'staff' ); >+ my $type_disclaimer = >+ Koha::Illrequest::Workflow::TypeDisclaimer->new( $params, 'staff' ); >+ >+ # ILLCheckAvailability operation >+ if ($availability->show_availability($request)) { >+ $op = 'availability'; >+ $template->param( >+ $availability->availability_template_params($params) >+ ) >+ # ILLModuleDisclaimerByType operation >+ } elsif ( $type_disclaimer->show_type_disclaimer($request, $params)) { >+ $op = 'typedisclaimer'; >+ $template->param( >+ $type_disclaimer->type_disclaimer_template_params($params) >+ ); >+ # Ready to create ILL request > } else { > my $backend_result = $request->backend_create($params); >+ >+ # After creation actions >+ if ( $params->{type_disclaimer_submitted} ) { >+ $type_disclaimer->after_request_created($params, $request); >+ } >+ > $template->param( > whole => $backend_result, > request => $request > ); > handle_commit_maybe($backend_result, $request); > } >- > } elsif ( $op eq 'migrate' ) { > # We're in the process of migrating a request > my $request = Koha::Illrequests->find($params->{illrequest_id}); >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 d26e627730..403df3142b 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 >@@ -828,6 +828,45 @@ > [% INCLUDE 'ill-availability-table.inc' service=service %] > [% END %] > </div> >+ [% ELSIF query_type == 'typedisclaimer' %] >+ <!-- typedisclaimer --> >+ <h1>Request type disclaimer</h1> >+ <div id="results" class="page-section"> >+ <form method="post" id="typedisclaimer-form"> >+ <fieldset class="rows"> >+ [% disclaimer.text | $raw %] >+ [% SET disc_av_category_code = AuthorisedValues.GetAuthValueDropbox(disclaimer.av_cat) %] >+ [% IF disc_av_category_code.count %] >+ <br> >+ <select name="type_disclaimer_value"> >+ [% FOR av_option IN disc_av_category_code %] >+ <option value="[% av_option.lib_opac | html %]">[% av_option.lib_opac | html %]</option> >+ [% END %] >+ </select> >+ [% END %] >+ </fieldset> >+ <fieldset class="action"> >+ [% FOREACH key IN whole.keys %] >+ [% value = whole.$key %] >+ [% IF key != 'method' && key != 'custom_key' && key != 'custom_value' %] >+ <input type="hidden" name="[% key | html %]" value="[% value | html %]"> >+ [% END %] >+ [% END %] >+ [% custom_keys = whole.custom_key.split('\0') %] >+ [% custom_values = whole.custom_value.split('\0') %] >+ [% i = 0 %] >+ [% FOREACH custom_key IN custom_keys %] >+ <input type="hidden" name="custom_key" value="[% custom_key | html %]"> >+ <input type="hidden" name="custom_value" value="[% custom_values.$i | html %]"> >+ [% i = i + 1 %] >+ [% END %] >+ <input type="hidden" name="method" value="create" /> >+ <input type="hidden" name="stage" value="form"> >+ <input type="hidden" name="type_disclaimer_submitted" value="1"> >+ <input type="submit" value="Next" /> >+ </fieldset> >+ </form> >+ </div> > [% ELSE %] > <!-- Custom Backend Action --> > [% PROCESS $whole.template %] >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 33716
:
151027
|
151031
|
151032
|
151033
|
151034
|
151035
|
151146
|
151147
|
151148
|
151149
|
151150
|
151388
|
151389
|
151390
|
151391
|
151392
|
151393
|
151394
|
151401
|
151402
|
151403
|
151404
|
151405
|
151406
|
151407
|
151408
|
151409
|
151410
|
151411
|
152809
|
152810
|
152811
|
152813
|
152814
|
152815
|
152816
|
152817
|
152818
|
152819
|
152820
|
152821
|
152822
|
152823
|
152826
|
154305
|
154454
|
154714