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

(-)a/C4/Members.pm (-26 lines)
Lines 110-116 BEGIN { Link Here
110
    push @EXPORT, qw(
110
    push @EXPORT, qw(
111
        &ModMember
111
        &ModMember
112
        &changepassword
112
        &changepassword
113
         &ModPrivacy
114
    );
113
    );
115
114
116
    #Delete data
115
    #Delete data
Lines 2180-2210 sub GetBorrowersNamesAndLatestIssue { Link Here
2180
    return $results;
2179
    return $results;
2181
}
2180
}
2182
2181
2183
=head2 ModPrivacy
2184
2185
=over 4
2186
2187
my $success = ModPrivacy( $borrowernumber, $privacy );
2188
2189
Update the privacy of a patron.
2190
2191
return :
2192
true on success, false on failure
2193
2194
=back
2195
2196
=cut
2197
2198
sub ModPrivacy {
2199
    my $borrowernumber = shift;
2200
    my $privacy = shift;
2201
    return unless defined $borrowernumber;
2202
    return unless $borrowernumber =~ /^\d+$/;
2203
2204
    return ModMember( borrowernumber => $borrowernumber,
2205
                      privacy        => $privacy );
2206
}
2207
2208
=head2 AddMessage
2182
=head2 AddMessage
2209
2183
2210
  AddMessage( $borrowernumber, $message_type, $message, $branchcode );
2184
  AddMessage( $borrowernumber, $message_type, $message, $branchcode );
(-)a/C4/Reserves.pm (+1 lines)
Lines 260-265 sub GetReserve { Link Here
260
    my ($reserve_id) = @_;
260
    my ($reserve_id) = @_;
261
261
262
    my $dbh = C4::Context->dbh;
262
    my $dbh = C4::Context->dbh;
263
263
    my $query = "SELECT * FROM reserves WHERE reserve_id = ?";
264
    my $query = "SELECT * FROM reserves WHERE reserve_id = ?";
264
    my $sth = $dbh->prepare( $query );
265
    my $sth = $dbh->prepare( $query );
265
    $sth->execute( $reserve_id );
266
    $sth->execute( $reserve_id );
(-)a/Koha/Template/Plugin/Koha.pm (+15 lines)
Lines 22-27 use Modern::Perl; Link Here
22
use base qw( Template::Plugin );
22
use base qw( Template::Plugin );
23
23
24
use C4::Context;
24
use C4::Context;
25
use Koha::Database;
25
26
26
=pod
27
=pod
27
28
Lines 44-47 sub Preference { Link Here
44
    return C4::Context->preference( $pref );
45
    return C4::Context->preference( $pref );
45
}
46
}
46
47
48
sub Find {
49
    my ( $self, $rs, $id ) = @_;
50
51
    return unless ( $rs && $id );
52
53
    my $resultset = Koha::Database->new()->schema()->resultset($rs);
54
55
    return unless $resultset;
56
57
    my $row = $resultset->find($id);
58
59
    return $row;
60
}
61
47
1;
62
1;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/opac.pref (+7 lines)
Lines 588-593 OPAC: Link Here
588
                  no: "Don't allow"
588
                  no: "Don't allow"
589
            - patrons to choose their own privacy settings for their reading history.  This requires opacreadinghistory and AnonymousPatron
589
            - patrons to choose their own privacy settings for their reading history.  This requires opacreadinghistory and AnonymousPatron
590
        -
590
        -
591
            - pref: AllowPatronToSetCheckoutsVisibilityForGuarantor
592
              default: 0
593
              choices:
594
                  yes: Allow
595
                  no: "Don't allow"
596
            - patrons to choose their own privacy settings for showing the patron's checkouts to the patron's guarantor".
597
        -
591
            - Use borrowernumber
598
            - Use borrowernumber
592
            - pref: AnonymousPatron
599
            - pref: AnonymousPatron
593
              class: integer
600
              class: integer
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref (+6 lines)
Lines 134-139 Patrons: Link Here
134
               no: "Don't"
134
               no: "Don't"
135
         - enable the ability to upload and attach arbitrary files to a borrower record.
