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

(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/blocked-fines.inc (-2 / +2 lines)
Lines 7-13 Link Here
7
        [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge && fines > NoIssuesCharge %]
7
        [% IF !Koha.Preference('AllowFineOverride') && NoIssuesCharge && fines > NoIssuesCharge %]
8
           <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
8
           <span class="circ-hlt">Checkouts are BLOCKED because fine balance is OVER THE LIMIT.</span>
9
        [% END %]
9
        [% END %]
10
        <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% borrowernumber | uri %]" class="btn btn-default btn-xs" >Make payment</a>
10
        <a href="/cgi-bin/koha/members/pay.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-xs" >Make payment</a>
11
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% borrowernumber | uri %]" class="btn btn-default btn-xs" >Pay all fines</a></li>
11
        <a href="/cgi-bin/koha/members/paycollect.pl?borrowernumber=[% patron.borrowernumber | uri %]" class="btn btn-default btn-xs" >Pay all fines</a></li>
12
    </li>
12
    </li>
13
[% END %]
13
[% END %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/checkouts-table-footer.inc (-5 / +5 lines)
Lines 1-11 Link Here
1
<tfoot>
1
<tfoot>
2
	<tr>
2
	<tr>
3
        <td colspan="13" style="text-align: right; font-weight:bold;">Totals:</td>
3
        <td colspan="14" style="text-align: right; font-weight:bold;">Totals:</td>
4
        <td id="totaldue" style="text-align: right;">[% totaldue | html %]</td>
4
        <td id="totaldue" style="text-align: right;"></td>
5
        <td id="totalfine" style="text-align: right;">[% finetotal | html %]</td>
5
        <td id="totalfine" style="text-align: right;"></td>
6
        <td id="totalprice" style="text-align: right;">[% totalprice | html %]</td>
6
        <td id="totalprice" style="text-align: right;"></td>
7
                <td colspan="3"><div class="date-select">
7
                <td colspan="3"><div class="date-select">
8
            <p><label for="newduedate">Renewal due date:</label> <input type="text" size="12" id="newduedate" name="newduedate" value="[% newduedate | html %]" />
8
            <p><label for="newduedate">Renewal due date:</label> <input type="text" size="12" id="newduedate" name="newduedate" value="" />
9
</p>
9
</p>
10
            <p><label for="exemptfine">Forgive fines on return: <input type="checkbox" id="exemptfine" name="exemptfine" value="1" /></label></p></div>
10
            <p><label for="exemptfine">Forgive fines on return: <input type="checkbox" id="exemptfine" name="exemptfine" value="1" /></label></p></div>
11
		</td>
11
		</td>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt (-90 lines)
Lines 1-90 Link Here
1
[% USE Koha %]
2
[% USE KohaDates %]
3
[% SET footerjs = 1 %]
4
[% INCLUDE 'doc-head-open.inc' %]
5
<title>Koha &rsaquo; Check duplicate patron</title>
6
[% INCLUDE 'doc-head-close.inc' %]
7
</head>
8
9
<body id="pat_moremember-brief" class="pat">
10
    <div class="container-fluid">
11
        <div class="row">
12
13
            <div class="col-xs-12">
14
	<h3>[% UNLESS ( I ) %]
15
   [% title | html %] [% firstname | html %] [% END %] [% surname | html %] ([% cardnumber | html %])</h3>
16
            </div>
17
        </div>
18
        <div class="row">
19
            <div class="col-xs-6">
20
                <div id="patron-information">
21
22
     [% UNLESS ( I ) %][% IF ( othernames ) %]&ldquo;[% othernames | html %]&rdquo;[% END %]
23
        <div class = "address">
24
            <ul>
25
                [% IF Koha.Preference( 'AddressFormat' ) %]
26
                    [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
27
                [% ELSE %]
28
                    [% INCLUDE 'member-display-address-style-us.inc' %]
29
                [% END %]
30
            </ul>
31
        </div>
32
	<div class="rows">
33
		<ol>
34
            [% IF ( phone ) %]<li><span class="label">Primary phone: </span>[% phone | html %]</li>[% END %]
35
            [% IF ( phonepro ) %]<li><span class="label">Secondary phone: </span>[% phonepro | html %]</li>[% END %]
36
            [% IF ( mobile ) %]<li><span class="label">Other phone: </span>[% mobile | html %]</li>[% END %]
37
            [% IF ( fax ) %]<li><span class="label">Fax: </span>[% fax | html %]</li>[% END %]
38
            [% IF ( email ) %]<li class="email"><span class="label">Primary email:</span><a href="mailto:[% email | uri %]">[% email | html %]</a></li>[% END %]
39
            [% IF ( emailpro ) %]<li class="email"><span class="label">Secondary email: </span><a href="mailto:[% emailpro | uri %]">[% emailpro | html %]</a></li>[% END %]
40
            [% UNLESS ( I ) %]
41
                [% IF ( inititals ) %]<li><span class="label">Initials: </span>[% initials | html %]</li>[% END %]
42
                [% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %]</li>[% END %]
43
                [% IF ( sex ) %]<li><span class="label">Gender:</span>[% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex | html %][% END %]</li>[% END %][% END %]
44
            [% END %]
45
    [% IF ( isguarantee ) %]
46
        [% IF ( guaranteeloop ) %]
47
            <li><span class="label">Guarantees:</span><ul>[% FOREACH guaranteeloo IN guaranteeloop %]<li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guaranteeloo.borrowernumber | uri %]">[% guaranteeloo.name | html %]  </a></li>[% END %]</ul></li>
48
        [% END %]
49
    [% ELSE %]
50
        [% IF ( guarantor.borrowernumber ) %]
51
            <li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | uri %]">[% guarantor.surname | html %], [% guarantor.firstname | html %]</a></li>
