View | Details | Raw Unified | Return to bug 36197
Collapse All | Expand All

(-)a/Koha/ILL/Backend/Standard.pm (-4 / +7 lines)
Lines 146-154 that we do not consider to be metadata Link Here
146
146
147
sub metadata {
147
sub metadata {
148
    my ( $self, $request ) = @_;
148
    my ( $self, $request ) = @_;
149
    my $attrs       = $request->extended_attributes;
149
    my $attrs    = $request->extended_attributes;
150
    my $metadata    = {};
150
    my $metadata = {};
151
    my @ignore      = ( 'requested_partners', 'type', 'type_disclaimer_value', 'type_disclaimer_date' );
151
    my @ignore   = (
152
        'requested_partners', 'type', 'type_disclaimer_value', 'type_disclaimer_date', 'unauthenticated_first_name',
153
        'unauthenticated_last_name', 'unauthenticated_email'
154
    );
152
    my $core_fields = _get_core_fields();
155
    my $core_fields = _get_core_fields();
153
    while ( my $attr = $attrs->next ) {
156
    while ( my $attr = $attrs->next ) {
154
        my $type = $attr->type;
157
        my $type = $attr->type;
Lines 1016-1022 sub add_request { Link Here
1016
        }
1019
        }
1017
    } keys %{$request_details};
1020
    } keys %{$request_details};
1018
    $request->extended_attributes( \@request_details_array );
1021
    $request->extended_attributes( \@request_details_array );
1019
    $request->append_unauthenticated_notes( $params->{other} ) if $unauthenticated_request;
1022
    $request->add_unauthenticated_data( $params->{other} ) if $unauthenticated_request;
1020
1023
1021
    return $request;
1024
    return $request;
1022
}
1025
}
(-)a/Koha/ILL/Request.pm (-12 / +21 lines)
Lines 34-40 use Koha::Cache::Memory::Lite; Link Here
34
use Koha::Database;
34
use Koha::Database;
35
use Koha::DateUtils qw( dt_from_string );
35
use Koha::DateUtils qw( dt_from_string );
36
use Koha::Exceptions::Ill;
36
use Koha::Exceptions::Ill;
37
use Koha::I18N qw(__ __x);
37
use Koha::I18N qw(__);
38
use Koha::ILL::Backend::Standard;
38
use Koha::ILL::Backend::Standard;
39
use Koha::ILL::Batches;
39
use Koha::ILL::Batches;
40
use Koha::ILL::Comments;
40
use Koha::ILL::Comments;
Lines 1939-1962 sub attach_processors { Link Here
1939
    }
1939
    }
1940
}
1940
}
1941
1941
1942
=head3 append_unauthenticated_notes
1942
=head3 add_unauthenticated_data
1943
1943
1944
    append_unauthenticated_notes($metadata);
1944
    add_unauthenticated_data($metadata);
1945
1945
1946
Append unauthenticated details to staff and opac notes
1946
Adds unauthenticated data as I<Koha::ILL::Request::Attributes>
1947
1947
1948
=cut
1948
=cut
1949
1949
1950
sub append_unauthenticated_notes {
1950
sub add_unauthenticated_data {
1951
    my ( $self, $metadata ) = @_;
1951
    my ( $self, $metadata ) = @_;
1952
    my $unauthenticated_notes_text = __x(
1952
1953
        "Unauthenticated request.\nFirst name: {first_name}.\nLast name: {last_name}.\nEmail: {email}.",
1953
    my $extended_attributes = $self->extended_attributes(
1954
        first_name => $metadata->{'unauthenticated_first_name'},
1954
        [
1955
        last_name  => $metadata->{'unauthenticated_last_name'},
1955
            {
1956
        email      => $metadata->{'unauthenticated_email'}
1956
                type  => 'unauthenticated_first_name',
1957
                value => $metadata->{'unauthenticated_first_name'},
1958
            },
1959
            {
1960
                type  => 'unauthenticated_last_name',
1961
                value => $metadata->{'unauthenticated_last_name'},
1962
            },
1963
            {
1964
                type  => 'unauthenticated_email',
1965
                value => $metadata->{'unauthenticated_email'},
1966
            },
1967
        ]
1957
    );
1968
    );
1958
    $self->append_to_note($unauthenticated_notes_text);
1959
    $self->notesopac($unauthenticated_notes_text)->store;
1960
}
1969
}
1961
1970
1962
=head3 unauth_request_data_check
1971
=head3 unauth_request_data_check
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/ill/ill-requests.tt (+28 lines)
Lines 663-668 Link Here
663
                            [% END %]
