]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/templates/opac/myopac/main.tt2
9dc672e1d93fed229dcb35dfe5bb163b4cb5a5b9
[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                         IF ts;
76                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
77                         END %]
78                     </td>
79                     <td name='myopac_circ_trans_finished'>
80                         [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
81                             IF ts;
82                                 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
83                             ELSE %]
84                             <!-- XXX TODO fines aren't really accruing
85                                 if circ has hit maxfines. more clarity
86                                 here? -->
87                             <span class="alert">[% l('(fines accruing)') %]</span>
88                         [%  END %]
89                     </td>
90                     <td>
91                         <strong class="alert">
92                             [% money(f.xact.balance_owed) %]
93                         </strong>
94                     </td>
95                     [% IF myopac_cc_allowed %]
96                     <td>
97                         <input type="checkbox" checked="checked" 
98                             title="[% l('Pay this fine') %]" name="xact"
99                             value="[% f.xact.id %]" />
100                     </td>
101                     [% END %]
102                 </tr>
103                 [% END %]
104             </tbody>
105         </table>
106     </div>
107     [% END %]
108
109     [% IF ctx.fines.grocery.size > 0 %]
110     <!-- Table for all non-circulation transactions -->
111     <div id='myopac_trans_div'>
112         <br/>
113         <hr class='opac-auto-013'  color="#dcdbdb" />
114         <br/>
115         <table width='100%' class='data_grid data_grid_center'
116             id='myopac_trans_table' title="[% l('Other Fines and Fees') %]">
117             <thead>
118                 <tr>
119                     <td colspan='8' style='padding: 6px'>
120                         <span class="bold">[% l("Other Fees") %]</span>
121                     </td>
122                 </tr>
123                 <tr>
124                     <td width='16%'>[% l("Transaction Start Time") %]</td>
125                     <td width='16%'>[% l("Last Payment Time") %]</td>
126                     <td width='16%'>[% l("Initial Amount Owed") %]</td>
127                     <td width='16%'>[% l("Total Amount Paid") %]</td>
128                     <td width='16%'>[% l("Balance Owed") %]</td>
129                     <td width='16%'>[% l("Billing Type") %]</td>
130                     [% IF myopac_cc_allowed %]
131                     <td width='4%' align="center" nowrap="nowrap"
132                         style="white-space:nowrap;">
133                         <input id="pay_fines_box2" checked="checked"
134                             type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
135                             title="[% l('Click to (un)select all fines') %]" />
136                         <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
137                     </td>
138                     [% END %]
139                 </tr>
140             </thead>
141             <tbody id='myopac_trans_tbody'>
142                 [% FOR f IN ctx.fines.grocery %]
143                 <tr id='myopac_trans_row'>
144                     <td>[% date.format(
145                             ctx.parse_datetime(f.xact.xact_start),
146                             DATE_FORMAT
147                     ) %]</td>
148                     <td>
149                         [%  IF f.xact.last_payment_ts;
150                                 date.format(
151                                     ctx.parse_datetime(
152                                         f.xact.last_payment_ts
153                                     ), DATE_FORMAT
154                                 );
155                             END %]
156                     </td>
157                     <td>[% money(f.xact.total_owed) %]</td>
158                     <td>[% money(f.xact.total_paid) %]</td>
159                     <td class="alert">
160                         <strong>
161                             [% money(f.xact.balance_owed) %]
162                         </strong>
163                     </td>
164                     <td>[% f.xact.last_billing_type %]</td>
165                     [% IF myopac_cc_allowed %]
166                     <td>
167                         <input type="checkbox" title='[% l("Pay this fine") %]'
168                             name="xact_misc" value="[% f.xact.id %]"
169                             checked="checked" />
170                     </td>
171                     [% END %]
172                 </tr>
173                 [% END %]
174             </tbody>
175         </table>
176     </div>
177     [% END %]
178     [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
179     <div>[% l('You have no current fines.') %]</div>
180     [% ELSIF myopac_cc_allowed %]
181     <div class="text-right pad-top-ten">
182         <input type="submit"
183             value="[% l('Pay selected fines') %]"
184             title="[% l('Pay selected fines') %]"
185             class="opac-button" />
186     </div>
187     [% END %]
188 [% IF myopac_cc_allowed %]
189 </form>
190 [% END %]
191
192 [% END %]