Lines 966-977
sub add_request {
Link Here
|
966 |
|
966 |
|
967 |
my ( $self, $params ) = @_; |
967 |
my ( $self, $params ) = @_; |
968 |
|
968 |
|
|
|
969 |
my $unauthenticated_request = |
970 |
C4::Context->preference("ILLOpacUnauthenticatedRequest") && !$params->{other}->{'cardnumber'}; |
971 |
|
969 |
# ...Populate Illrequestattributes |
972 |
# ...Populate Illrequestattributes |
970 |
# generate $request_details |
973 |
# generate $request_details |
971 |
my $request_details = _get_request_details( $params, $params->{other} ); |
974 |
my $request_details = _get_request_details( $params, $params->{other} ); |
972 |
|
975 |
|
973 |
my ( $brw_count, $brw ) = |
976 |
my ( $brw_count, $brw ) = |
974 |
_validate_borrower( $params->{other}->{'cardnumber'} ); |
977 |
_validate_borrower( $params->{other}->{'cardnumber'} ) unless $unauthenticated_request; |
975 |
|
978 |
|
976 |
## Create request |
979 |
## Create request |
977 |
|
980 |
|
Lines 981-987
sub add_request {
Link Here
|
981 |
# ...Populate Illrequest |
984 |
# ...Populate Illrequest |
982 |
my $request = $params->{request}; |
985 |
my $request = $params->{request}; |
983 |
$request->biblio_id($biblionumber) unless $biblionumber == 0; |
986 |
$request->biblio_id($biblionumber) unless $biblionumber == 0; |
984 |
$request->borrowernumber( $brw->borrowernumber ); |
987 |
$request->borrowernumber( $brw ? $brw->borrowernumber : undef ); |
985 |
$request->branchcode( $params->{other}->{branchcode} ); |
988 |
$request->branchcode( $params->{other}->{branchcode} ); |
986 |
$request->status( $unauthenticated_request ? 'UNAUTH' : 'NEW'); |
989 |
$request->status( $unauthenticated_request ? 'UNAUTH' : 'NEW'); |
987 |
$request->backend( $params->{other}->{backend} ); |
990 |
$request->backend( $params->{other}->{backend} ); |
Lines 1006-1011
sub add_request {
Link Here
|
1006 |
} |
1009 |
} |
1007 |
} |
1010 |
} |
1008 |
|
1011 |
|
|
|
1012 |
if ($unauthenticated_request) { |
1013 |
my $unauthenticated_notes_text = |
1014 |
"Unauthenticated request.\nFirst name: $params->{other}->{'unauthenticated_first_name'}" |
1015 |
. ".\nLast name: $params->{other}->{'unauthenticated_last_name'}." |
1016 |
. "\nEmail: $params->{other}->{'unauthenticated_email'}."; |
1017 |
$request->append_to_note($unauthenticated_notes_text); |
1018 |
$request->notesopac($unauthenticated_notes_text)->store; |
1019 |
} |
1020 |
|
1009 |
return $request; |
1021 |
return $request; |
1010 |
} |
1022 |
} |
1011 |
|
1023 |
|
1012 |
- |
|
|