52
        [% END %]
53
    [% END %]
54
	</ol>
55
	</div>
56
    </div>
57
    </div>
58
59
    <div class="col-xs-6">
60
	<div id="patron-library-details">
61
	<h3>Library use</h3>
62
	<div class="rows">
63
	<ol>
64
    <li><span class="label">Card number: </span>[% cardnumber | html %]</li>
65
	<li><span class="label">Borrowernumber: </span> [% borrowernumber | html %]</li>
66
    <li><span class="label">Category: </span>[% categoryname | html %] ([% categorycode | html %])</li>
67
    <li><span class="label">Registration date: </span>[% dateenrolled | $KohaDates %]</li>
68
    <li><span class="label">Expiration date: </span>
69
    [% IF ( was_renewed ) %]
70
            <strong class="reregistrinfo">[% dateexpiry | $KohaDates %]</strong>
71
    [% ELSE %]
72
            [% dateexpiry | $KohaDates %]
73
    [% END %]
74
    </li>
75
    <li><span class="label">Library: </span>[% branchname | html %]</li>
76
77
    [% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% lib1 | html %]</li>[% END %]
78
    [% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% lib2 | html %]</li>[% END %]
79
	</ol>
80
	</div>
81
	</div>
82
    </div>
83
</div>
84
<div class="row">
85
    <div class="col-xs-12">
86
        <fieldset class="action"><input type="button" class="close" value="Close window" /></fieldset>
87
    </div>
88
</div>
89
90
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-print.tt (-160 lines)
Lines 1-160 Link Here
1
[% USE Koha %]
2
[% USE Branches %]
3
[% USE KohaDates %]
4
[% USE Price %]
5
[% USE ItemTypes %]
6
[% SET footerjs = 1 %]
7
8
[% PROCESS 'accounts.inc' %]
9
10
[% INCLUDE 'doc-head-open.inc' %]
11
    <title>Summary for [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</title>
12
    [% INCLUDE 'doc-head-close.inc' %]
13
</head>
14
15
<body id="pat_moremember-print" class="pat">
16
    <div id="main">
17
        <h3><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% patron.cardnumber | uri %]">Account summary: [% patron.firstname | html %] [% patron.surname | html %] ([% patron.cardnumber | html %])</a></h3>
18
19
        <ul>
20
            [% IF Koha.Preference( 'AddressFormat' ) %]
21
                [% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
22
            [% ELSE %]
23
                [% INCLUDE 'member-display-address-style-us.inc' %]
24
            [% END %]
25
            <li>[% IF ( patron.phone ) %][% patron.phone | html %][% ELSE %](no phone number on file)[% END %]</li>
26
            <li>[% IF ( patron.email ) %][% patron.email | html %][% ELSE %](no primary email on file)[% END %]</li>
27
            [% IF ( patron.emailpro ) %]
28
                <li>[% patron.emailpro | html %]</li>
29
            [% END %]
30
            <li>Registration date: [% patron.dateenrolled | $KohaDates %]</li>
31
            <li>Expiration date: [% patron.dateexpiry | $KohaDates %]</li>
32
            <li>Library: [% Branches.GetName( patron.branchcode ) | html %]</li>
33
            <li>Category: [% patron.category.description | html %]</li>
34
        </ul>
35
36
        [% IF ( issues ) %]
37
            <table>
38
                <caption>Items checked out</caption>
39
                <tr>
40
                    <th>Title</th>
41
                    <th>Author</th>
42
                    <th>Call no</th>
43
                    <th>Item type</th>
44
                    <th>Date due</th>
45
                    <th>Barcode</th>
46
                    <th>Charge</th>
47
                    <th>Price</th>
48
                    <th>Status</th>
49
                </tr>
50
51
                [% FOREACH issue IN issues %]
52
                    [% IF ( issue.overdue ) %]<tr class="overdue">[% ELSE %]<tr>[% END %]
53
                        <td>
54
                            [% issue.title | html %]
55
                            <a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issue.itemnumber | uri %]&amp;biblionumber=[% issue.biblionumber | uri %]&amp;bi=[% issue.biblioitemnumber | uri %]"></a>
56
                        </td>
57
                        <td>[% issue.author | html %]</td>
58
                        <td>[% issue.itemcallnumber | html %]</td>
59
                        <td>[% ItemTypes.GetDescription( issue.itype ) | html %]</td>
60
                        <td>[% issue.date_due | $KohaDates  as_due_date => 1 %]</td>
