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