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 2184-2214 sub GetBorrowersNamesAndLatestIssue { Link Here
2184
    return $results;
2183
    return $results;
2185
}
2184
}
2186
2185
2187
=head2 ModPrivacy
2188
2189
=over 4
2190
2191
my $success = ModPrivacy( $borrowernumber, $privacy );
2192
2193
Update the privacy of a patron.
2194
2195
return :
2196
true on success, false on failure
2197
2198
=back
2199
2200
=cut
2201
2202
sub ModPrivacy {
2203
    my $borrowernumber = shift;
2204
    my $privacy = shift;
2205
    return unless defined $borrowernumber;
2206
    return unless $borrowernumber =~ /^\d+$/;
2207
2208
    return ModMember( borrowernumber => $borrowernumber,
2209
                      privacy        => $privacy );
2210
}
2211
2212
=head2 AddMessage
2186
=head2 AddMessage
2213
2187
2214
  AddMessage( $borrowernumber, $message_type, $message, $branchcode );
2188
  AddMessage( $borrowernumber, $message_type, $message, $branchcode );
(-)a/C4/Reserves.pm (+1 lines)
Lines 263-268 sub GetReserve { Link Here
263
    my ($reserve_id) = @_;
263
    my ($reserve_id) = @_;
264
264
265
    my $dbh = C4::Context->dbh;
265
    my $dbh = C4::Context->dbh;
266
266
    my $query = "SELECT * FROM reserves WHERE reserve_id = ?";
267
    my $query = "SELECT * FROM reserves WHERE reserve_id = ?";
267
    my $sth = $dbh->prepare( $query );
268
    my $sth = $dbh->prepare( $query );
268
    $sth->execute( $reserve_id );
269
    $sth->execute( $reserve_id );
(-)a/Koha/Schema/Result/Borrower.pm (-1 / +5 lines)
Lines 1113-1118 __PACKAGE__->many_to_many("courses", "course_instructors", "course"); Link Here
1113
# Created by DBIx::Class::Schema::Loader v0.07040 @ 2014-10-08 05:25:06
1113
# Created by DBIx::Class::Schema::Loader v0.07040 @ 2014-10-08 05:25:06
1114
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RBZ0y5EDS2o8CK/mtWfTYw
1114
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RBZ0y5EDS2o8CK/mtWfTYw
1115
1115
1116
__PACKAGE__->belongs_to(
1117
    "guarantor",
1118
    "Koha::Schema::Result::Borrower",
1119
    { borrowernumber => "guarantorid" },
1120
);
1116
1121
1117
# You can replace this text with custom content, and it will be preserved on regeneration
1118
1;
1122
1;
(-)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 580-585 OPAC: Link Here
580
                  no: "Don't allow"
580
                  no: "Don't allow"
581
            - patrons to choose their own privacy settings for their reading history.  This requires opacreadinghistory and AnonymousPatron
581
            - patrons to choose their own privacy settings for their reading history.  This requires opacreadinghistory and AnonymousPatron
582
        -
582
        -
583
            - pref: AllowPatronToSetCheckoutsVisibilityForGuarantor
584
              default: 0
585
              choices:
586
                  yes: Allow
587
                  no: "Don't allow"
588
            - patrons to choose their own privacy settings for showing the patron's checkouts to the patron's guarantor".
589
        -
583
            - Use borrowernumber
590
            - Use borrowernumber
584
            - pref: AnonymousPatron
591
            - pref: AnonymousPatron
585
              class: integer
592
              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 1169-1174 Link Here
1169
			[% END %]
1170
			[% END %]
1170
	  [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
1171
	  [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %]
1171
		</li>
1172
		</li>
1173
        [% IF guarantorid && Koha.Preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') %]
1174
            <li>
1175
                <label for="privacy_guarantor_checkouts">Show checkouts to guarantor</label>
1176
                <select name="privacy_guarantor_checkouts" id="privacy_guarantor_checkouts">
1177
                    [% IF privacy_guarantor_checkouts %]
1178
                        <option value="0">No</option>
1179
                        <option value="1" selected>Yes</option>
1180
                    [% ELSE %]
1181
                        <option value="0" selected>No</option>
1182
                        <option value="1">Yes</option>
1183
                    [% END %]
1184
                </select>
1185
                <div class="hint">Allow guarantor of this patron to view this patron's checkouts from the OPAC</div>
1186
            </li>
1187
        [% END %]
1172
		</ol>
1188
		</ol>
1173
		</fieldset>
1189
		</fieldset>
1174
        [% END # hide fieldset %][% END %]
1190
        [% 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 795-800 Link Here
795
            [% ELSE %]
822
            [% ELSE %]
796
                $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
823
                $( "#borrower_dateofbirth" ).datepicker({ yearRange: "c-120:c" });
797
            [% END %]
824
            [% END %]
825
826
            [% IF borrower.guarantorid && !Koha.Preference('OPACPrivacy') && Koha.Preference('AllowPatronToSetCheckoutsVisibilityForGuarantor') %]
827
                $('#update_privacy_guarantor_checkouts').click( function() {
828
                    $.post( "/cgi-bin/koha/svc/patron/show_checkouts_to_relatives", { privacy_guarantor_checkouts: $('#privacy_guarantor_checkouts').val() })
829
                     .done(function( data ) {
830
                         var message;
831
                         if ( data.success ) {
832
                             message = _("Your setting has been updated!");
833
                         } else {
834
                             message = _("Unable to update your setting!");
835
                         }
836
837
                         $('#update_privacy_guarantor_checkouts_message').fadeIn("slow").text( message ).delay( 5000 ).fadeOut("slow");
838
                     });
839
                });
840
            [% END %]
798
        });
841
        });
799
    //]]>
842
    //]]>
800
    </script>
843
    </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 365-370 Link Here
365
                            </div> <!-- /#opac-user-waiting -->
367
                            </div> <!-- /#opac-user-waiting -->
366
                        [% END # waiting_count && atdestination %]
368
                        [% END # waiting_count && atdestination %]
367
369
370
                        [% IF relatives %]
371
                            <div id="opac-user-relative-issues">
372
                                <table id="opac-user-relative-issues-table" class="table table-bordered table-striped">
373
                                    <thead>
374
                                        <tr>
375
                                            <th class="anti-the">Title</th>
376
                                            <th>Due</th>
377
                                            <th>Barcode</th>
378
                                            <th>Call number</th>
379
                                            <th class="psort">Relative</th>
380
                                        </tr>
381
                                    </thead>
382
383
                                    <tbody>
384
                                        [% FOREACH r IN relatives %]
385
                                            [% FOREACH i IN r.issues %]
386
                                                <tr>
387
                                                    <td>
388
                                                        <a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% i.item.biblio.biblionumber %]">
389
                                                            [% i.item.biblio.title | $EncodeUTF8 %]
390
                                                        </a>
391
                                                    </td>
392
393
                                                    <td>
394
                                                        [% i.date_due | $KohaDates %]
395
                                                    </td>
396
397
                                                    <td>
398
                                                        [% i.item.barcode %]
399
                                                    </td>
400
401
                                                    <td>
402
                                                        [% i.item.itemcallnumber | $EncodeUTF8 %]
403
                                                    </td>
404
405
                                                    <td>
406
                                                        [% r.firstname | $EncodeUTF8 %] [% r.surname | $EncodeUTF8 %]
407
                                                    </td>
408
                                                </tr>
409
                                            [% END %]
410
                                        [% END %]
411
                                    </tbody>
412
                                </table>
413
                            </div>
414
                        [% END %]
368
415
369
                        [% IF ( overdues_count ) %]
416
                        [% IF ( overdues_count ) %]
370
                            <div id="opac-user-overdues">
417
                            <div id="opac-user-overdues">
Lines 377-383 Link Here
377
                                            <th class="anti-the">Title</th>
424
                                            <th class="anti-the">Title</th>
378
                                            [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
425
                                            [% UNLESS ( item_level_itypes ) %]<th>Item type</th> [% END %]
379
                                            [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
426
                                            [% IF ( show_barcode ) %]<th>Barcode</th>[% END %]
380
                                            <th>Call no.</th>
427
                                            <th>Call number</th>
381
                                            <th class="title-string psort">Due</th>
428
                                            <th class="title-string psort">Due</th>
382
                                            [% IF ( OpacRenewalAllowed ) %]
429
                                            [% IF ( OpacRenewalAllowed ) %]
383
                                                <th class="nosort">Renew</th>
430
                                                <th class="nosort">Renew</th>
Lines 686-692 Link Here
686
            $(".js-hide").hide();
733
            $(".js-hide").hide();
687
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
734
            $(".modal-nojs").addClass("modal").addClass("hide").removeClass("modal-nojs");
688
            $(".suspend-until").prop("readonly",1);
735
            $(".suspend-until").prop("readonly",1);
689
            var dTables = $("#checkoutst,#holdst,#overduest");
736
737
            var dTables = $("#checkoutst,#holdst,#overduest,#opac-user-relative-issues-table");
690
            dTables.each(function(){
738
            dTables.each(function(){
691
                var thIndex = $(this).find("th.psort").index();
739
                var thIndex = $(this).find("th.psort").index();
692
                $(this).dataTable($.extend(true, {}, dataTablesDefaults, {
740
                $(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 379-396 if ( $borr->{'opacnote'} ) { Link Here
379
  );
380
  );
380
}
381
}
381
382
383
if (   C4::Context->preference('AllowPatronToSetCheckoutsVisibilityForGuarantor')
384
    || C4::Context->preference('AllowStaffToSetCheckoutsVisibilityForGuarantor') )
385
{
386
    my @relatives =
387
      Koha::Database->new()->schema()->resultset("Borrower")->search(
388
        {
389
            privacy_guarantor_checkouts => 1,
390
            'me.guarantorid'           => $borrowernumber
391
        },
392
        { prefetch => [ { 'issues' => { 'item' => 'biblio' } } ] }
393
      );
394
    $template->param( relatives => \@relatives );
395
}
396
382
$template->param(
397
$template->param(
383
    bor_messages_loop    => GetMessages( $borrowernumber, 'B', 'NONE' ),
398
    borrower           => $borr,
399
    bor_messages_loop  => GetMessages( $borrowernumber, 'B', 'NONE' ),
384
    waiting_count      => $wcount,
400
    waiting_count      => $wcount,
385
    patronupdate => $patronupdate,
401
    patronupdate       => $patronupdate,
386
    OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"),
402
    OpacRenewalAllowed => C4::Context->preference("OpacRenewalAllowed"),
387
    userview => 1,
403
    userview           => 1,
388
);
404
    SuspendHoldsOpac   => C4::Context->preference('SuspendHoldsOpac'),
389
405
    OpacHoldNotes      => C4::Context->preference('OpacHoldNotes'),
390
$template->param(
406
    AutoResumeSuspendedHolds =>
391
    SuspendHoldsOpac => C4::Context->preference('SuspendHoldsOpac'),
407
      C4::Context->preference('AutoResumeSuspendedHolds'),
392
    AutoResumeSuspendedHolds => C4::Context->preference('AutoResumeSuspendedHolds'),
393
    OpacHoldNotes => C4::Context->preference('OpacHoldNotes'),
394
);
408
);
395
409
396
output_html_with_http_headers $query, $cookie, $template->output;
410
output_html_with_http_headers $query, $cookie, $template->output;
397
- 

Return to bug 9303