61
                        <td>[% issue.barcode | html %]</td>
62
                        <td>[% issue.charge | $Price %]</td>
63
                        <td>[% issue.replacementprice | $Price %]</td>
64
                        <td>[% IF ( issue.overdue ) %]Overdue![% ELSE %]&nbsp;[% END %]</td>
65
                    </tr>
66
                [% END %]
67
68
            <tr>
69
                <td colspan="6" style="text-align: right; font-weight:bold;">Totals:</td>
70
                <td>[% totaldue | $Price %]</td>
71
                <td>[% totalprice | $Price %]</td>
72
                <td colspan="3">&nbsp;</td>
73
            </tr>
74
        </table>
75
    [% END %]
76
77
    [% IF ( reserves ) %]
78
        <table>
79
            <caption>Pending holds</caption>
80
            <tr>
81
                <th>Title</th>
82
                <th>Author</th>
83
                <th>Placed on</th>
84
                <th>Expires on</th>
85
                <th>Pick up location</th>
86
            </tr>
87
88
            [% FOREACH reserve IN reserves %]
89
                <tr>
90
                    <td>[% reserve.title | html %]</td>
91
                    <td>[% reserve.author | html %]</td>
92
                    <td>[% reserve.reservedate | $KohaDates %]</td>
93
                    <td>[% reserve.expirationdate | $KohaDates %]</td>
94
                    <td>[% reserve.waiting_at | html %]</td>
95
                </tr>
96
            [% END %]
97
        </table>
98
    [% END %]
99
    [% IF accounts && totaldue != 0 %]
100
        <table id="table_account_fines">
101
            <caption>Account fines and payments</caption>
102
            <thead>
103
              <tr>
104
                  <th>Date</th>
105
                  <th>Description of charges</th>
106
                  <th>Note</th>
107
                  <th>Amount</th>
108
                  <th>Outstanding</th>
109
                </tr>
110
            </thead>
111
112
            [% FOREACH account IN accounts %]
113
               <tr>
114
                  <td>[% account.date | $KohaDates %]</td>
115
                  <td>
116
                      [% PROCESS account_type_description account=account %]
117
                      [%- IF account.payment_type %]
118
                          , [% AuthorisedValues.GetByCode('PAYMENT_TYPE', account.payment_type) | html %]
119
                      [% END %]
120
                      [%- IF account.description %]
121
                          , [% account.description | html %]
122
                      [% END %]
123
                      &nbsp;
124
                      [% IF ( account.itemnumber AND account.accounttype != 'F' AND account.accounttype != 'FU' ) %]
125
                          <a href="/cgi-bin/koha/catalogue/moredetail.pl?biblionumber=[% account.item.biblionumber | uri %]&amp;itemnumber=[% account.itemnumber | uri %]">[% account.item.biblio.title | html %]</a>
126
                      [% END %]
127
                  </td>
128
                  <td>
129
                      [% account.note | html_line_break %]
130
                  </td>
131
                  [% IF ( account.amount < 0 ) %]
132
                      <td class="credit" style="text-align: right;">
133
                  [% ELSE %]
134
                      <td class="debit" style="text-align: right;">
135
                  [% END %][% account.amount | $Price %]
136
                      </td>
137
                  [% IF ( account.amountoutstanding < 0 ) %]
138
                      <td class="credit" style="text-align: right;">
139
                  [% ELSE %]
140
                      <td class="debit" style="text-align: right;">
141
                  [% END %]
142
                          [% account.amountoutstanding | $Price %]
143
                      </td>
144
                </tr>
145
            [% END %]
146
147
            <tfoot>
148
                <tr>
149
                    <td colspan="4">Total due</td>
150
                    <td colspan="2" style="text-align:right;">[% totaldue | $Price %]</td>
151
                </tr>
152
            </tfoot>
153
        </table>
154
    [% END %]
155
156
[% MACRO jsinclude BLOCK %]
157
    [% INCLUDE 'slip-print.inc' #printThenClose %]
158
[% END %]
159
160
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-receipt.tt (-78 lines)
Lines 1-78 Link Here
1
[% USE raw %]
2
[% USE Asset %]
3
[% USE Koha %]
4
[% SET footerjs = 1 %]
5
[% INCLUDE 'doc-head-open.inc' %]
6
<title>Print Receipt for [% cardnumber | html %]</title>
7
[% INCLUDE 'doc-head-close.inc' %]
8
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9
<link rel="shortcut icon" href="[% IF ( IntranetFavicon ) %][% IntranetFavicon | html %][% ELSE %][% interface | html %]/[% theme | html %]/img/favicon.ico[% END %]" type="image/x-icon" />
10
[% Asset.css("css/print.css") | $raw %]
11
</head>
12
13
<body id="pat_moremember-receipt" class="pat">
14
15
<div id="receipt">
16
17
<h3>[% LibraryName | html %]</h3>
18
[% IF ( branchname ) %][% branchname | html %]<br />[% END %]
19
Checked out to [% firstname | html %] [% surname | html %] <br />
20
(<a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% cardnumber | uri %]">[% cardnumber | html %]</a>)<br />
21
22
[% todaysdate | html %]<br />
23
24
[% IF ( quickslip ) %]
25
<h4>Checked out today</h4>
26
[% FOREACH issueloo IN issueloop %]
27
[% IF ( issueloo.red ) %][% ELSE %]
28
[% IF ( issueloo.today ) %]
29
<p><a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issueloo.itemnumber | uri %]&amp;biblionumber=[% issueloo.biblionumber | uri %]&amp;bi=[% issueloo.biblioitemnumber | uri %]">[% issueloo.title | html %]</a><br />
30
Barcode: [% issueloo.barcode | html %]<br />
31
Date due: [% issueloo.date_due | html %]<br /></p>
32
    [% END %]
