]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/web/templates/default/opac/myopac/main.tt2
Merge branch 'master' of git.evergreen-ils.org:Evergreen into template-toolkit-opac
[working/Evergreen.git] / Open-ILS / web / templates / default / opac / myopac / main.tt2
1 [%  PROCESS "default/opac/parts/header.tt2";
2     PROCESS "default/opac/parts/misc_util.tt2";
3     WRAPPER "default/opac/parts/myopac/main_base.tt2";
4     myopac_page = "main";
5     myopac_main_page = "main";
6 %]
7 <form action="[% ctx.opac_root %]/myopac/main_payment_form" method="GET">
8     [% IF ctx.fines.circulation.size > 0 %]
9     <div id='myopac_circ_trans_div'>
10         <table width='100%' class='data_grid'>
11             <thead>
12                 <tr>
13                     <td colspan='10' style='padding: 6px'>
14                         <strong>[% l("Fines") %]</strong>
15                     </td>
16                 </tr>
17                 <tr>
18                     <td>[% l("Title") %]</td>
19                     <td>[% l("Author") %]</td>
20                     <td>[% l("Checkout Date") %]</td>
21                     <td>[% l("Due Date") %]</td>
22                     <td>[% l("Date Returned") %]</td>
23                     <td>[% l("Balance Owed") %]</td>
24                     <td nowrap="nowrap" style="white-space:nowrap;">
25                         <!-- XXX TODO select all js --><input id="pay_fines_box1" checked="checked"
26                             type="checkbox" title="[% l('Click to (un)select all fines') %]" />
27                         <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
28                     </td>
29                 </tr>
30             </thead>
31             <tbody id='myopac_circ_trans_tbody'>
32                 [% FOR f IN ctx.fines.circulation;
33                     attrs = {marc_xml => f.marc_xml};
34                     IF f.marc_xml;
35                         PROCESS get_marc_attrs args=attrs;
36                     ELSIF f.xact.reservation;
37                         attrs.title = f.xact.reservation.target_resource_type.name;
38                     END %]
39                 <tr id='myopac_circ_trans_row'>
40                     <td>
41                         [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
42                         IF recid; %]
43                         <a href="[% ctx.opac_root %]/record/[% recid %]">[% attrs.title %]</a>
44                         [% ELSE %]
45                         [% attrs.title %]
46                         [% END %]
47                     </td>
48                     <td>
49                         <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author %]</a>
50                     </td>
51                     <td name='myopac_circ_trans_start'>
52                         [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
53                         IF ts;
54                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
55                         END %]
56                     </td>
57                     <td name='myopac_circ_trans_due'>
58                         [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
59                         IF ts;
60                             date.format(ctx.parse_datetime(ts), DATE_FORMAT);
61                         END %]
62                     </td>
63                     <td name='myopac_circ_trans_finished'>
64                         [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
65                             IF ts;
66                                 date.format(ctx.parse_datetime(ts), DATE_FORMAT);
67                             ELSE %]
68                             <!-- XXX TODO fines aren't really accruing
69                                 if circ has hit maxfines. more clarity
70                                 here? -->
71                             <span class="red">[% l('(fines accruing)') %]</span>
72                         [%  END %]
73                     </td>
74                     <td>
75                         <strong class="red">
76                             [% money(f.xact.balance_owed) %]
77                         </strong>
78                     </td>
79                     <td>
80                         <input type="checkbox" checked="checked" 
81                             title="[% l('Pay this fine') %]" name="xact" value="[% f.xact.id %]" />
82                     </td>
83                 </tr>
84                 [% END %]
85             </tbody>
86         </table>
87     </div>
88     [% END %]
89
90     [% IF ctx.fines.grocery.size > 0 %]
91     <!-- Table for all non-circulation transactions -->
92     <div id='myopac_trans_div'>
93         <br/>
94         <hr class='opac-auto-013'  color="#dcdbdb" />
95         <br/>
96         <table width='100%' class='data_grid data_grid_center'
97             id='myopac_trans_table'>
98             <thead>
99                 <tr>
100                     <td colspan='8' style='padding: 6px'>
101                         <b>[% l("Other Fees") %]</b>
102                     </td>
103                 </tr>
104                 <tr>
105                     <td width='16%'>[% l("Transaction Start Time") %]</td>
106                     <td width='16%'>[% l("Last Payment Time") %]</td>
107                     <td width='16%'>[% l("Initial Amount Owed") %]</td>
108                     <td width='16%'>[% l("Total Amount Paid") %]</td>
109                     <td width='16%'>[% l("Balance Owed") %]</td>
110                     <td width='16%'>[% l("Billing Type") %]</td>
111                     <td width='4%' align="center" nowrap="nowrap"
112                         style="white-space:nowrap;">
113                         <input id="pay_fines_box2" checked="checked"
114                             type="checkbox"
115                             title="[% l('Click to (un)select all fines') %]" />
116                         <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
117                     </td>
118                 </tr>
119             </thead>
120             <tbody id='myopac_trans_tbody'>
121                 [% FOR f IN ctx.fines.grocery %]
122                 <tr id='myopac_trans_row'>
123                     <td>[% date.format(
124                             ctx.parse_datetime(f.xact.xact_start),
125                             DATE_FORMAT
126                     ) %]</td>
127                     <td>
128                         [%  IF f.xact.last_payment_ts;
129                                 date.format(
130                                     ctx.parse_datetime(
131                                         f.xact.last_payment_ts
132                                     ), DATE_FORMAT
133                                 );
134                             END %]
135                     </td>
136                     <td>[% money(f.xact.total_owed) %]</td>
137                     <td>[% money(f.xact.total_paid) %]</td>
138                     <td class="red">
139                         <strong>
140                             [% money(f.xact.balance_owed) %]
141                         </strong>
142                     </td>
143                     <td>[% f.xact.last_billing_type %]</td>
144                     <td>
145                         <input type="checkbox" title='[% l("Pay this fine") %]'
146                             name="xact" value="[% f.xact.id %]" />
147                     </td>
148                 </tr>
149                 [% END %]
150             </tbody>
151         </table>
152     </div>
153     [% END %]
154     [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
155     <div>[% l('You have no current fines.') %]</div>
156     [% ELSE %]
157     <div class="text-right pad-top-ten">
158         <input type="image"
159             alt="[% l('Pay selected fines') %]"
160             title="[% l('Pay selected fines') %]"
161             onmouseover="this.src='[% ctx.media_prefix %]/images/pay-fines-btn-hover.png';"
162             onmouseout="this.src='[% ctx.media_prefix %]/images/pay-fines-btn.png';"
163             src="[% ctx.media_prefix %]/images/pay-fines-btn.png" />
164     </div>
165     [% END %]
166 </form>
167 [% END %]