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 89-96 Link Here
89
                                    <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span>
89
                                    <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span>
90
                                </span>
90
                                </span>
91
                                <span class="hint">
91
                                <span class="hint">
92
                                    [% SET g = Koha.Find('Borrower',borrower.guarantorid) %]
92
                                    Your guarantor is <i>[% guarantor.firstname %] [% guarantor.surname %]</i>
93
                                    Your guarantor is <i>[% g.firstname %] [% g.surname %]</i>
94
                                </span>
93
                                </span>
95
                            </li>
94
                            </li>
96
                        </ol>
95
                        </ol>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt (-3 / +2 lines)
Lines 69-76 Link Here
69
                                        </select>
69
                                        </select>
70
                                    </div>
70
                                    </div>
71
71
72
                                    [% SET b = Koha.Find('Borrower', borrower.borrowernumber) %]
72
                                    [% IF borrower.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
73
                                    [% IF b.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
74
                                        <div>
73
                                        <div>
75
                                            <label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label>
74
                                            <label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label>
76
                                            <select name="privacy_guarantor_checkouts">
75
                                            <select name="privacy_guarantor_checkouts">
Lines 83-89 Link Here
83
                                                [% END %]
82
                                                [% END %]
84
                                            </select>
83
                                            </select>
85
                                            <span class="hint">
84
                                            <span class="hint">
86
                                                Your guarantor is <i>[% b.guarantor.firstname %] [% b.guarantor.surname %]</i>
85
                                                Your guarantor is <i>[% borrower.guarantor.firstname %] [% borrower.guarantor.surname %]</i>
87
                                            </span>
86
                                            </span>
88
                                        </div>
87
                                        </div>
89
                                    [% END %]
88
                                    [% END %]
(-)a/opac/opac-memberentry.pl (-1 / +4 lines)
Lines 25-30 use C4::Auth; Link Here
25
use C4::Output;
25
use C4::Output;
26
use C4::Members;
26
use C4::Members;
27
use C4::Form::MessagingPreferences;
27
use C4::Form::MessagingPreferences;
28
use Koha::Borrowers;
28
use Koha::Borrower::Modifications;
29
use Koha::Borrower::Modifications;
29
use C4::Branch qw(GetBranchesLoop);
30
use C4::Branch qw(GetBranchesLoop);
30
use C4::Scrubber;
31
use C4::Scrubber;
Lines 225-231 elsif ( $action eq 'edit' ) { #Display logged in borrower's data Link Here
225
    }
226
    }
226
227
227
    $template->param(
228
    $template->param(
228
        borrower => $borrower, );
229
        borrower  => $borrower,
230
        guarantor => Koha::Borrowers->find($borrowernumber)->guarantor(),
231
    );
229
232
230
    if (C4::Context->preference('OPACpatronimages')) {
233
    if (C4::Context->preference('OPACpatronimages')) {
231
        my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber});
234
        my ($image, $dberror) = GetPatronImage($borrower->{borrowernumber});
(-)a/opac/opac-privacy.pl (-8 / +8 lines)
Lines 24-29 use C4::Context; Link Here
24
use C4::Circulation;
24
use C4::Circulation;
25
use C4::Members;
25
use C4::Members;
26
use C4::Output;
26
use C4::Output;
27
use Koha::Borrowers;
27
28
28
my $query = new CGI;
29
my $query = new CGI;
29
30
Lines 74-88 elsif ( $op eq "delete_record" ) { Link Here
74
}
75
}
75
76
76
# get borrower privacy ....
77
# get borrower privacy ....
77
my $borrower = C4::Members::GetMember( borrowernumber => $borrowernumber );
78
my $borrower = Koha::Borrowers->find( $borrowernumber );;
78
79
79
$template->param(
80
$template->param(
80
    'Ask_data'                         => 1,
81
    'Ask_data'                       => 1,
81
    'privacy' . $borrower->{'privacy'} => 1,
82
    'privacy' . $borrower->privacy() => 1,
82
    'privacyview'                      => 1,
83
    'privacyview'                    => 1,
83
    'borrower'                         => $borrower,
84
    'borrower'                       => $borrower,
84
    'surname'                          => $borrower->{surname},
85
    'surname'                        => $borrower->surname,
85
    'firstname'                        => $borrower->{firstname},
86
    'firstname'                      => $borrower->firstname,
86
);
87
);
87
88
88
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
89
output_html_with_http_headers $query, $cookie, $template->output, undef, { force_no_caching => 1 };
89
- 

Return to bug 9303