33
    [% END %]
34
    [% END %]
35
36
[% ELSE %]
37
<h4>Checked out</h4>
38
[% FOREACH issueloo IN issueloop %]
39
[% IF ( issueloo.red ) %][% ELSE %]
40
<p><a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issueloo.itemnumber | uri %]&amp;biblionumber=[% issueloo.biblionumber | uri %]&amp;bi=[% issueloo.biblioitemnumber | uri %]">[% issueloo.title | html %]</a><br />
41
Barcode: [% issueloo.barcode | html %]<br />
42
Date due: [% issueloo.date_due | html %]<br /></p>
43
    [% END %]
44
    [% END %]
45
46
[% END %]
47
48
[% IF ( quickslip ) %]
49
[% ELSE %]
50
[% IF ( overdues_exist ) %]
51
<h4>Overdues</h4>
52
    [% FOREACH issueloo IN issueloop %]
53
    [% IF ( issueloo.red ) %]
54
<p><a href="/cgi-bin/koha/catalogue/detail.pl?item=[% issueloo.itemnumber | uri %]&amp;biblionumber=[% issueloo.biblionumber | uri %]&amp;bi=[% issueloo.biblioitemnumber | uri %]">[% issueloo.title | html %]</a><br />
55
Barcode: [% issueloo.barcode | html %]<br />
56
Date due: [% issueloo.date_due | html %]</p>
57
[% END %]
58
[% END %]
59
[% END %]
60
[% END %]
61
62
[% IF ( koha_news_count ) %]
63
            <hr><h4 style="text-align: center; font-style:italic;">News</h4>
64
                       <!-- [% koha_news_count | html %] recent news item(s) -->
65
            [% FOREACH koha_new IN koha_news %]
66
                    <div class="newsitem" id="news[% koha_new.idnew | html %]"><h5 style="margin-bottom: 1px; margin-top: 1px"><b>[% koha_new.title | html %]</b></h5>
67
                                        <p style="margin-bottom: 1px; margin-top: 1px">[% koha_new.content | $raw %]</p>
68
                                       <p class="newsfooter" style="font-size: 8pt; font-style:italic; margin-bottom: 1px; margin-top: 1px"> Posted on [% koha_new.newdate | html %]
69
70
</p><hr /></div>
71
            [% END %]
72
[% END %]
73
74
[% MACRO jsinclude BLOCK %]
75
    [% INCLUDE 'slip-print.inc' #printThenClose %]
76
[% END %]
77
78
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt (-17 / +18 lines)
Lines 5-10 Link Here
5
[% USE KohaDates %]
5
[% USE KohaDates %]
6
[% USE AuthorisedValues %]
6
[% USE AuthorisedValues %]
7
[% USE ColumnsSettings %]
7
[% USE ColumnsSettings %]
8
[% USE Price %]
8
[% SET footerjs = 1 %]
9
[% SET footerjs = 1 %]
9
[% INCLUDE 'doc-head-open.inc' %]
10
[% INCLUDE 'doc-head-open.inc' %]
10
<title>Koha &rsaquo; Patrons &rsaquo;
11
<title>Koha &rsaquo; Patrons &rsaquo;
Lines 95-101 Link Here
95
                                                [% END %]
96
                                                [% END %]
96
                                                <i>"[% patron_message.message | html %]"</i>
97
                                                <i>"[% patron_message.message | html %]"</i>
97
                                            </span>
98
                                            </span>
98
                                            [% IF patron_message.branchcode == branchcode OR Koha.Preference('AllowAllMessageDeletion') %]
99
                                            [% IF patron_message.branchcode == patron.branchcode OR Koha.Preference('AllowAllMessageDeletion') %]
99
                                                <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% patron_message.message_id | html %]&amp;borrowernumber=[% patron_message.borrowernumber | html %]&amp;from=moremember" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a>
100
                                                <a class="btn btn-link btn-sm" href="/cgi-bin/koha/circ/del_message.pl?message_id=[% patron_message.message_id | html %]&amp;borrowernumber=[% patron_message.borrowernumber | html %]&amp;from=moremember" onclick="return confirm(MSG_CONFIRM_DELETE_MESSAGE);"><i class="fa fa-trash"></i> Delete</a>
100
                                            [% END %]
101
                                            [% END %]
101
                                        </li>
102
                                        </li>
Lines 108-125 Link Here
108
                        [% IF ( flagged ) %]
