Bugzilla – Attachment 181094 Details for
Bug 36197
Allow unauthenticated ILL requests in the OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 36197: (QA follow-up): Hackfest followup WIP
Bug-36197-QA-follow-up-Hackfest-followup-WIP.patch (text/plain), 8.49 KB, created by
Tomás Cohen Arazi (tcohen)
on 2025-04-17 13:40:47 UTC
(
hide
)
Description:
Bug 36197: (QA follow-up): Hackfest followup WIP
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2025-04-17 13:40:47 UTC
Size:
8.49 KB
patch
obsolete
>From 23fb5102ecf4a9d185cbf386ed7e7d820bd23754 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@openfifth.co.uk> >Date: Thu, 10 Apr 2025 16:16:54 +0000 >Subject: [PATCH] Bug 36197: (QA follow-up): Hackfest followup WIP > >Moved unauth data to their respective illrequestattributes entries >instead of staffnotes + opacnotes. >Update confirmation message > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > Koha/ILL/Backend/Standard.pm | 11 ++++--- > Koha/ILL/Request.pm | 33 ++++++++++++------- > .../prog/en/modules/ill/ill-requests.tt | 28 ++++++++++++++++ > .../bootstrap/en/modules/opac-illrequests.tt | 14 +++++++- > 4 files changed, 69 insertions(+), 17 deletions(-) > >diff --git a/Koha/ILL/Backend/Standard.pm b/Koha/ILL/Backend/Standard.pm >index 3db432f5c2c..36d4ea79408 100644 >--- a/Koha/ILL/Backend/Standard.pm >+++ b/Koha/ILL/Backend/Standard.pm >@@ -146,9 +146,12 @@ that we do not consider to be metadata > > sub metadata { > my ( $self, $request ) = @_; >- my $attrs = $request->extended_attributes; >- my $metadata = {}; >- my @ignore = ( 'requested_partners', 'type', 'type_disclaimer_value', 'type_disclaimer_date' ); >+ my $attrs = $request->extended_attributes; >+ my $metadata = {}; >+ my @ignore = ( >+ 'requested_partners', 'type', 'type_disclaimer_value', 'type_disclaimer_date', 'unauthenticated_first_name', >+ 'unauthenticated_last_name', 'unauthenticated_email' >+ ); > my $core_fields = _get_core_fields(); > while ( my $attr = $attrs->next ) { > my $type = $attr->type; >@@ -1016,7 +1019,7 @@ sub add_request { > } > } keys %{$request_details}; > $request->extended_attributes( \@request_details_array ); >- $request->append_unauthenticated_notes( $params->{other} ) if $unauthenticated_request; >+ $request->add_unauthenticated_data( $params->{other} ) if $unauthenticated_request; > > return $request; > } >diff --git a/Koha/ILL/Request.pm b/Koha/ILL/Request.pm >index ddc5438a55e..70fbe9f49bf 100644 >--- a/Koha/ILL/Request.pm >+++ b/Koha/ILL/Request.pm >@@ -34,7 +34,7 @@ use Koha::Cache::Memory::Lite; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string ); > use Koha::Exceptions::Ill; >-use Koha::I18N qw(__ __x); >+use Koha::I18N qw(__); > use Koha::ILL::Backend::Standard; > use Koha::ILL::Batches; > use Koha::ILL::Comments; >@@ -1939,24 +1939,33 @@ sub attach_processors { > } > } > >-=head3 append_unauthenticated_notes >+=head3 add_unauthenticated_data > >- append_unauthenticated_notes($metadata); >+ add_unauthenticated_data($metadata); > >-Append unauthenticated details to staff and opac notes >+Adds unauthenticated data as I<Koha::ILL::Request::Attributes> > > =cut > >-sub append_unauthenticated_notes { >+sub add_unauthenticated_data { > my ( $self, $metadata ) = @_; >- my $unauthenticated_notes_text = __x( >- "Unauthenticated request.\nFirst name: {first_name}.\nLast name: {last_name}.\nEmail: {email}.", >- first_name => $metadata->{'unauthenticated_first_name'}, >- last_name => $metadata->{'unauthenticated_last_name'}, >- email => $metadata->{'unauthenticated_email'} >+ >+ my $extended_attributes = $self->extended_attributes( >+ [ >+ { >+ type => 'unauthenticated_first_name', >+ value => $metadata->{'unauthenticated_first_name'}, >+ }, >+ { >+ type => 'unauthenticated_last_name', >+ value => $metadata->{'unauthenticated_last_name'}, >+ }, >+ { >+ type => 'unauthenticated_email', >+ value => $metadata->{'unauthenticated_email'}, >+ }, >+ ] > ); >- $self->append_to_note($unauthenticated_notes_text); >- $self->notesopac($unauthenticated_notes_text)->store; > } > > =head3 unauth_request_data_check >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 ff5d074685a..a5cfc474eb9 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 >@@ -663,6 +663,34 @@ > [% END %] > </ol> > </div> >+ [% IF req_status == 'UNAUTH' %] >+ <div class="rows"> >+ <h4>Unauthenticated request details</h4> >+ <ol> >+ [% unauthenticated_first_name = request.extended_attributes.find({'type'=>'unauthenticated_first_name'}).value %] >+ [% IF unauthenticated_first_name %] >+ <li> >+ <span class="label unauthenticated_first_name">First name:</span> >+ [% unauthenticated_first_name | html %] >+ </li> >+ [% END %] >+ [% unauthenticated_last_name = request.extended_attributes.find({'type'=>'unauthenticated_last_name'}).value %] >+ [% IF unauthenticated_last_name %] >+ <li> >+ <span class="label unauthenticated_last_name">Last name:</span> >+ [% unauthenticated_last_name | html %] >+ </li> >+ [% END %] >+ [% unauthenticated_email = request.extended_attributes.find({'type'=>'unauthenticated_email'}).value %] >+ [% IF unauthenticated_email %] >+ <li> >+ <span class="label unauthenticated_email">Email:</span> >+ [% unauthenticated_email | html %] >+ </li> >+ [% END %] >+ </ol> >+ </div> >+ [% END %] > <div class="rows"> > <h4>Details from supplier ([% request.backend | html %])</h4> > <ol> >diff --git a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >index 7df27a23ccf..d531a48b9d4 100644 >--- a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >+++ b/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt >@@ -253,7 +253,7 @@ > [% END %] > </form> > [% ELSIF op == 'unauth_view' %] >- <div class="alert alert-success" role="alert">Your request has been placed. Please check your email for further instructions.</div> >+ <div class="alert alert-success" role="alert">Your request has been placed. We'll contact you shortly.</div> > <h1>View interlibrary loan request</h1> > [% INCLUDE messages %] > [% status = request.status %] >@@ -295,6 +295,18 @@ > <label for="updated">Last updated:</label> > [% request.updated | $KohaDates %] > </li> >+ <li> >+ <label for="unauthenticated_first_name">Unauthenticated first name:</label> >+ [% request.extended_attributes.find({'type'=>'unauthenticated_first_name'}).value | html %] >+ </li> >+ <li> >+ <label for="unauthenticated_last_name">Unauthenticated last name:</label> >+ [% request.extended_attributes.find({'type'=>'unauthenticated_last_name'}).value | html %] >+ </li> >+ <li> >+ <label for="unauthenticated_email">Unauthenticated email:</label> >+ [% request.extended_attributes.find({'type'=>'unauthenticated_email'}).value | html %] >+ </li> > <li> > <label for="notesopac">Notes:</label> > [% request.notesopac | html %] >-- >2.49.0
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 36197
:
171358
|
171359
|
171360
|
171361
|
171362
|
171363
|
171364
|
171365
|
171366
|
171367
|
171368
|
171369
|
171370
|
171371
|
174495
|
174496
|
174497
|
174498
|
174499
|
174500
|
174501
|
174502
|
174503
|
174504
|
174505
|
174506
|
174507
|
174508
|
176564
|
176565
|
176680
|
176723
|
176724
|
176726
|
176727
|
179764
|
179765
|
179766
|
179767
|
179769
|
179770
|
179771
|
179772
|
179773
|
179774
|
179775
|
179776
|
179777
|
179778
|
179779
|
179780
|
179781
|
179782
|
179783
|
179784
|
179785
|
180850
|
180851
|
180852
|
180853
|
180854
|
180855
|
180856
|
180857
|
180858
|
180859
|
180860
|
180861
|
180862
|
180863
|
180864
|
180865
|
180866
|
180867
|
180868
|
180869
|
180870
|
180871
|
180872
|
180873
|
181073
|
181074
|
181075
|
181076
|
181077
|
181078
|
181079
|
181080
|
181081
|
181082
|
181083
|
181084
|
181085
|
181086
|
181087
|
181088
|
181089
|
181090
|
181091
|
181092
|
181093
| 181094 |
181095
|
181096
|
181097
|
181098
|
181592