135
         - enable the ability to upload and attach arbitrary files to a borrower record.
136
     -
136
     -
137
         - pref: AllowStaffToSetCheckoutsVisibilityForGuarantor
138
           choices:
139
               yes: Allow
140
               no: "Don't allow"
141
         - staff to set the ability for a patron's checkouts to be viewed by linked patrons in the OPAC.
142
     -
137
         - Card numbers for patrons must be
143
         - Card numbers for patrons must be
138
         - pref: CardnumberLength
144
         - pref: CardnumberLength
139
         - "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')."
145
         - "characters long. The length can be a single number to specify an exact length, a range separated by a comma (i.e., 'Min,Max'), or a maximum with no minimum (i.e., ',Max')."
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt (+16 lines)
Lines 1-5 Link Here
1
[% IF ( opduplicate ) %][% SET focusAction = "clearDupe" %][% END %]
1
[% IF ( opduplicate ) %][% SET focusAction = "clearDupe" %][% END %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE Koha %]
3
[% INCLUDE 'doc-head-open.inc' %]
4
[% INCLUDE 'doc-head-open.inc' %]
4
<title>Koha &rsaquo; Patrons &rsaquo; 
5
<title>Koha &rsaquo; Patrons &rsaquo; 
5
[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] [% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %][% UNLESS ( opadd ) %] [% surname %], [% firstname %][% END %]</title>
6
[% IF ( opadd ) %]Add[% ELSIF ( opduplicate ) %]Duplicate[% ELSE %] Modify[% END %] [% IF ( categoryname ) %] [% categoryname %] patron[% ELSE %][% IF ( I ) %] Organization patron[% END %][% IF ( A ) %] Adult patron[% END %][% IF ( C ) %] Child patron[% END %][% IF ( P ) %] Professional patron[% END %][% IF ( S ) %] Staff patron[% END %][% END %][% UNLESS ( opadd ) %] [% surname %], [% firstname %][% END %]</title>
Lines 1170-1175 Link Here
1170
			[% END %]
1171
			[% END %]