109
                        [% IF ( flagged ) %]
109
                            <div id="circmessages" class="circmessage attention">
110
                            <div id="circmessages" class="circmessage attention">
110
                                <ul>
111
                                <ul>
111
                                    [% IF ( userdebarred ) %]
112
                                    [% IF ( patron.is_debarred ) %]
112
                                        <li class="blocker">Patron's account is restricted
113
                                        <li class="blocker">Patron's account is restricted
113
                                            [% IF ( userdebarreddate ) %]
114
                                            [% IF ( userdebarreddate ) %]
114
                                                until [% userdebarreddate | html %]
115
                                                until [% userdebarreddate | $KohaDates %]
115
                                            [% END %]
116
                                            [% END %]
116
117
117
                                            [% IF ( debarredcomment ) %]
118
                                            [% IF ( patron.debarredcomment ) %]
118
                                                with the explanation: <i>
119
                                                with the explanation: <i>
119
                                                [% IF debarredcomment.search('OVERDUES_PROCESS') %]
120
                                                [% IF patron.debarredcomment.search('OVERDUES_PROCESS') %]
120
                                                    Restriction added by overdues process [% debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
121
                                                    Restriction added by overdues process [% patron.debarredcomment.remove('OVERDUES_PROCESS ') | html_line_break %]
121
                                                [% ELSE %]
122
                                                [% ELSE %]
122
                                                    [% debarredcomment | html_line_break %]
123
                                                    [% patron.debarredcomment | html_line_break %]
123
                                                [% END %]
124
                                                [% END %]
124
                                                </i>
125
                                                </i>
125
                                            [% END %]
126
                                            [% END %]
Lines 232-238 Link Here
232
                                            [% IF ( patron.dateofbirth ) %]
233
                                            [% IF ( patron.dateofbirth ) %]
233
                                                <li>
234
                                                <li>
234
                                                    <span class="label">Date of birth:</span>
235
                                                    <span class="label">Date of birth:</span>
235
                                                    [% patron.dateofbirth | $KohaDates %] ([% age | html %] years)
236
                                                    [% patron.dateofbirth | $KohaDates %] ([% patron.get_age | html %] years)
236
                                                </li>
237
                                                </li>
237
                                            [% END %]
238
                                            [% END %]
238
                                            [% IF ( patron.sex ) %]
239
                                            [% IF ( patron.sex ) %]
Lines 393-399 Link Here
393
                                        <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=5"><i class="fa fa-pencil"></i> Edit</a>
394
                                        <a class="btn btn-default btn-xs" href="memberentry.pl?op=modify&amp;borrowernumber=[% patron.borrowernumber | html %]&amp;step=5"><i class="fa fa-pencil"></i> Edit</a>
394
                                    </div>
395
                                    </div>
395
                                    [% INCLUDE 'messaging-preference-form.inc' %]
396
                                    [% INCLUDE 'messaging-preference-form.inc' %]
396
                                    [% IF ( SMSSendDriver ) %]
397
                                    [% IF Koha.Preference('SMSSendDriver') %]
397
                                        <div class="rows">
398
                                        <div class="rows">
398
                                            <ol>
399
                                            <ol>
399
                                                <li>
400
                                                <li>
Lines 460-474 Link Here
460
                                        </li>
461
                                        </li>
461
                                        <li id="patron-branchname">
462
                                        <li id="patron-branchname">
462
                                            <span class="label">Library: </span>
463
                                            <span class="label">Library: </span>
463
                                            [% branchname | html %]
464
                                            [% Branches.GetName( patron.branchcode ) | html %]
464
                                        </li>
465
                                        </li>
465
466
466
                                        [% IF ( OPACPrivacy ) %]
467
                                        [% IF Koha.Preference( 'OPACPrivacy') %]
467
                                            <li id="patron-privacypref">
468
                                            <li id="patron-privacypref">
468
                                                <span class="label">Privacy Pref:</span>
469
                                                <span class="label">Privacy Pref:</span>
469
                                                    [% IF ( privacy0 ) %]Forever[% END %]
470
                                                    [% IF ( patron.privacy == 0 ) %]Forever[% END %]
470
                                                    [% IF ( privacy1 ) %]Default[% END %]
471
                                                    [% IF ( patron.privacy == 1 ) %]Default[% END %]
471
                                                    [% IF ( privacy2 ) %]Never[% END %]
472
                                                    [% IF ( patron.privacy == 2 ) %]Never[% END %]
472
                                            </li>
473
                                            </li>
473
                                        [% END %]
474
                                        [% END %]
474
475
Lines 672-678 Link Here
672
                            </li>
673
                            </li>
673
                            [% IF relatives_issues_count %]
674
                            [% IF relatives_issues_count %]
674
                                <li>
675
                                <li>
675
                                    <a href="#relatives-issues" id="relatives-issues-tab">Relatives' checkouts</a>
676
                                    <a href="#relatives-issues" id="relatives-issues-tab">[% relatives_issues_count | html %] Relatives' checkouts</a>
676
                                </li>
677
                                </li>
677
                            [% END %]
678
                            [% END %]
678
                            <li>
679
                            <li>
Lines 732-739 Link Here
732
                        [% END %]
733
                        [% END %]
733
734
734
                        <div id="finesandcharges">
735
                        <div id="finesandcharges">
735
                            [% IF ( totaldue_raw ) %]
736
                            [% IF ( fines ) %]
736
                                <p>Total due: [% totaldue | html %]</p>
737
                                <p>Total due: [% fines | $Price %]</p>
737
                            [% ELSE %]
738
                            [% ELSE %]
738
                                <p>No outstanding charges</p>
739
                                <p>No outstanding charges</p>
739
                            [% END %]
740
                            [% END %]
(-)a/members/moremember.pl (-159 / +16 lines)
Lines 22-119 Link Here
22
22
23
=head1 moremember.pl
23
=head1 moremember.pl
24
24
25
 script to do a borrower enquiry/bring up borrower details etc
25
 script to do a borrower enquiry/bring up patron details etc
26
 Displays all the details about a borrower
26
 Displays all the details about a patron
27
 written 20/12/99 by chris@katipo.co.nz
28
 last modified 21/1/2000 by chris@katipo.co.nz
29
 modified 31/1/2001 by chris@katipo.co.nz
30
   to not allow items on request to be renewed
31
32
 needs html removed and to use the C4::Output more, but its tricky
33
27
34
=cut
28
=cut
35
29
36
use Modern::Perl;
30
use Modern::Perl;
37
use CGI qw ( -utf8 );
31
use CGI qw ( -utf8 );
38
use HTML::Entities;
39
use C4::Context;
32
use C4::Context;
40
use C4::Auth;
33
use C4::Auth;
41
use C4::Output;
34
use C4::Output;
42
use C4::Members;
43
use C4::Members::Attributes;
44
use C4::Members::AttributeTypes;
35
use C4::Members::AttributeTypes;
45
use C4::Reserves;
46
use C4::Circulation;
47
use C4::Koha;
48
use C4::Letters;
49
use C4::Biblio;
50
use C4::Form::MessagingPreferences;
36
use C4::Form::MessagingPreferences;
51
use List::MoreUtils qw/uniq/;
37
use List::MoreUtils qw/uniq/;
52
use C4::Members::Attributes qw(GetBorrowerAttributes);
38
use C4::Members::Attributes qw(GetBorrowerAttributes);
53
use Koha::Account::Lines;
54
use Koha::AuthorisedValues;
55
use Koha::CsvProfiles;
56
use Koha::Patron::Debarments qw(GetDebarments);
39
use Koha::Patron::Debarments qw(GetDebarments);
57
use Koha::Patron::Messages;
40
use Koha::Patron::Messages;
58
#use Smart::Comments;
59
#use Data::Dumper;
60
use DateTime;
61
use Koha::DateUtils;
41
use Koha::DateUtils;
62
use Koha::Database;
42
use Koha::CsvProfiles;
63
use Koha::Patrons;
43
use Koha::Patrons;
64
use Koha::Patron::Categories;
65
use Koha::Token;
44
use Koha::Token;
45
use Koha::Checkouts;
66
46
67
use vars qw($debug);
47
use vars qw($debug);
68
48
69
BEGIN {
49
BEGIN {
70
	$debug = $ENV{DEBUG} || 0;
50
    $debug = $ENV{DEBUG} || 0;
71
}
51
}
72
52
73
my $dbh = C4::Context->dbh;
74
75
my $input = CGI->new;
53
my $input = CGI->new;
76
$debug or $debug = $input->param('debug') || 0;
54
$debug or $debug = $input->param('debug') || 0;
77
my $print = $input->param('print');
78
79
my $template_name;
80
my $quickslip = 0;
81
82
my $flagsrequired;
83
if (defined $print and $print eq "page") {
84
    $template_name = "members/moremember-print.tt";
85
    # circ staff who process checkouts but can't edit
86
    # patrons still need to be able to access print view
87
    $flagsrequired = { circulate => "circulate_remaining_permissions" };
88
} elsif (defined $print and $print eq "slip") {
89
    $template_name = "members/moremember-receipt.tt";
90
    # circ staff who process checkouts but can't edit
91
    # patrons still need to be able to print receipts
92
    $flagsrequired =  { circulate => "circulate_remaining_permissions" };
93
} elsif (defined $print and $print eq "qslip") {
94
    $template_name = "members/moremember-receipt.tt";
95
    $quickslip = 1;
96
    $flagsrequired =  { circulate => "circulate_remaining_permissions" };
97
} elsif (defined $print and $print eq "brief") {
98
    $template_name = "members/moremember-brief.tt";
99
    $flagsrequired = { borrowers => 'edit_borrowers' };
100
} else {
101
    $template_name = "members/moremember.tt";
102
    $flagsrequired = { borrowers => 'edit_borrowers' };
103
}
104
55
105
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
56
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
106
    {
57
    {
107
        template_name   => $template_name,
58
        template_name   => "members/moremember.tt",
108
        query           => $input,
59
        query           => $input,
109
        type            => "intranet",
60
        type            => "intranet",
110
        authnotrequired => 0,
61
        authnotrequired => 0,
111
        flagsrequired   => $flagsrequired,
62
        flagsrequired   => { borrowers => 'edit_borrowers' },
112
        debug           => 1,
63
        debug           => 1,
113
    }
64
    }
114
);
65
);
115
my $borrowernumber = $input->param('borrowernumber');
66
my $borrowernumber = $input->param('borrowernumber');
116
$borrowernumber = HTML::Entities::encode($borrowernumber);
117
my $error = $input->param('error');
67
my $error = $input->param('error');
118
$template->param( error => $error ) if ( $error );
68
$template->param( error => $error ) if ( $error );
119
69
Lines 121-166 my $patron = Koha::Patrons->find( $borrowernumber ); Link Here
121
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
71
my $logged_in_user = Koha::Patrons->find( $loggedinuser ) or die "Not logged in";
122
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
72
output_and_exit_if_error( $input, $cookie, $template, { module => 'members', logged_in_user => $logged_in_user, current_patron => $patron } );
123
73
124
my $issues        = $patron->checkouts;
125
my $balance       = $patron->account->balance;
126
$template->param(
127
    issuecount => $issues->count,
128
    fines      => $balance,
129
);
130
131
my $category_type = $patron->category->category_type;
74
my $category_type = $patron->category->category_type;
132
my $data = $patron->unblessed;
133
134
$debug and printf STDERR "dates (enrolled,expiry,birthdate) raw: (%s, %s, %s)\n", map {$data->{$_}} qw(dateenrolled dateexpiry dateofbirth);
135
foreach (qw(dateenrolled dateexpiry dateofbirth)) { # FIXME This should be removed
136
    my $userdate = $data->{$_};
137
    unless ($userdate) {
138
        $debug and warn sprintf "Empty \$data{%12s}", $_;
139
        $data->{$_} = '';
140
        next;
141
    }
142
    $data->{$_} = dt_from_string( $userdate );
143
}
144
75
145
for (qw(gonenoaddress lost borrowernotes)) {
76
for (qw(gonenoaddress lost borrowernotes is_debarred)) {
146
	 $data->{$_} and $template->param(flagged => 1) and last;
77
    $patron->$_ and $template->param(flagged => 1) and last;
147
}
78
}
148
79
149
if ( $patron->is_debarred ) {
80
if ( $patron->is_debarred ) {
150
    $template->param(
81
    $template->param(
151
        userdebarred => 1, # FIXME Template should use patron->is_debarred
152
        flagged => 1,
153
        debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }),
82
        debarments => scalar GetDebarments({ borrowernumber => $borrowernumber }),
154
    );
83
    );
