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

(-)a/C4/SIP/Sip/MsgType.pm (-1 / +1 lines)
Lines 1747-1753 sub desensitize { Link Here
1747
    my $patron = $params->{patron};
1747
    my $patron = $params->{patron};
1748
    my $server = $params->{server};
1748
    my $server = $params->{server};
1749
1749
1750
    my $patron_categories = $server->{account}->{never_demagnitize};
1750
    my $patron_categories = $server->{account}->{inhouse_patron_categories};
1751
1751
1752
    # If no patron categories are set for never desensitize, no need to do anything
1752
    # If no patron categories are set for never desensitize, no need to do anything
1753
    return $desensitize unless $patron_categories;
1753
    return $desensitize unless $patron_categories;
(-)a/t/db_dependent/SIP/Message.t (-13 / +12 lines)
Lines 906-927 sub test_checkout_desensitize { Link Here
906
906
907
    undef $response;
907
    undef $response;
908
    my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
908
    my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
909
    $server->{account}->{never_demagnitize} = "A,$patron_category,Z";
909
    $server->{account}->{inhouse_patron_categories} = "A,$patron_category,Z";
910
    $msg->handle_checkout( $server );
910
    $msg->handle_checkout( $server );
911
    my $respcode = substr( $response, 5, 1 );
911
    my $respcode = substr( $response, 5, 1 );
912
    is( $respcode, 'N', "Desensitize flag was not set for patron category in never_demagnitize" );
912
    is( $respcode, 'N', "Desensitize flag was not set for patron category in inhouse_patron_categories" );
913
913
914
    undef $response;
914
    undef $response;
915
    $server->{account}->{never_demagnitize} = "A,B,C";
915
    $server->{account}->{inhouse_patron_categories} = "A,B,C";
916
    $msg->handle_checkout( $server );
916
    $msg->handle_checkout( $server );
917
    $respcode = substr( $response, 5, 1 );
917
    $respcode = substr( $response, 5, 1 );
918
    is( $respcode, 'Y', "Desensitize flag was set for patron category not in never_demagnitize" );
918
    is( $respcode, 'Y', "Desensitize flag was set for patron category not in inhouse_patron_categories" );
919
919
920
    undef $response;
920
    undef $response;
921
    $server->{account}->{never_demagnitize} = "";
921
    $server->{account}->{inhouse_patron_categories} = "";
922
    $msg->handle_checkout( $server );
922
    $msg->handle_checkout( $server );
923
    $respcode = substr( $response, 5, 1 );
923
    $respcode = substr( $response, 5, 1 );
924
    is( $respcode, 'Y', "Desensitize flag was set for empty never_demagnitize" );
924
    is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" );
925
}
925
}
926
926
927
sub test_renew_desensitize {
927
sub test_renew_desensitize {
Lines 972-993 sub test_renew_desensitize { Link Here
972
972
973
    undef $response;
973
    undef $response;
974
    my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
974
    my $msg = C4::SIP::Sip::MsgType->new( $siprequest, 0 );
975
    $server->{account}->{never_demagnitize} = "A,$patron_category,Z";
975
    $server->{account}->{inhouse_patron_categories} = "A,$patron_category,Z";
976
    $msg->handle_checkout( $server );
976
    $msg->handle_checkout( $server );
977
    my $respcode = substr( $response, 5, 1 );
977
    my $respcode = substr( $response, 5, 1 );
978
    is( $respcode, 'N', "Desensitize flag was not set for patron category in never_demagnitize" );
978
    is( $respcode, 'N', "Desensitize flag was not set for patron category in inhouse_patron_categories" );
979
979
980
    undef $response;
980
    undef $response;
981
    $server->{account}->{never_demagnitize} = "A,B,C";
981
    $server->{account}->{inhouse_patron_categories} = "A,B,C";
982
    $msg->handle_checkout( $server );
982
    $msg->handle_checkout( $server );
983
    $respcode = substr( $response, 5, 1 );
983
    $respcode = substr( $response, 5, 1 );
984
    is( $respcode, 'Y', "Desensitize flag was set for patron category not in never_demagnitize" );
984
    is( $respcode, 'Y', "Desensitize flag was set for patron category not in inhouse_patron_categories" );
985
985
986
    undef $response;
986
    undef $response;
987
    $server->{account}->{never_demagnitize} = "";
987
    $server->{account}->{inhouse_patron_categories} = "";
988
    $msg->handle_checkout( $server );
988
    $msg->handle_checkout( $server );
989
    $respcode = substr( $response, 5, 1 );
989
    $respcode = substr( $response, 5, 1 );
990
    is( $respcode, 'Y', "Desensitize flag was set for empty never_demagnitize" );
990
    is( $respcode, 'Y', "Desensitize flag was set for empty inhouse_patron_categories" );
991
}
991
}
992
992
993
# Helper routines
993
# Helper routines
994
- 

Return to bug 26370