663
                            [% END %]
664
                        </ol>
664
                        </ol>
665
                    </div>
665
                    </div>
666
                    [% IF req_status == 'UNAUTH' %]
667
                        <div class="rows">
668
                            <h4>Unauthenticated request details</h4>
669
                            <ol>
670
                                [% unauthenticated_first_name = request.extended_attributes.find({'type'=>'unauthenticated_first_name'}).value %]
671
                                [% IF unauthenticated_first_name %]
672
                                    <li>
673
                                        <span class="label unauthenticated_first_name">First name:</span>
674
                                        [% unauthenticated_first_name | html %]
675
                                    </li>
676
                                [% END %]
677
                                [% unauthenticated_last_name = request.extended_attributes.find({'type'=>'unauthenticated_last_name'}).value %]
678
                                [% IF unauthenticated_last_name %]
679
                                    <li>
680
                                        <span class="label unauthenticated_last_name">Last name:</span>
681
                                        [% unauthenticated_last_name | html %]
682
                                    </li>
683
                                [% END %]
684
                                [% unauthenticated_email = request.extended_attributes.find({'type'=>'unauthenticated_email'}).value %]
685
                                [% IF unauthenticated_email %]
686
                                    <li>
687
                                        <span class="label unauthenticated_email">Email:</span>
688
                                        [% unauthenticated_email | html %]
689
                                    </li>
690
                                [% END %]
691
                            </ol>
692
                        </div>
693
                    [% END %]
666
                    <div class="rows">
694
                    <div class="rows">
667
                        <h4>Details from supplier ([% request.backend | html %])</h4>
695
                        <h4>Details from supplier ([% request.backend | html %])</h4>
668
                        <ol>
696
                        <ol>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-illrequests.tt (-2 / +13 lines)
Lines 253-259 Link Here
253
                                [% END %]
253
                                [% END %]
254
                            </form>
254
                            </form>
255
                        [% ELSIF op == 'unauth_view' %]
255
                        [% ELSIF op == 'unauth_view' %]
256
                            <div class="alert alert-success" role="alert">Your request has been placed. Please check your email for further instructions.</div>
256
                            <div class="alert alert-success" role="alert">Your request has been placed. We'll contact you shortly.</div>
257
                            <h1>View interlibrary loan request</h1>
257
                            <h1>View interlibrary loan request</h1>
258
                            [% INCLUDE messages %]
258
                            [% INCLUDE messages %]
259
                            [% status = request.status %]
259
                            [% status = request.status %]
Lines 295-300 Link Here
295
                                        <label for="updated">Last updated:</label>
295
                                        <label for="updated">Last updated:</label>
296
                                        [% request.updated | $KohaDates %]
296
                                        [% request.updated | $KohaDates %]
297
                                    </li>
297
                                    </li>
298
                                    <li>
299
                                        <label for="unauthenticated_first_name">Unauthenticated first name:</label>
300
                                        [% request.extended_attributes.find({'type'=>'unauthenticated_first_name'}).value | html %]
301
                                    </li>
302
                                    <li>
303
                                        <label for="unauthenticated_last_name">Unauthenticated last name:</label>
304
                                        [% request.extended_attributes.find({'type'=>'unauthenticated_last_name'}).value | html %]
305
                                    </li>
306
                                    <li>
307
                                        <label for="unauthenticated_email">Unauthenticated email:</label>
308
                                        [% request.extended_attributes.find({'type'=>'unauthenticated_email'}).value | html %]
309
                                    </li>
298
                                    <li>
310
                                    <li>
299
                                        <label for="notesopac">Notes:</label>
311
                                        <label for="notesopac">Notes:</label>
300
                                        [% request.notesopac | html %]
312
                                        [% request.notesopac | html %]
301
- 

Return to bug 36197