1171
	  [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
1172
	  [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
1172
		</li>
1173
		</li>
1174
        [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
1175
            <li>
1176
                <label for="privacy_guarantor_checkouts">Show checkouts to guarantor</label>
1177
                <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
1178
                    [% IF privacy_guarantor_checkouts %]
1179
                        <option value="0">No</option>
1180
                        <option value="1" selected>Yes</option>
1181
                    [% ELSE %]
1182
                        <option value="0" selected>No</option>
1183
                        <option value="1">Yes</option>
1184
                    [% END %]
1185
                </select>
1186
                <div class="hint">Allow guarantor of this patron to view this patron's checkouts from the OPAC</div>
1187
            </li>
1188
        [% END %]
1173
		</ol>
1189
		</ol>
1174
		</fieldset>
1190
		</fieldset>
1175
        [% END # hide fieldset %][% END %]
1191
        [% END # hide fieldset %][% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (+10 lines)
Lines 338-343 function validate1(date) { Link Here
338
         [% IF ( privacy1 ) %]Default[% END %]
338
         [% IF ( privacy1 ) %]Default[% END %]
339
         [% IF ( privacy2 ) %]Never[% END %]
339
         [% IF ( privacy2 ) %]Never[% END %]
340
    </li>[% END %]
340
    </li>[% END %]
341
342
    <li>
343
        <span class="label">Show checkouts to guarantor</span>
344
        [% IF privacy_guarantor_checkouts %]
345
            Yes
346
        [% ELSE %]
347
            No
348
        [% END %]
349
    </li>
350
341
    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% lib1 %]</li>[% END %]
351
    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% lib1 %]</li>[% END %]
342
    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% lib2 %]</li>[% END %]
352
    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% lib2 %]</li>[% END %]
343
    <li><span class="label">Username: </span>[% userid %]</li>
353
    <li><span class="label">Username: </span>[% userid %]</li>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-memberentry.tt (+43 lines)
Lines 54-59 Link Here
54
                    <div class="alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
54
                    <div class="alert">You typed in the wrong characters in the box before submitting. Please try again.</div>
55
                [% END %]
55
                [% END %]
56
56
57
                [% IF borrower.guarantorid && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
58
                    <fieldset class="rows" id="memberentry_privacy">
59
                        <legend id="privacy_legend">Privacy</legend>
60
                        <ol>
61
                            <li>
62
                                <label>Allow your guarantor to view your current checkouts?</label>
63
                                <select id="privacy_guarantor_checkouts">
64
                                    <option value="0">No</option>
65
                                    [% IF borrower.privacy_guarantor_checkouts %]
66
                                        <option value="1" selected="selected">Yes</option>
67
                                    [% ELSE %]
68
                                        <option value="1">Yes</option>
69
                                    [% END %]
70
                                </select>
71
                                <span class="hint">
72
                                    <a id="update_privacy_guarantor_checkouts" href="#" class="btn">Update</a>
73
                                    <span id="update_privacy_guarantor_checkouts_message" class="alert" style="display:none"></span>
74
                                </span>
75
                                <span class="hint">
76
                                    [% SET g = Koha.Find('Borrower',borrower.guarantorid) %]
77
                                    Your guarantor is <i>[% g.firstname %] [% g.surname %]</i>
78
                                </span>
79
                            </li>
80
                        </ol>
81
                    </fieldset>
82
                [% END %]
83
57
                <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form">
84
                <form method="post" action="/cgi-bin/koha/opac-memberentry.pl" id="memberentry-form">
58
85
59
                [% UNLESS hidden.defined('branchcode') %]
86
                [% UNLESS hidden.defined('branchcode') %]
Lines 777-782 Link Here
777
            [% ELSE %]
804
            [% ELSE %]
778
                $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
805
                $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
779
            [% END %]
806
            [% END %]
807
808
            [% IF borrower.guarantorid && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
809
                $('#update_privacy_guarantor_checkouts').click( function() {
810
                    $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_guarantor_checkouts: $('#privacy_guarantor_checkouts').val() })
811
                     .done(function( data ) {
812
                         var message;
813
                         if ( data.success ) {
814
                             message = _("Your setting has been updated!");
815
                         } else {
816
                             message = _("Unable to update your setting!");
817
                         }
818
819
                         $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow");
820
                     });
821
                });
822
            [% END %]
780
        });
823
        });
781
    //]]>
824
    //]]>
782
    </script>
825
    </script>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-privacy.tt (-2 / +22 lines)
Lines 48-54 Link Here
48
                                <input type="hidden" name="op" value="update_privacy" />
48
                                <input type="hidden" name="op" value="update_privacy" />
49
                                    <fieldset>
49
                                    <fieldset>
50
                                    <label for="privacy">Please choose your privacy rule:</label>
50
                                    <label for="privacy">Please choose your privacy rule:</label>
51
                                    <div class="input-append">
51
                                    <div>
52
                                        <select name="privacy" id="privacy">
52
                                        <select name="privacy" id="privacy">
53
                                            [% IF ( privacy0 ) %]
53
                                            [% IF ( privacy0 ) %]
54
                                                <option value="0" selected="selected" class="privacy0">Forever</option>
54
                                                <option value="0" selected="selected" class="privacy0">Forever</option>
Lines 66-73 Link Here
66
                                                <option value="2" class="privacy2">Never</option>
66
                                                <option value="2" class="privacy2">Never</option>
67
                                            [% END %]
67
                                            [% END %]
68
                                        </select>
68
                                        </select>
69
                                        <button type="Submit" class="btn">Submit</button>
70
                                    </div>
69
                                    </div>
70
71
                                    [% SET b = Koha.Find('Borrower', borrower.borrowernumber) %]
