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

(-)a/Koha/Borrower.pm (+12 lines)
Lines 35-40 Koha::Borrower - Koha Borrower Object class Link Here
35
35
36
=cut
36
=cut
37
37
38
=head3 guarantor
39
40
Returns a Koha::Borrower object for this borrower's guarantor
41
42
=cut
43
44
sub guarantor {
45
    my ( $self ) = @_;
46
47
    return Koha::Borrowers->find( $self->guarantorid() );
48
}
49
38
=head3 type
50
=head3 type
39
51
40
=cut
52
=cut
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (-2 / +1 lines)
Lines 73-80 Link Here
73
                                    <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span>
73
                                    <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span>
74
                                </span>
74
                                </span>
75
                                <span class="hint">
75
                                <span class="hint">
76
                                    [% SET g = Koha.Find('Borrower',borrower.guarantorid) %]
76
                                    Your guarantor is <i>[% guarantor.firstname %] [% guarantor.surname %]</i>
77
                                    Your guarantor is <i>[% g.firstname %] [% g.surname %]</i>
78
                                </span>
77
                                </span>
79
                            </li>
78
                            </li>
80
                        </ol>
79
                        </ol>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt (-3 / +2 lines)
Lines 68-75 Link Here
68
                                        </select>
68
                                        </select>
69
                                    </div>
69
                                    </div>
70
70
71
                                    [% SET b = Koha.Find('Borrower', borrower.borrowernumber) %]
71
                                    [% IF borrower.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
72
                                    [% IF b.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
73
                                        <div>
72
                                        <div>
74
                                            <label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label>
73
                                            <label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label>
75
                                            <select name="privacy_guarantor_checkouts">
74
                                            <select name="privacy_guarantor_checkouts">
Lines 82-88 Link Here
82
                                                [% END %]
81
                                                [% END %]
83
                                            </select>
82
                                            </select>
84
                                            <span class="hint">
83
                                            <span class="hint">
85
                                                Your guarantor is <i>[% b.guarantor.firstname %] [% b.guarantor.surname %]</i>
84
                                                Your guarantor is <i>[% borrower.guarantor.firstname %] [% borrower.guarantor.surname %]</i>
86
                                            </span>
85
                                            </span>
87
                                        </div>
86
                                        </div>
88
                                    [% END %]
87
                                    [% END %]
(-)a/opac/opac-memberentry.pl (-1 / +4 lines)
Lines 24-29 use String::Random qw( random_string ); Link Here
24
use C4::Auth;
24
use C4::Auth;
25
use C4::Output;
25
use C4::Output;
26
use C4::Members;
26
use C4::Members;
27
use Koha::Borrowers;
27
use Koha::Borrower::Modifications;
28
use Koha::Borrower::Modifications;
28
use C4::Branch qw(GetBranchesLoop);
29
use C4::Branch qw(GetBranchesLoop);
29
use C4::Scrubber;
30
use C4::Scrubber;
Lines 209-215 elsif ( $action eq 'edit' ) { #Display logged in borrower's data Link Here
209
    }
210
    }
210
211
211
    $template->param(
212
    $template->param(
212
        borrower => $borrower, );
213
        borrower  => $borrower,
214
        guarantor => Koha::Borrowers->find($borrowernumber)->guarantor(),
215
    );
213
216
214
    if (C4::Context->preference('OPACpatronimages')) {
217
    if (C4::Context->preference('OPACpatronimages')) {
215
        my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber});
218
        my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber});
(-)a/opac/opac-privacy.pl (-8 / +8 lines)
Lines 25-30 use C4::Circulation; Link Here
25
use C4::Members;
25
use C4::Members;
26
use C4::Output;
26
use C4::Output;
27
use C4::Dates;
27
use C4::Dates;
28
use Koha::Borrowers;
28
29
29
my $query = new CGI;
30
my $query = new CGI;
30
31
Lines 76-90 elsif ( $op eq "delete_record" ) { Link Here
76
}
77
}
77
78
78
# get borrower privacy ....
79
# get borrower privacy ....
79
my $borrower = GetMemberDetails( $borrowernumber );
80
my $borrower = Koha::Borrowers->find( $borrowernumber );;
80
81
81
$template->param(
82
$template->param(
82
    'Ask_data'                         => 1,
83
    'Ask_data'                       => 1,
83
    'privacy' . $borrower->{'privacy'} => 1,
84
    'privacy' . $borrower->privacy() => 1,
84
    'privacyview'                      => 1,
85
    'privacyview'                    => 1,
85
    'borrower'                         => $borrower,
86
    'borrower'                       => $borrower,
86
    'surname'                          => $borrower->{surname},
87
    'surname'                        => $borrower->{surname},
87
    'firstname'                        => $borrower->{firstname},
88
    'firstname'                      => $borrower->{firstname},
88
);
89
);
89
90
90
output_html_with_http_headers $query, $cookie, $template->output;
91
output_html_with_http_headers $query, $cookie, $template->output;
91
- 

Return to bug 9303