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

(-)a/Koha/ILL/Backend/Standard.pm (-20 / +2 lines)
Lines 24-29 use C4::Installer; Link Here
24
24
25
use Koha::DateUtils qw/ dt_from_string /;
25
use Koha::DateUtils qw/ dt_from_string /;
26
use Koha::I18N      qw(__);
26
use Koha::I18N      qw(__);
27
use Koha::ILL::Request;
27
use Koha::ILL::Requests;
28
use Koha::ILL::Requests;
28
use Koha::ILL::Request::Attribute;
29
use Koha::ILL::Request::Attribute;
29
use C4::Biblio  qw( AddBiblio );
30
use C4::Biblio  qw( AddBiblio );
Lines 292-298 sub create { Link Here
292
            C4::Context->preference("ILLOpacUnauthenticatedRequest") && !$other->{'cardnumber'};
293
            C4::Context->preference("ILLOpacUnauthenticatedRequest") && !$other->{'cardnumber'};
293
        if($unauthenticated_request){
294
        if($unauthenticated_request){
294
            ( $failed, $result ) = _validate_form_params( $other, $result, $params);
295
            ( $failed, $result ) = _validate_form_params( $other, $result, $params);
295
            if ( !_unauth_request_data_check($other) ) {
296
            if ( !Koha::ILL::Request::unauth_request_data_check($other) ) {
296
                $result->{status} = "missing_unauth_data";
297
                $result->{status} = "missing_unauth_data";
297
                $result->{value}  = $params;
298
                $result->{value}  = $params;
298
                $failed           = 1;
299
                $failed           = 1;
Lines 1225-1249 sub _set_suppression { Link Here
1225
    return 1;
1226
    return 1;
1226
}
1227
}
1227
1228
1228
=head3 _unauth_request_data_check
1229
1230
    _unauth_request_data_check($other);
1231
1232
Checks if unauthenticated request data is present
1233
1234
=cut
1235
1236
sub _unauth_request_data_check {
1237
    my ($other) = @_;
1238
1239
    return 1 unless C4::Context->preference("ILLOpacUnauthenticatedRequest");
1240
1241
    return
1242
           $other->{unauthenticated_first_name}
1243
        && $other->{unauthenticated_last_name}
1244
        && $other->{unauthenticated_email};
1245
}
1246
1247
=head3 _validate_form_params
1229
=head3 _validate_form_params
1248
1230
1249
    _validate_form_params( $other, $result, $params );
1231
    _validate_form_params( $other, $result, $params );
(-)a/Koha/ILL/Request.pm (-1 / +19 lines)
Lines 1925-1930 sub append_unauthenticated_notes { Link Here
1925
    $self->notesopac($unauthenticated_notes_text)->store;
1925
    $self->notesopac($unauthenticated_notes_text)->store;
1926
}
1926
}
1927
1927
1928
=head3 unauth_request_data_check
1929
1930
    unauth_request_data_check($metadata);
1931
1932
Checks if unauthenticated request data is present
1933
1934
=cut
1935
1936
sub unauth_request_data_check {
1937
    my ($metadata) = @_;
1938
1939
    return 1 unless C4::Context->preference("ILLOpacUnauthenticatedRequest");
1940
1941
    return
1942
           $metadata->{unauthenticated_first_name}
1943
        && $metadata->{unauthenticated_last_name}
1944
        && $metadata->{unauthenticated_email};
1945
}
1946
1928
=head3 append_to_note
1947
=head3 append_to_note
1929
1948
1930
    append_to_note("Some text");
1949
    append_to_note("Some text");
1931
- 

Return to bug 36197