72
                                    [% IF b.guarantorid && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
73
                                        <div>
74
                                            <label for="privacy_guarantor_checkouts">Allow your guarantor to view your current checkouts?</label>
75
                                            <select name="privacy_guarantor_checkouts">
76
                                                [% IF borrower.privacy_guarantor_checkouts %]
77
                                                    <option value="0">No</option>
78
                                                    <option value="1" selected>Yes</option>
79
                                                [% ELSE %]
80
                                                    <option value="0" selected>No</option>
81
                                                    <option value="1">Yes</option>
82
                                                [% END %]
83
                                            </select>
84
                                            <span class="hint">
85
                                                Your guarantor is <i>[% b.guarantor.firstname %] [% b.guarantor.surname %]</i>
86
                                            </span>
87
                                        </div>
88
                                    [% END %]
89
90
                                    <button type="Submit" class="btn">Save</button>
71
                                </fieldset>
91
                                </fieldset>
72
                            </form>
92
                            </form>
73
                        <h2>Immediate deletion</h2>
93
                        <h2>Immediate deletion</h2>
(-)a/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-user.tt (-3 / +51 lines)
Lines 1-5 Link Here
1
[% USE Koha %]
1
[% USE Koha %]
2
[% USE KohaDates %]
2
[% USE KohaDates %]
3
[% USE EncodeUTF8 %]
3
4
4
[% INCLUDE 'doc-head-open.inc' %]
5
[% INCLUDE 'doc-head-open.inc' %]
5
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home
6
[% IF ( LibraryNameTitle ) %][% LibraryNameTitle %][% ELSE %]Koha online[% END %] catalog &rsaquo; Your library home
Lines 104-109 Link Here
104
                    <div id="opac-user-views" class="toptabs">
105
                    <div id="opac-user-views" class="toptabs">
105
                        <ul>
106
                        <ul>
106
                            <li><a href="#opac-user-checkouts">Checked out ([% issues_count %])</a></li>
107
                            <li><a href="#opac-user-checkouts">Checked out ([% issues_count %])</a></li>
108
                            [% IF relatives %]<li><a href="#opac-user-relative-issues">Relatives' checkouts</a></li>[% END %]
107
                            [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count %])</a></li>[% END %]
109
                            [% IF ( overdues_count ) %]<li><a href="#opac-user-overdues">Overdue ([% overdues_count %])</a></li>[% END %]
108
                            [% IF ( OPACFinesTab ) %]
110
                            [% IF ( OPACFinesTab ) %]
109
                                [% IF ( BORROWER_INF.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INF.amountoutstanding %])</a></li>[% END %]
111
                                [% IF ( BORROWER_INF.amountoverfive ) %]<li><a href="#opac-user-fines">Fines ([% BORROWER_INF.amountoutstanding %])</a></li>[% END %]
Lines 132-138 Link Here
132
                                                [% IF ( show_barcode ) %]
134
                                                [% IF ( show_barcode ) %]
133
                                                    <th>Barcode</th>
135
                                                    <th>Barcode</th>
134
                                                [% END %]
136
                                                [% END %]
135
                                                    <th>Call No.</th>
137
                                                    <th>Call number</th>
