show grocery fines; define date format in a single location
authorsenator <lebbeous@esilibrary.com>
Tue, 15 Feb 2011 15:31:44 +0000 (10:31 -0500)
committersenator <lebbeous@esilibrary.com>
Tue, 15 Feb 2011 15:31:44 +0000 (10:31 -0500)
Open-ILS/web/templates/default/opac/myopac/circs.tt2
Open-ILS/web/templates/default/opac/myopac/holds.tt2
Open-ILS/web/templates/default/opac/myopac/main.tt2
Open-ILS/web/templates/default/opac/parts/header.tt2

index c56b23e..77ba056 100644 (file)
                         </td>
                         <td width="13%" style="padding-left:5px;"
                             name="due_date">
-                            [% date.format(ctx.parse_datetime(circ.circ.due_date),'%m/%d/%Y') %]
+                            [% date.format(ctx.parse_datetime(circ.circ.due_date),DATE_FORMAT) %]
                         </td>
                         <td width="16%" name="barcode">
                             [% circ.circ.target_copy.barcode %]
index 1dd741f..6c6cafe 100644 (file)
                             name="activate_box" type="text" />
                         [% IF hold.hold.hold.frozen == 't' AND
                                 hold.hold.hold.thaw_date;
-                            date.format(ctx.parse_datetime(hold.hold.hold.thaw_date), '%m/%d/%Y');
+                            date.format(ctx.parse_datetime(hold.hold.hold.thaw_date), DATE_FORMAT);
                         END %]
                     </td>
                     <td width="106">
                             class="hide_me" style="width:91px;"
                             name="hold_expires_box" type="text" />
                         [% IF hold.hold.hold.expire_time;
-                            date.format(ctx.parse_datetime(hold.hold.hold.expire_time), '%m/%d/%Y');
+                            date.format(ctx.parse_datetime(hold.hold.hold.expire_time), DATE_FORMAT);
                         END %]
                     </td>
                     <td width="95">
index cea25a8..b6a53df 100644 (file)
                                 [% date.format(
                                     ctx.parse_datetime(
                                         f.xact.circulation.xact_start
-                                    ), "%m/%d/%Y"
+                                    ), DATE_FORMAT
                                 ) %]
                             </td>
                             <td name='myopac_circ_trans_due'>
                                 [% date.format(
                                     ctx.parse_datetime(
                                         f.xact.circulation.due_date
-                                    ), "%m/%d/%Y"
+                                    ), DATE_FORMAT
                                 ) %]
                             </td>
                             <td name='myopac_circ_trans_finished'>
                                         date.format(
                                             ctx.parse_datetime(
                                                 f.xact.circulation.checkin_time
-                                            ), "%m/%d/%Y"
+                                            ), DATE_FORMAT
                                         );
                                     ELSE %]
                                     <!-- XXX TODO fines aren't really accruing
                             </td>
                             <td align="center">
                                 <input type="checkbox" checked="checked"
-                                    name="selector" title="pay this fine" />
+                                    name="selector"
+                                    title="[% l('Pay this fine') %]" />
                             </td>
                         </tr>
                         [% END %]
             </div>
         [% END %]
 
+        [% IF ctx.fines.grocery.size > 0 %]
             <!-- Table for all non-circulation transactions -->
-            <div id='myopac_trans_div' class='hide_me'>
+            <div id='myopac_trans_div'>
                 <br/>
                 <hr style="border-bottom:none;*height:0px;" color="#dcdbdb" />
                 <br/>
                             <td width='16%'>[% l("Billing Type") %]</td>
                             <td width='4%' align="center" nowrap="nowrap"
                                 style="white-space:nowrap;">
-                                <label for="pay_fines_box2">Pay Fines</label>
+                                <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
                                 <br />
                                 <input id="pay_fines_box2" checked="checked"
                                     type="checkbox"
-                                    title="Click to (un)select all fines" />
+                                    title="[% l('Click to (un)select all fines') %]" />
                             </td>
                         </tr>
                     </thead>
                     <tbody id='myopac_trans_tbody'>
+                        [% FOR f IN ctx.fines.grocery %]
                         <tr id='myopac_trans_row'>
-                            <td name='myopac_trans_start'> </td>
-                            <td name='myopac_trans_last_payment'> </td>
-                            <td name='myopac_trans_init_amount'>
-                                [% l("\$") %]
-                            </td>
-                            <td name='myopac_trans_total_paid'>
-                                [% l("\$") %]
+                            <td>[% date.format(
+                                    ctx.parse_datetime(f.xact.xact_start),
+                                    DATE_FORMAT
+                            ) %]</td>
+                            <td>
+                                [%  IF f.xact.last_payment_ts;
+                                        date.format(
+                                            ctx.parse_datetime(
+                                                f.xact.last_payment_ts
+                                            ), DATE_FORMAT
+                                        );
+                                    END %]
                             </td>
-                            <td style='color:red; font-weight: bold;'>
-                                <span name='myopac_trans_balance_recur'
-                                    class='hide_me'> * </span>
-                                <span name='myopac_trans_balance'>
-                                    [% l("\$") %]
-                                </span>
+                            <td>[% money(f.xact.total_owed) %]</td>
+                            <td>[% money(f.xact.total_paid) %]</td>
+                            <td class="red">
+                                <strong>
+                                    [% money(f.xact.balance_owed) %]
+                                </strong>
                             </td>
-                            <td name='myopac_trans_bill_type'></td>
+                            <td>[% f.xact.last_billing_type %]</td>
                             <td align="center">
                                 <input type="checkbox" name='selector'
-                                    title='pay this fine' checked="checked" />
+                                    title='[% l("Pay this fine") %]'
+                                    checked="checked" />
                             </td>
                         </tr>
+                        [% END %]
                     </tbody>
                 </table>
             </div>
+            [% END %]
             <a href="#"><img alt="Pay Fines"
                 onmouseover="this.src='[% ctx.media_prefix %]/images/pay-fines-btn-hover.png';"
                 src="[% ctx.media_prefix %]/images/pay-fines-btn.png"
index 08f0854..4f72639 100644 (file)
@@ -1,4 +1,6 @@
 [%- USE money = format('$%.2f');
     USE date;
     USE CGI; 
-    USE EGI18N; -%]
+    USE EGI18N;
+    SET DATE_FORMAT = '%m/%d/%Y';
+-%]