155
    my $debar = $data->{'debarred'};
84
    if ( $patron->debarred ne "9999-12-31" ) {
156
    if ( $debar ne "9999-12-31" ) {
85
        $template->param( 'userdebarreddate' => $patron->debarred );
157
        $template->param( 'userdebarreddate' => output_pref( { dt => dt_from_string( $debar ), dateonly => 1 } ) );
158
        $template->param( 'debarredcomment'  => $data->{debarredcomment} );
159
    }
86
    }
160
}
87
}
161
88
162
$data->{ "sex_".$data->{'sex'}."_p" } = 1 if defined $data->{sex};
163
164
my @relatives;
89
my @relatives;
165
if ( my $guarantor = $patron->guarantor ) {
90
if ( my $guarantor = $patron->guarantor ) {
166
    $template->param( guarantor => $guarantor );
91
    $template->param( guarantor => $guarantor );
Lines 180-250 if ( my $guarantor = $patron->guarantor ) { Link Here
180
}
105
}
181
106
182
my $relatives_issues_count =
107
my $relatives_issues_count =
183
  Koha::Database->new()->schema()->resultset('Issue')
108
    Koha::Checkouts->count({ borrowernumber => \@relatives });
184
  ->count( { borrowernumber => \@relatives } );
185
186
my %bor;
187
$bor{'borrowernumber'} = $borrowernumber;
188
189
# Converts the branchcode to the branch name
190
my $samebranch;
191
if ( C4::Context->preference("IndependentBranches") ) {
192
    if ( C4::Context->IsSuperLibrarian() ) {
193
        $samebranch = 1;
194
    }
195
    else {
196
        my $userenv = C4::Context->userenv;
197
        $samebranch = ( $data->{'branchcode'} eq $userenv->{branch} );
198
    }
199
}
200
else {
201
    $samebranch = 1;
202
}
203
my $library = Koha::Libraries->find( $data->{branchcode})->unblessed;
204
@{$data}{keys %$library} = values %$library; # merge in all branch columns # FIXME This is really ugly, we should pass the library instead
205
206
# If printing a page, send the account informations to the template
207
if (defined $print and $print eq "page") {
208
    my $accts = Koha::Account::Lines->search(
209
        { borrowernumber => $patron->borrowernumber, amountoutstanding => { '>' => 0 } },
210
        { order_by       => { -desc => 'accountlines_id' } }
211
    );
212
    $template->param( accounts => $accts );
213
}
214
215
# Show OPAC privacy preference is system preference is set
216
if ( C4::Context->preference('OPACPrivacy') ) { # FIXME Should be moved the the template
217
    $template->param( OPACPrivacy => 1);
218
    $template->param( "privacy".$data->{'privacy'} => 1);
219
}
220
221
my $today       = DateTime->now( time_zone => C4::Context->tz);
222
$today->truncate(to => 'day');
223
my $overdues_exist = 0;
224
my $totalprice = 0;
225
226
# Calculate and display patron's age
227
if ( $data->{dateofbirth} ) {
228
    $template->param( age => Koha::Patron->new({ dateofbirth => $data->{dateofbirth} })->get_age );
229
}
230
231
### ###############################################################################
232
# BUILD HTML
233
# show all reserves of this borrower, and the position of the reservation ....
234
if ($borrowernumber) {
235
    $template->param(
236
        holds_count => Koha::Database->new()->schema()->resultset('Reserve')
237
          ->count( { borrowernumber => $borrowernumber } ) );
238
}
239
109
240
# Generate CSRF token for upload and delete image buttons
110
# Generate CSRF token for upload and delete image buttons
241
$template->param(
111
$template->param(
242
    csrf_token => Koha::Token->new->generate_csrf({ session_id => $input->cookie('CGISESSID'),}),
112
    csrf_token => Koha::Token->new->generate_csrf({ session_id => $input->cookie('CGISESSID'),}),
243
);
113
);
244
114
245
246
$template->param(%$data); # FIXME This should be removed and used $patron instead, but too many things are processed above
247
248
if (C4::Context->preference('ExtendedPatronAttributes')) {
115
if (C4::Context->preference('ExtendedPatronAttributes')) {
249
    my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber);
116
    my $attributes = C4::Members::Attributes::GetBorrowerAttributes($borrowernumber);
250
    my @classes = uniq( map {$_->{class}} @$attributes );
117
    my @classes = uniq( map {$_->{class}} @$attributes );
Lines 279-286 if (C4::Context->preference('ExtendedPatronAttributes')) { Link Here
279
if (C4::Context->preference('EnhancedMessagingPreferences')) {
146
if (C4::Context->preference('EnhancedMessagingPreferences')) {
280
    C4::Form::MessagingPreferences::set_form_values({ borrowernumber => $borrowernumber }, $template);
147
    C4::Form::MessagingPreferences::set_form_values({ borrowernumber => $borrowernumber }, $template);
281
    $template->param(messaging_form_inactive => 1);
148
    $template->param(messaging_form_inactive => 1);
282
    $template->param(SMSSendDriver => C4::Context->preference("SMSSendDriver"));
283
    $template->param(TalkingTechItivaPhone => C4::Context->preference("TalkingTechItivaPhoneNotification"));
284
}
149
}
285
150
286
if ( C4::Context->preference("ExportCircHistory") ) {
151
if ( C4::Context->preference("ExportCircHistory") ) {
Lines 289-295 if ( C4::Context->preference("ExportCircHistory") ) { Link Here
289
154
290
my $patron_messages = Koha::Patron::Messages->search(
155
my $patron_messages = Koha::Patron::Messages->search(
291
    {
156
    {
292
        'me.borrowernumber' => $borrowernumber,
157
        'me.borrowernumber' => $patron->borrowernumber,
293
    },
158
    },
294
    {
159
    {
295
        join => 'manager',
160
        join => 'manager',
Lines 314-336 if ( $patron->is_expired || $patron->is_going_to_expire ) { Link Here
314
    );
179
    );
315
}
180
}
316
181
317
my $total = $patron->account->balance;
318
$template->param(
182
$template->param(
319
    patron          => $patron,
183
    patron          => $patron,
184
    issuecount      => $patron->checkouts->count,
185
    holds_count     => $patron->holds->count,
186
    fines           => $patron->account->balance,
320
    translated_language => $translated_language,
187
    translated_language => $translated_language,
321
    detailview      => 1,
188
    detailview      => 1,
322
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
189
    was_renewed     => scalar $input->param('was_renewed') ? 1 : 0,
323
    todaysdate      => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }),
324
    totalprice      => sprintf("%.2f", $totalprice),
325
    totaldue        => sprintf("%.2f", $total),
326
    totaldue_raw    => $total,
327
    overdues_exist  => $overdues_exist,
328
    StaffMember     => $category_type eq 'S',
329
    $category_type  => 1, # [% IF ( I ) %] = institutional/organisation
190
    $category_type  => 1, # [% IF ( I ) %] = institutional/organisation
330
    samebranch      => $samebranch,
331
    quickslip       => $quickslip,
332
    housebound_role => scalar $patron->housebound_role,
191
    housebound_role => scalar $patron->housebound_role,
333
    PatronsPerPage => C4::Context->preference("PatronsPerPage") || 20,
334
    relatives_issues_count => $relatives_issues_count,
192
    relatives_issues_count => $relatives_issues_count,
335
    relatives_borrowernumbers => \@relatives,
193
    relatives_borrowernumbers => \@relatives,
336
);
194
);
337
- 

Return to bug 21757