kmain-331_ecommerce_for_bibliocommons
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:07:13 +0000 (17:07 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: e3aa6e7

KCLS/openils/var/templates_kcls/opac/myopac/main_fines.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/myopac/main_payment_form.tt2
KCLS/openils/var/templates_kcls/opac/myopac/main_payments.tt2

diff --git a/KCLS/openils/var/templates_kcls/opac/myopac/main_fines.tt2 b/KCLS/openils/var/templates_kcls/opac/myopac/main_fines.tt2
new file mode 100644 (file)
index 0000000..ecec779
--- /dev/null
@@ -0,0 +1,183 @@
+
+[%  PROCESS "opac/parts/header.tt2";
+    
+    WRAPPER "opac/parts/base.tt2";
+    myopac_page = "main";
+    myopac_main_page = "main";
+%]
+
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+
+               <a href='main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_off.jpg'/></a>
+               <a href='main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_on.jpg'/></a>
+
+       </div>
+</div>
+
+<form action="[% ctx.opac_root %]/myopac/main_payment_form" method="GET" style="background:#fff">
+    [% IF ctx.fines.circulation.size > 0 %]
+    <div id='myopac_circ_trans_div'>
+        <table width='100%' class='data_grid'>
+            <thead>
+                <tr>
+                    <td colspan='10' style='padding: 6px'>
+                        <strong>[% l("Fines") %]</strong>
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l("Title") %]</td>
+                    <td>[% l("Author") %]</td>
+                    <td>[% l("Checkout Date") %]</td>
+                    <td>[% l("Due Date") %]</td>
+                    <td>[% l("Date Returned") %]</td>
+                    <td>[% l("Balance Owed") %]</td>
+                    <td nowrap="nowrap" style="white-space:nowrap;">
+                        <input id="pay_fines_box1" checked="checked"
+                            type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"
+                            title="[% l('Click to (un)select all fines') %]" />
+                        <label for="pay_fines_box1">[% l('Pay Fines') %]</label>
+                    </td>
+                </tr>
+            </thead>
+            <tbody id='myopac_circ_trans_tbody'>
+                [% FOR f IN ctx.fines.circulation;
+                    NEXT IF f.xact.balance_owed < 0; # XXX middle layer
+                    attrs = {marc_xml => f.marc_xml};
+                    IF f.marc_xml;
+                        PROCESS get_marc_attrs args=attrs;
+                    ELSIF f.xact.reservation;
+                        attrs.title = f.xact.reservation.target_resource_type.name;
+                    END %]
+                <tr id='myopac_circ_trans_row'>
+                    <td>
+                        [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
+                        IF recid; %]
+                        <a href="[% ctx.opac_root %]/record/[% recid %]">[% attrs.title | html %]</a>
+                        [% ELSE %]
+                        [% attrs.title | html %]
+                        [% END %]
+                    </td>
+                    <td>
+                        <a href="[% ctx.opac_root %]/results?qtype=author&amp;query=[% attrs.author | replace('[,\.:;]', '') | url %]">[% attrs.author | html %]</a>
+                    </td>
+                    <td name='myopac_circ_trans_start'>
+                        [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;
+                        IF ts;
+                            date.format(ctx.parse_datetime(ts), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td name='myopac_circ_trans_due'>
+                        [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;
+                        IF ts;
+                            date.format(ctx.parse_datetime(ts), DATE_FORMAT);
+                        END %]
+                    </td>
+                    <td name='myopac_circ_trans_finished'>
+                        [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;
+                            IF ts;
+                                date.format(ctx.parse_datetime(ts), DATE_FORMAT);
+                            ELSE %]
+                            <!-- XXX TODO fines aren't really accruing
+                                if circ has hit maxfines. more clarity
+                                here? -->
+                            <span class="red">[% l('(fines accruing)') %]</span>
+                        [%  END %]
+                    </td>
+                    <td>
+                        <strong class="red">
+                            [% money(f.xact.balance_owed) %]
+                        </strong>
+                    </td>
+                    <td>
+                        <input type="checkbox" checked="checked" 
+                            title="[% l('Pay this fine') %]" name="xact"
+                            value="[% f.xact.id %]" />
+                    </td>
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+    </div>
+    [% END %]
+
+    [% IF ctx.fines.grocery.size > 0 %]
+    <!-- Table for all non-circulation transactions -->
+    <div id='myopac_trans_div'>
+        <br/>
+        <hr class='opac-auto-013'  color="#dcdbdb" />
+        <br/>
+        <table width='100%' class='data_grid data_grid_center'
+            id='myopac_trans_table'>
+            <thead>
+                <tr>
+                    <td colspan='8' style='padding: 6px'>
+                        <b>[% l("Other Fees") %]</b>
+                    </td>
+                </tr>
+                <tr>
+                    <td width='16%'>[% l("Transaction Start Time") %]</td>
+                    <td width='16%'>[% l("Last Payment Time") %]</td>
+                    <td width='16%'>[% l("Initial Amount Owed") %]</td>
+                    <td width='16%'>[% l("Total Amount Paid") %]</td>
+                    <td width='16%'>[% l("Balance Owed") %]</td>
+                    <td width='16%'>[% l("Billing Type") %]</td>
+                    <td width='4%' align="center" nowrap="nowrap"
+                        style="white-space:nowrap;">
+                        <input id="pay_fines_box2" checked="checked"
+                            type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
+                            title="[% l('Click to (un)select all fines') %]" />
+                        <label for="pay_fines_box2">[% l("Pay Fines") %]</label>
+                    </td>
+                </tr>
+            </thead>
+            <tbody id='myopac_trans_tbody'>
+                [% FOR f IN ctx.fines.grocery %]
+                    [% NEXT IF f.xact.balance_owed < 0 %] <!-- XXX middle layer -->
+                <tr id='myopac_trans_row'>
+                    <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>[% 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>[% f.xact.last_billing_type %]</td>
+                    <td>
+                        <input type="checkbox" title='[% l("Pay this fine") %]'
+                            name="xact_misc" value="[% f.xact.id %]"
+                            checked="checked" />
+                    </td>
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+    </div>
+    [% END %]
+    [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]
+    <div>[% l('You have no current fines.') %]</div>
+    [% ELSE %]
+    <div class="text-right pad-top-ten">
+        <input type="image"
+            alt="[% l('Pay selected fines') %]"
+            title="[% l('Pay selected fines') %]"
+            onmouseover="this.src='[% ctx.media_prefix %]/images/pay-fines-btn-hover.png';"
+            onmouseout="this.src='[% ctx.media_prefix %]/images/pay-fines-btn.png';"
+            src="[% ctx.media_prefix %]/images/pay-fines-btn.png" />
+    </div>
+    [% END %]
+</form>
+[% END %]
index daee808..082af0e 100644 (file)
@@ -1,19 +1,26 @@
-[%  PROCESS "opac/parts/header.tt2";
-    PROCESS "opac/parts/misc_util.tt2";
-    WRAPPER "opac/parts/myopac/main_base.tt2";
-    myopac_page = "main";
-    myopac_main_page = "payment_form";
+[%  
 
+    WRAPPER "opac/parts/base.tt2";
     last_chance = CGI.param("last_chance");
 
 %]
+
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+
+               <a href='main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_on.jpg'/></a>
+               <a href='main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_off.jpg'/></a>
+
+       </div>
+</div>
+
 [% IF ctx.fines.balance_owed <= 0 %]
 <div>
     [% l("You either have no fines to pay or you have selected fines whose " _
         "total is non-positive.  We cannot process non-positive amounts.") %]
 </div>
 [% ELSE %]
-<div id="pay_fines_now">
+<div id="pay_fines_now" style="background:#fff">
     [% IF last_chance %]
     <p><big>[% l("Are you sure you are ready to charge [_1] to your credit card?", money(ctx.fines.balance_owed)) %]</big></p>
     <form action="[% ctx.opac_root %]/myopac/main_pay_init" method="POST">
index 6de3bbb..cfbf56b 100644 (file)
@@ -1,13 +1,20 @@
-[%  PROCESS "opac/parts/header.tt2";
-    PROCESS "opac/parts/misc_util.tt2";
-    WRAPPER "opac/parts/myopac/main_base.tt2";
-    myopac_page = "main";
-    myopac_main_page = "payments";
+[%  
+    WRAPPER "opac/parts/base.tt2";
+
     limit = ctx.payment_history_limit;
     offset = ctx.payment_history_offset;
 %]
 
-<div>
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+
+               <a href='main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_on.jpg'/></a>
+               <a href='main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_off.jpg'/></a>
+
+       </div>
+</div>
+
+<div style="background:#fff">
     <div class="header_middle">
         <span class="float-left">[% l('Payments History') %]</span>
         <span class='float-left' style='padding-left: 10px;'>