]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/main.tt2
91133fc68dbc744d0695df369f3277f3e0ea7e9c
[working/Evergreen.git] / Open-ILS / src / templates / opac / myopac / main.tt2
1 [%  PROCESS "opac/parts/header.tt2";
2     PROCESS "opac/parts/misc_util.tt2";
3     WRAPPER "opac/parts/myopac/main_base.tt2";
4     myopac_page = "main";
5     myopac_main_page = "main";
6     myopac_cc_allowed = 0;
7     IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
8         myopac_cc_allowed = 1;
9     END
10 %]
11 <h3 class="sr-only">[% l('My Account Summary') %]</h3>
12 [%  IF myopac_cc_allowed;
13     # http://www.w3.org/TR/WCAG20-TECHS/H32.html
14     # avoid forms w/ no submit action %]
15 <form action="[% ctx.opac_root %]/myopac/main_payment_form" method="get">
16 [% END %]
17
18     [% IF ctx.fines.circulation.size > 0 %]
19     <div id='myopac_circ_trans_div'>
20         <table width='100%' class='data_grid' title="[% l('Items Checked Out') %]">
21             <thead>
22                 <tr>
23                     <td colspan='10' style='padding: 6px'>
24                         <strong>[% l("Fines") %]</strong>
25                     </td>
26                 </tr>
27                 <tr>
28                     <td>[% l("Title") %]</td>
29                     <td>[% l("Author") %]</td>
30                     <td>[% l("Checkout Date") %]</td>
31                     <td>[% l("Due Date") %]</td>
32                     <td>[% l("Date Returned") %]</td>
33                     <td>[% l("Balance Owed") %]</td>
34                     [% IF myopac_cc_allowed %]
35                     <td nowrap="nowrap" style="white-space:nowrap;">
36                         <input id="pay_fines_box1" checked="checked"
37                             type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
38                             title="[% l('Click to (un)select all fines') %]" />
39                         <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
40                     </td>
41                     [% END %]
42                 </tr>
43             </thead>
44             <tbody id='myopac_circ_trans_tbody'>
45                 [% FOR f IN ctx.fines.circulation;
46                     attrs = {marc_xml => f.marc_xml};
47                     IF f.marc_xml;
48                         PROCESS get_marc_attrs args=attrs;
49                     ELSIF f.xact.reservation;
50                         attrs.title = f.xact.reservation.target_resource_type.name;
51                     END %]
52                 <tr id='myopac_circ_trans_row'>
53                     <td>
54                         [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
55                         IF recid; %]
56                         <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
57                             {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
58                         [% ELSE %]
59                         [% attrs.title | html %]
60                         [% END %]
61                     </td>
62                     <td>[%- author_query = attrs.author.replace('[,\.:;]', ''); %]
63                         <a href="[% mkurl(ctx.opac_root _ '/results',
64                             {qtype => 'author', query => author_query,
65                             loc => ctx.search_ou}) %]">[% attrs.author | html %]</a>
66                     </td>
67                     <td name='myopac_circ_trans_start'>
68                         [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
69                         IF ts;
70                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
71                         END %]
72                     </td>
73                     <td name='myopac_circ_trans_due'>
74                         [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
75                            due_org = f.xact.circulation.circ_lib || f.xact.reservation.pickup_lib;
76                         IF ts;
77                             date.format(ctx.parse_datetime(ts, due_org), DATE_FORMAT);
78                         END %]
79                     </td>
80                     <td name='myopac_circ_trans_finished'>
81                         [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
82                             IF ts;
83                                 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
84                             ELSE %]
85                             <!-- XXX TODO fines aren't really accruing
86                                 if circ has hit maxfines. more clarity
87                                 here? -->
88                             <span class="alert">[% l('(fines accruing)') %]</span>
89                         [%  END %]
90                     </td>
91                     <td>
92                         <strong class="alert">
93                             [% money(f.xact.balance_owed) %]
94                         </strong>
95                     </td>
96                     [% IF myopac_cc_allowed %]
97                     <td>
98                         <input type="checkbox" checked="checked" 
99                             title="[% l('Pay this fine') %]" name="xact"
100                             value="[% f.xact.id %]" />
101                     </td>
102                     [% END %]
103                 </tr>
104                 [% END %]
105             </tbody>
106         </table>
107     </div>
108     [% END %]
109
110     [% IF ctx.fines.grocery.size > 0 %]
111     <!-- Table for all non-circulation transactions -->
112     <div id='myopac_trans_div'>
113         <br/>
114         <hr class='opac-auto-013'  color="#dcdbdb" />
115         <br/>
116         <table width='100%' class='data_grid data_grid_center'
117             id='myopac_trans_table' title="[% l('Other Fines and Fees') %]">
118             <thead>
119                 <tr>
120                     <td colspan='8' style='padding: 6px'>
121                         <span class="bold">[% l("Other Fees") %]</span>
122                     </td>
123                 </tr>
124                 <tr>
125                     <td width='16%'>[% l("Transaction Start Time") %]</td>
126                     <td width='16%'>[% l("Last Payment Time") %]</td>
127                     <td width='16%'>[% l("Initial Amount Owed") %]</td>
128                     <td width='16%'>[% l("Total Amount Paid") %]</td>
129                     <td width='16%'>[% l("Balance Owed") %]</td>
130                     <td width='16%'>[% l("Billing Type") %]</td>
131                     [% IF myopac_cc_allowed %]
132                     <td width='4%' align="center" nowrap="nowrap"
133                         style="white-space:nowrap;">
134                         <input id="pay_fines_box2" checked="checked"
135                             type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
136                             title="[% l('Click to (un)select all fines') %]" />
137                         <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
138                     </td>
139                     [% END %]
140                 </tr>
141             </thead>
142             <tbody id='myopac_trans_tbody'>
143                 [% FOR f IN ctx.fines.grocery %]
144                 <tr id='myopac_trans_row'>
145                     <td>[% date.format(
146                             ctx.parse_datetime(f.xact.xact_start),
147                             DATE_FORMAT
148                     ) %]</td>
149                     <td>
150                         [%  IF f.xact.last_payment_ts;
151                                 date.format(
152                                     ctx.parse_datetime(
153                                         f.xact.last_payment_ts
154                                     ), DATE_FORMAT
155                                 );
156                             END %]
157                     </td>
158                     <td>[% money(f.xact.total_owed) %]</td>
159                     <td>[% money(f.xact.total_paid) %]</td>
160                     <td class="alert">
161                         <strong>
162                             [% money(f.xact.balance_owed) %]
163                         </strong>
164                     </td>
165                     <td>[% f.xact.last_billing_type %]</td>
166                     [% IF myopac_cc_allowed %]
167                     <td>
168                         <input type="checkbox" title='[% l("Pay this fine") %]'
169                             name="xact_misc" value="[% f.xact.id %]"
170                             checked="checked" />
171                     </td>
172                     [% END %]
173                 </tr>
174                 [% END %]
175             </tbody>
176         </table>
177     </div>
178     [% END %]
179     [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
180     <div>[% l('You have no current fines.') %]</div>
181     [% ELSIF myopac_cc_allowed %]
182     <div class="text-right pad-top-ten">
183         <input type="submit"
184             value="[% l('Pay selected fines') %]"
185             title="[% l('Pay selected fines') %]"
186             class="opac-button" />
187     </div>
188     [% END %]
189 [% IF myopac_cc_allowed %]
190 </form>
191 [% END %]
192
193 [% END %]