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

(-)a/Koha/Exceptions/Patron/Relationship.pm (-1 / +4 lines)
Lines 32-38 use Exception::Class ( Link Here
32
    'Koha::Exceptions::Patron::Relationship::InvalidRelationship' => {
32
    'Koha::Exceptions::Patron::Relationship::InvalidRelationship' => {
33
        isa         => 'Koha::Exceptions::Patron::Relationship',
33
        isa         => 'Koha::Exceptions::Patron::Relationship',
34
        description => 'The specified relationship is invalid',
34
        description => 'The specified relationship is invalid',
35
        fields => [ 'relationship', 'no_relationship', 'invalid_guarantor', 'child_guarantor', 'guarantor_cant_have_guarantors', 'guarantor' ],
35
        fields      => [
36
            'relationship', 'no_relationship', 'invalid_guarantor', 'child_guarantor',
37
            'guarantor_cant_have_guarantors', 'guarantor'
38
        ],
36
    },
39
    },
37
    'Koha::Exceptions::Patron::Relationship::NoGuarantor' => {
40
    'Koha::Exceptions::Patron::Relationship::NoGuarantor' => {
38
        isa         => 'Koha::Exceptions::Patron::Relationship',
41
        isa         => 'Koha::Exceptions::Patron::Relationship',
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (-3 / +6 lines)
Lines 196-204 Link Here
196
                                [% END %]
196
                                [% END %]
197
                                [% IF ( ERROR_guarantor_is_guarantee ) %]
197
                                [% IF ( ERROR_guarantor_is_guarantee ) %]
198
                                    <li id="ERROR_guarantor_is_guarantee">
198
                                    <li id="ERROR_guarantor_is_guarantee">
199
                                        Cannot add a guarantor. The proposed guarantor <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor_is_guarantee.borrowernumber | uri %]" target="blank">
199
                                        Cannot add a guarantor. The proposed guarantor
200
                                        [% guarantor_is_guarantee.firstname | html %] [% guarantor_is_guarantee.surname | html %] ([% guarantor_is_guarantee.cardnumber | html %])
200
                                        <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor_is_guarantee.borrowernumber | uri %]" target="blank">
201
                                        </a> is a guarantee of someone else, and guarantees cannot be guarantors.</li>
201
                                            [% guarantor_is_guarantee.firstname | html %] [% guarantor_is_guarantee.surname | html %] ([% guarantor_is_guarantee.cardnumber | html %])
202
                                        </a>
203
                                        is a guarantee of someone else, and guarantees cannot be guarantors.</li
204
                                    >
202
                                [% END %]
205
                                [% END %]
203
                                [% IF ( ERROR_guarantor_cant_have_guarantors ) %]
206
                                [% IF ( ERROR_guarantor_cant_have_guarantors ) %]
204
                                    <li id="ERROR_guarantor_cant_have_guarantors">Cannot add a guarantor. This patron is already a guarantor, and guarantors cannot have guarantors.</li>
207
                                    <li id="ERROR_guarantor_cant_have_guarantors">Cannot add a guarantor. This patron is already a guarantor, and guarantors cannot have guarantors.</li>
(-)a/members/memberentry.pl (-3 / +4 lines)
Lines 23-29 use Modern::Perl; Link Here
23
use Try::Tiny;
23
use Try::Tiny;
24
24
25
# external modules
25
# external modules
26
use CGI qw ( -utf8 );
26
use CGI          qw ( -utf8 );
27
use Scalar::Util qw( blessed );
27
use Scalar::Util qw( blessed );
28
28
29
# internal modules
29
# internal modules
Lines 53-60 use Koha::SMS::Providers; Link Here
53
my $input = CGI->new;
53
my $input = CGI->new;
54
my %data;
54
my %data;
55
55
56
my $dbh = C4::Context->dbh;
56
my $dbh    = C4::Context->dbh;
57
my $logger = Koha::Logger->get({ interface => 'intranet '});
57
my $logger = Koha::Logger->get( { interface => 'intranet ' } );
58
58
59
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
59
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
60
    {
60
    {
Lines 298-303 if ( ( $op eq 'cud-save' || $op eq 'cud-insert' ) && $guarantors_to_be_validated Link Here
298
            if ( $patron->categorycode eq $categorycode ) {
298
            if ( $patron->categorycode eq $categorycode ) {
299
                $patron->can_be_guaranteed_by($guarantors_to_be_validated);
299
                $patron->can_be_guaranteed_by($guarantors_to_be_validated);
300
            } else {
300
            } else {
301
301
                # If $patron's categorycode is about to change, check guarantor requirements against
302
                # If $patron's categorycode is about to change, check guarantor requirements against
302
                # the new category but keep the original $patron object intact
303
                # the new category but keep the original $patron object intact
303
                # (this clone()s the $patron)
304
                # (this clone()s the $patron)
(-)a/t/db_dependent/Koha/Patron.t (-3 / +2 lines)
Lines 2687-2694 subtest 'can_be_guaranteed_by() tests' => sub { Link Here
2687
        'Exception thrown when child patron is added as guarantor.';
2687
        'Exception thrown when child patron is added as guarantor.';
2688
2688
2689
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
2689
    t::lib::Mocks::mock_preference( 'borrowerRelationship', 'parent' );
2690
    $child2->add_guarantor({ guarantor_id => $patron->id, relationship => 'parent' });
2690
    $child2->add_guarantor( { guarantor_id => $patron->id, relationship => 'parent' } );
2691
    @guarantors = ( $patron2 );
2691
    @guarantors = ($patron2);
2692
    throws_ok { $patron->can_be_guaranteed_by( \@guarantors ); }
2692
    throws_ok { $patron->can_be_guaranteed_by( \@guarantors ); }
2693
    'Koha::Exceptions::Patron::Relationship::InvalidRelationship',
2693
    'Koha::Exceptions::Patron::Relationship::InvalidRelationship',
2694
        'Exception thrown when trying to add a guarantor to a guarantor.';
2694
        'Exception thrown when trying to add a guarantor to a guarantor.';
2695
- 

Return to bug 39014