136
                                                [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
138
                                                [% IF ( OpacRenewalAllowed && !( borrower.is_expired && borrower.BlockExpiredPatronOpacActions ) ) %]
137
                                                    <th class="nosort">Renew</th>
139
                                                    <th class="nosort">Renew</th>
138
                                                [% END %]
140
                                                [% END %]
Lines 361-366 Link Here
361
                            </div> <!-- /#opac-user-waiting -->
363
                            </div> <!-- /#opac-user-waiting -->
362
                        [% END # waiting_count && atdestination %]
364
                        [% END # waiting_count && atdestination %]
363
365
366
                        [% IF relatives %]
367
                            <div id="opac-user-relative-issues">
368
                                <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
369
                                    <thead>
370
                                        <tr>
371
                                            <th class="anti-the">Title</th>
372
                                            <th>Due</th>
373
                                            <th>Barcode</th>
374
                                            <th>Call number</th>
375
                                            <th class="psort">Relative</th>
376
                                        </tr>
377
                                    </thead>
378
379
                                    <tbody>
380
                                        [% FOREACH r IN relatives %]
381
                                            [% FOREACH i IN r.issues %]
382
                                                <tr>
383
                                                    <td>
384
                                                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% i.item.biblio.biblionumber %]">
385
                                                            [% i.item.biblio.title | $EncodeUTF8 %]
386
                                                        </a>
387
                                                    </td>
388
389
                                                    <td>
390
                                                        [% i.date_due | $KohaDates %]
391
                                                    </td>
392
393
                                                    <td>
394
                                                        [% i.item.barcode %]
395
                                                    </td>
396
397
                                                    <td>
398
                                                        [% i.item.itemcallnumber | $EncodeUTF8 %]
399
                                                    </td>
400
401
                                                    <td>
402
                                                        [% r.firstname | $EncodeUTF8 %] [% r.surname | $EncodeUTF8 %]
403
                                                    </td>
404
                                                </tr>
405
                                            [% END %]
406
                                        [% END %]
407
                                    </tbody>
408
                                </table>
409
                            </div>
410
                        [% END %]
364
411
365
                        [% IF ( overdues_count ) %]
412
                        [% IF ( overdues_count ) %]
366
                            <div id="opac-user-overdues">
413
                            <div id="opac-user-overdues">
Lines 373-379 Link Here
373
                                            <th class="anti-the">Title</th>
420
                                            <th class="anti-the">Title</th>
374
                                            [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
421
                                            [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
375
                                            [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
422
                                            [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
376
                                            <th>Call no.</th>
423
                                            <th>Call number</th>
377
                                            <th class="title-string psort">Due</th>
424
                                            <th class="title-string psort">Due</th>
378
                                            [% IF ( OpacRenewalAllowed ) %]
425
                                            [% IF ( OpacRenewalAllowed ) %]
379
                                                <th class="nosort">Renew</th>
426
                                                <th class="nosort">Renew</th>
Lines 682-688 Link Here
682
            $(".js-hide").hide();
729
            $(".js-hide").hide();
683
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
730
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
684
            $(".suspend-until").prop("readonly",1);
731
            $(".suspend-until").prop("readonly",1);
685
            var dTables = $("#checkoutst,#holdst,#overduest");
732
733
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
686
            dTables.each(function(){
734
            dTables.each(function(){
687
                var thIndex = $(this).find("th.psort").index();
735
                var thIndex = $(this).find("th.psort").index();
688
                $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
736
                $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
(-)a/members/moremember.pl (+1 lines)
Lines 362-367 $template->param( Link Here
362
    is_child        => ($category_type eq 'C'),
362
    is_child        => ($category_type eq 'C'),
363
    samebranch     => $samebranch,
363
    samebranch     => $samebranch,
364
    quickslip		  => $quickslip,
364
    quickslip		  => $quickslip,
365
    privacy_guarantor_checkouts => $data->{'privacy_guarantor_checkouts'},
365
    activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
366
    activeBorrowerRelationship => (C4::Context->preference('borrowerRelationship') ne ''),
366
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
367
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
367
    SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
368
    SuspendHoldsIntranet => C4::Context->preference('SuspendHoldsIntranet'),
(-)a/opac/opac-privacy.pl (-14 / +24 lines)
Lines 40-57 my ( $template, $borrowernumber, $cookie ) = get_template_and_user( Link Here
40
    }
40
    }
41
);
41
);
42
42
43
my $op = $query->param("op");
43
my $op                         = $query->param("op");
44
my $privacy = $query->param("privacy");
44
my $privacy                    = $query->param("privacy");
45
my $privacy_guarantor_checkouts = $query->param("privacy_guarantor_checkouts");
45
46
46
if ($op eq "update_privacy")
47
if ( $op eq "update_privacy" ) {
47
{
48
    ModMember(
48
    ModPrivacy($borrowernumber,$privacy);
49
        borrowernumber             => $borrowernumber,
49
    $template->param('privacy_updated' => 1);
50
        privacy                    => $privacy,
51
        privacy_guarantor_checkouts => $privacy_guarantor_checkouts,
52
    );
53
    $template->param( 'privacy_updated' => 1 );
50
}
54
}
51
if ($op eq "delete_record") {
55
elsif ( $op eq "delete_record" ) {
56
52
    # delete all reading records for items returned
57
    # delete all reading records for items returned
53
    # uses a hardcoded date ridiculously far in the future
58
    # uses a hardcoded date ridiculously far in the future
54
    my ($rows,$err_history_not_deleted) = AnonymiseIssueHistory('2999-12-12',$borrowernumber);
59
    my ( $rows, $err_history_not_deleted ) =
60
      AnonymiseIssueHistory( '2999-12-12', $borrowernumber );
61
55
    # confirm the user the deletion has been done
62
    # confirm the user the deletion has been done
56
    if ( !$err_history_not_deleted ) {
63
    if ( !$err_history_not_deleted ) {
57
        $template->param( 'deleted' => 1 );
64
        $template->param( 'deleted' => 1 );
Lines 60-73 if ($op eq "delete_record") { Link Here
60
        $template->param( 'err_history_not_deleted' => 1 );
67
        $template->param( 'err_history_not_deleted' => 1 );
61
    }
68
    }
62
}
69
}
70
63
# get borrower privacy ....
71
# get borrower privacy ....
64
my ( $borr ) = GetMemberDetails( $borrowernumber );
72
my $borrower = GetMemberDetails( $borrowernumber );
65
73
66
$template->param( 'Ask_data'       => '1',
74
$template->param(
67
                    'privacy'.$borr->{'privacy'} => 1,
75
    'Ask_data'                         => 1,
68
                    'firstname' => $borr->{'firstname'},
76
    'privacy' . $borrower->{'privacy'} => 1,
69
                    'surname' => $borr->{'surname'},
77
    'privacyview'                      => 1,
70
                    'privacyview' => 1,
78
    'borrower'                         => $borrower,
79
    'surname'                          => $borrower->{surname},
80
    'firstname'                        => $borrower->{firstname},
71
);
81
);
72
82
73
output_html_with_http_headers $query, $cookie, $template->output;
83
output_html_with_http_headers $query, $cookie, $template->output;
(-)a/opac/opac-user.pl (-10 / +23 lines)
Lines 35-40 use C4::Items; Link Here
35
use C4::Letters;
35
use C4::Letters;
36
use C4::Branch; # GetBranches
36
use C4::Branch; # GetBranches
37
use Koha::DateUtils;
37
use Koha::DateUtils;
38
use Koha::Database;
38
39
39
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
40
use constant ATTRIBUTE_SHOW_BARCODE => 'SHOW_BCODE';
40
41
Lines 373-390 if ( $borr->{'opacnote'} ) { Link Here
373
  );
374
  );
374
}
375
}
375
376
377
if (   C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor')
378
    || C4::Context->preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') )
379
{
380
    my @relatives =
381
      Koha::Database->new()->schema()->resultset("Borrower")->search(
382
        {
383
            privacy_guarantor_checkouts => 1,
384
            'me.guarantorid'           => $borrowernumber
385
        },
386
        { prefetch => [ { 'issues' => { 'item' => 'biblio' } } ] }
387
      );
388
    $template->param( relatives => \@relatives );
389
}
390
376
$template->param(
391
$template->param(
377
    bor_messages_loop    => GetMessages( $borrowernumber, 'B', 'NONE' ),
392
    borrower           => $borr,
393
    bor_messages_loop  => GetMessages( $borrowernumber, 'B', 'NONE' ),
378
    waiting_count      => $wcount,
394
    waiting_count      => $wcount,
379
    patronupdate => $patronupdate,
395
    patronupdate       => $patronupdate,
380
    OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"),
396
    OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"),
381
    userview => 1,
397
    userview           => 1,
382
);
398
    SuspendHoldsOpac   => C4::Context->preference('SuspendHoldsOpac'),
383
399
    OpacHoldNotes      => C4::Context->preference('OpacHoldNotes'),
384
$template->param(
400
    AutoResumeSuspendedHolds =>
385
    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
401
      C4::Context->preference('AutoResumeSuspendedHolds'),
386
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
387
    OpacHoldNotes => C4::Context->preference('OpacHoldNotes'),
388
);
402
);
389
403
390
output_html_with_http_headers $query, $cookie, $template->output;
404
output_html_with_http_headers $query, $cookie, $template->output;
391
- 

Return to bug 9303