KMAIN-593: Move all BiblioCommons related files to opac/biblio/
authorBill Erickson <berickxx@gmail.com>
Wed, 29 Oct 2014 21:08:45 +0000 (17:08 -0400)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
    Cross-port: 67a95ba

Conflicts:
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm

14 files changed:
KCLS/openils/var/templates_kcls/opac/biblio/base.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/login.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/main_pay.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/main_pay_init.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/main_payment_form.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/main_payments.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/main_refund_policy.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/receipt_email.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/receipt_print.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/tester.tt2 [new file with mode: 0644]
KCLS/openils/var/templates_kcls/opac/biblio/topnav_logo.tt2 [new file with mode: 0644]
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader.pm
Open-ILS/src/perlmods/lib/OpenILS/WWW/EGCatLoader/Account.pm

diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/base.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/base.tt2
new file mode 100644 (file)
index 0000000..99b2565
--- /dev/null
@@ -0,0 +1,20 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns='http://www.w3.org/1999/xhtml' lang='[% ctx.locale %]' xml:lang='[% ctx.locale %]'>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
+        [% IF ctx.refresh %]
+        <meta http-equiv="refresh" content="[% ctx.refresh %]">
+        [% ELSIF ctx.authtime %]
+        <meta http-equiv="refresh" content="[% ctx.authtime %]; url=[% ctx.logout_page %]">
+        [% END %]
+        <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/semiauto.css" />
+        <link rel="stylesheet" type="text/css" href="[% ctx.media_prefix %]/css/skin/default/opac/style.css" />
+        <title>[% l('BiblioCommons E-Commerce - KCLS') %]</title>
+        <link rel="unapi-server" type="application/xml" title="unAPI" href="/opac/extras/unapi" />
+        [% INCLUDE 'opac/parts/goog_analytics.tt2' %]
+    </head>
+    <body>
+               [% INCLUDE 'opac/parts/js.tt2' %]
+        [% content %] 
+    </body>
+</html>
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/login.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/login.tt2
new file mode 100644 (file)
index 0000000..64b28a0
--- /dev/null
@@ -0,0 +1,31 @@
+[%  
+       PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/biblio/base.tt2";
+
+    ctx.page_title = l("Account Login") %]
+    <div id="header">
+               <div class="float-left">
+                       [% INCLUDE "opac/parts/biblio_topnav_logo.tt2" %]
+               </div>
+               <div class="common-no-pad"></div>
+    </div>
+    <div id="content-wrapper">
+        <div id="main-content">
+            [% INCLUDE "opac/parts/login/form.tt2" %]
+            <div class="clear-both very-big-height"></div>     
+            <script type="text/javascript">
+                /* Note: when common browsers support HTML5 "autofocus", we can remove this */
+                var _onload = window.onload;
+                window.onload = function() {
+                    try {
+                        document.getElementById("username_field").focus();
+                        if (_onload) _onload();
+                    } catch (E) {
+                        void(0);
+                    }
+                };
+            </script>
+        </div>
+    </div>
+[% END %]
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_fines.tt2
new file mode 100644 (file)
index 0000000..c800fc3
--- /dev/null
@@ -0,0 +1,184 @@
+
+[%
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/biblio/base.tt2";
+    PROCESS "opac/parts/header.tt2";
+    myopac_page = "main";
+    myopac_main_page = "main";
+%]
+<div id="header">
+       <div class="float-left">
+               [% INCLUDE "opac/biblio/topnav_logo.tt2" %]
+       </div>
+       <div class="common-no-pad"></div>
+</div>
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+
+               <a href='[% ctx.opac_root %]/biblio/main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_on.jpg'/></a>
+               <a href='[% ctx.opac_root %]/biblio/main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_off.jpg'/></a>
+
+       </div>
+</div>
+
+<form action="[% ctx.opac_root %]/biblio/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>
+                        [% attrs.title | html %]
+                    </td>
+                    <td>
+                        [% attrs.author | html %]
+                    </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 %]
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_pay.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_pay.tt2
new file mode 100644 (file)
index 0000000..617d69d
--- /dev/null
@@ -0,0 +1,72 @@
+[%
+    WRAPPER "opac/biblio/base.tt2";
+    PROCESS "opac/parts/header.tt2";
+%]
+
+<div id="header">
+       <div class="float-left">
+               [% INCLUDE "opac/biblio/topnav_logo.tt2" %]
+       </div>
+       <div class="common-no-pad"></div>
+</div>
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+
+               <a href='[% ctx.opac_root %]/biblio/main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_on.jpg'/></a>
+               <a href='[% ctx.opac_root %]/biblio/main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_off.jpg'/></a>
+
+       </div>
+</div>
+
+<div id="myopac_summary_div" style="background-color:#FFF;">
+
+    [% IF ctx.payment_response.textcode %]
+        <div class="payment-error">
+            <span title="[% ctx.payment_response.textcode %]">
+                [% ctx.payment_response.desc || ctx.payment_response.textcode %]
+            </span><br />
+            [% ctx.payment_response.note %]
+            [% ctx.payment_response.payload.error_message %]
+        </div>
+        <p>
+            [%
+                url_args = {xact => [], xact_misc => []};
+                FOR k IN ['xact', 'xact_misc'];
+                    FOR val IN CGI.param(k);
+                        url_args.$k.push(val);
+                    END;
+                END;
+                retry_url =  mkurl(ctx.opac_root _ '/biblio/main_payment_form', url_args, 1);
+            %]
+            <br/>
+            <a href="[% retry_url %]">[% l('Go back') %]</a>
+            [% l('to try again or to cancel this payment attempt.') %]
+        </p>
+    [% ELSE %]
+        <p><big>[% l('Your payment has been approved.') %]</big></p>
+        [% IF ctx.printable_receipt.template_output;
+            print_args = [];
+            FOR p IN ctx.payment_response.payments;
+                print_args.push('payment=' _ p);
+            END %]
+        <p>[ <a href="[% ctx.opac_root %]/biblio/receipt_print?[% print_args.join('&amp;') %]"
+            target="_egrecpt"
+            onclick="try { print_node('printable-receipt'); } catch (e) { window.print(); } return false;">[% l('Print receipt') %]</a> ]</p>
+        <tt id="printable-receipt">
+            [% ctx.printable_receipt.template_output.data %]
+        </tt>
+        [% ELSE %]
+        <div class="payment-error">
+            [% l(
+                'Error creating receipt: [_1]',
+                    (ctx.printable_receipt.textcode ? ctx.printable_receipt.textcode _ ' / ' _ ctx.printable_receipt.desc : 0) ||
+                    ctx.printable_receipt.error_output.data ||
+                    l('No receipt data returned from server')
+                ) | html %]
+        </div>
+        [% END %]
+        <p>[ <a href="[% ctx.opac_root %]/biblio/main_fines">[%
+            l("Back to Account Summary") %]</a> ]</p>
+    [% END %]
+</div>
+[% END %]
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_pay_init.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_pay_init.tt2
new file mode 100644 (file)
index 0000000..6cb82e0
--- /dev/null
@@ -0,0 +1,30 @@
+[%
+    WRAPPER "opac/biblio/base.tt2";
+    PROCESS "opac/parts/header.tt2";
+%]
+
+<div id="header">
+       <div class="float-left">
+               [% INCLUDE "opac/biblio/topnav_logo.tt2" %]
+       </div>
+       <div class="common-no-pad"></div>
+</div>
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+
+               <a href='[% ctx.opac_root %]/biblio/main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_on.jpg'/></a>
+               <a href='[% ctx.opac_root %]/biblio/main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_off.jpg'/></a>
+
+       </div>
+</div>
+    
+<div id="myopac_summary_div" style="background-color:#FFF;">
+
+    <div class="payment-processing">
+        [% l('Processing...') %] <br/><br/>
+        [% l('Processing your payment may take some time.') %]<br/>
+        [% l("Please do not Refresh or use your browser's Back button or your credit card may be charged more than once.") %]<br/>
+    </div>
+
+</div>
+[% END %]
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_payment_form.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_payment_form.tt2
new file mode 100644 (file)
index 0000000..97dd7e4
--- /dev/null
@@ -0,0 +1,198 @@
+[%
+    PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/biblio/base.tt2";
+    last_chance = CGI.param("last_chance");
+%]
+<div id="header">
+       <div class="float-left">
+               [% INCLUDE "opac/biblio/topnav_logo.tt2" %]
+       </div>
+       <div class="common-no-pad"></div>
+</div>
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+               <a href='[% ctx.opac_root %]/biblio/main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_off.jpg'/></a>
+               <a href='[% ctx.opac_root %]/biblio/main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_on.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" 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 %]/biblio/main_pay_init" method="POST">
+        [% FOR k IN CGI.Vars;
+            NEXT UNLESS k;
+            FOR val IN CGI.param(k) %]
+        <input type="hidden" name="[% k | html %]" value="[% val | html %]" />
+        [% END; END %]
+        <input type="submit" value="[% l('Submit Payment') %]" />
+        <a href="[% mkurl(ctx.opac_root _ '/biblio/main_fines', {}, 1) %]">[% l('Cancel') %]</a>
+    [% ELSE %]
+    <form method="POST" id='cc-form'>
+        <input type="hidden" name="last_chance" value="1" />
+        [% FOR xact IN CGI.param('xact') %]
+        <input type="hidden" name="xact" value="[% xact | html %]" />
+        [% END %]
+        [% FOR xact IN CGI.param('xact_misc') %]
+        <input type="hidden" name="xact_misc" value="[% xact | html %]" />
+        [% END %]
+
+        <br/>
+        <h2>[% l('KCLS only accepts Visa or MasterCard') %]</h2>
+        <table>
+            <tbody>
+                <tr>
+                    <td colspan='2'><strong>[% l('Billing Information') %]</strong></td>
+                    <td rowspan='13' valign='top'>
+                        <p>[% l('Selected fines you are paying for:') %]</p>
+                        <table cellpadding="0" cellspacing="0" border="0" class="myopac_payments_table">
+                            <thead>
+                                <tr>
+                                    <th>[% l('Name') %]</th>
+                                    <th>[% l('Amount') %]</th>
+                                </tr>
+                            </thead>
+                            <tbody>
+                            [%
+                            FOR f IN ctx.fines.circulation;
+                                NEXT IF CGI.param('xact').size &&
+                                    !CGI.param('xact').grep(f.xact.id).size;
+                                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>
+                                    <td>[% attrs.title | html %]</td>
+                                    <td class="text-right">[% money(f.xact.balance_owed) %]</td>
+                                </tr>
+                            [%
+                            END;
+                            FOR f IN ctx.fines.grocery;
+                                NEXT IF CGI.param('xact_misc').size &&
+                                    !CGI.param('xact_misc').grep(f.xact.id).size %]
+                                <tr>
+                                    <td>[% f.xact.last_billing_type | html %]</td>
+                                    <td class="text-right">[% money(f.xact.balance_owed) %]</td>
+                                </tr>
+                            [% END %]
+                            </tbody>
+                        </table>
+                        <br />
+                        <div>
+                            [% l('Total amount to pay:') %]
+                            <strong>[% money(ctx.fines.balance_owed) %]</strong>
+                        </div>
+                        <br />
+                        [% | l('<strong>', '</strong>') %]Click [_1]Cancel[_2] to go back and (un)select other fines.[% END %]
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('First Name') %]</td>
+                    <td><input type="text" name="billing_first" value="[% ctx.user.first_given_name | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('Last Name') %]</td>
+                    <td><input type="text" name="billing_last" value="[% ctx.user.family_name | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('Email Address') %]</td>
+                    <td>
+                        <input type="text" disabled="disabled" readonly="readonly" value="[% ctx.user.email | html %]" />
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Street Address') %]</td>
+                    <td><input type="text" name="billing_address" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('City' )%]</td>
+                    <td><input type="text" name="billing_city" value="[% ctx.user.billing_address.city | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('State or Province') %]</td>
+                    <td><input type="text" name="billing_state" value="[% ctx.user.billing_address.state | html %]" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('ZIP or Postal Code') %]</td>
+                    <td><input type="text" name="billing_zip" value="[% ctx.user.billing_address.post_code | html %]" /></td>
+                </tr>
+                <tr>
+                  <td colspan='2'><strong>[% l('Credit Card Information') %]</strong></td>
+                </tr>
+                <!-- Technically not needed since card type is derived from the CC number
+                <tr>
+                    <td>Type of Card</td>
+                    <td>
+                        <select name="type">
+                            <option value='VISA'>VISA</option>
+                            <option value='MasterCard'>MasterCard</option>
+                            <option value='American Express'>American Express</option>
+                        </select>
+                    </td>
+                </tr>
+                -->
+                <tr>
+                    <td>[% l('Credit Card #') %]</td>
+                    <td><input type="text" name="number" maxlength="16" /></td>
+                </tr>
+                <tr>
+                    <td>[% l('Security Code') %]</td>
+                    <td>
+                        <input type="text" size="4" maxlength="5" name="cvv2" />
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Expiration Month') %]</td>
+                    <td>
+                        <select name="expire_month">
+                            <option value="01">[% l("January") %]</option>
+                            <option value="02">[% l("February") %]</option>
+                            <option value="03">[% l("March") %]</option>
+                            <option value="04">[% l("April") %]</option>
+                            <option value="05">[% l("May") %]</option>
+                            <option value="06">[% l("June") %]</option>
+                            <option value="07">[% l("July") %]</option>
+                            <option value="08">[% l("August") %]</option>
+                            <option value="09">[% l("September") %]</option>
+                            <option value="10">[% l("October") %]</option>
+                            <option value="11">[% l("November") %]</option>
+                            <option value="12">[% l("December") %]</option>
+                        </select>
+                    </td>
+                </tr>
+                <tr>
+                    <td>[% l('Expiration Year') %]</td>
+                    <td>
+                        <select name="expire_year">
+                        [% year = date.format(date.now, '%Y');
+                        y = year;
+                        WHILE y < year + 10; # show ten years starting now %]
+                            <option value="[% y %]">[% y %]</option>
+                        [% y = y + 1; END %]
+                        </select>
+                    </td>
+                </tr>
+                <tr>
+                    <td colspan='2' align="center">
+                        <input type="submit" value="[% l('Next') %]" onclick='return check_cc_params()'/>
+                        <a href="[% mkurl(ctx.opac_root _ '/biblio/main_fines', {}, 1) %]">[% l('Cancel') %]</a>
+                    </td>
+                </tr>
+                [% INCLUDE "opac/biblio/main_refund_policy.tt2" %]
+            </tbody>
+        </table>
+    [% END %]
+    </form>
+</div>
+<script src='/js/ui/default/opac/kcls.js'></script>
+[% END %]
+[% END %]
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_payments.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_payments.tt2
new file mode 100644 (file)
index 0000000..3d85505
--- /dev/null
@@ -0,0 +1,75 @@
+[%  
+    WRAPPER "opac/biblio/base.tt2";
+    PROCESS "opac/parts/header.tt2";
+    limit = ctx.payment_history_limit;
+    offset = ctx.payment_history_offset;
+%]
+<div id="header">
+       <div class="float-left">
+               [% INCLUDE "opac/biblio/topnav_logo.tt2" %]
+       </div>
+       <div class="common-no-pad"></div>
+</div>
+<div id='fines_payments_wrapper'>
+       <div id='acct_fines_tabs'>
+
+               <a href='[% ctx.opac_root %]/biblio/main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_off.jpg'/></a>
+               <a href='[% ctx.opac_root %]/biblio/main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_on.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;'>
+            <a href='[% ctx.opac_root %]/biblio/main_payments?limit=[% limit %]&amp;offset=[% offset - limit %]'
+                [% IF offset == 0 %] class='invisible' [% END %]><span class="nav_arrow_fix">&#9668;</span>[% l('Previous') %]</a>
+            [%# TODO: get total to prevent paging off then end of the list.. %]
+            <a href='[% ctx.opac_root %]/biblio/main_payments?limit=[% limit %]&amp;offset=[% offset + limit %]'
+               [% IF ctx.payments.size < limit %] class='invisible' [% END %] >[% l('Next') %]<span class="nav_arrow_fix">&#9658;</span></a>
+        </span>
+    </div>
+    <div class="clear-both"></div>
+
+    [% IF ctx.payments.size %]
+    <table class='myopac_payments_table data_grid' width='100%'>
+        <thead><tr>
+            <th>[% l('Payment Date') %]</th>
+            <th>[% l('Payment For') %]</th>
+            <th>[% l('Amount') %]</th>
+            <th>[% l('Receipt') %]</th> 
+        </tr></thead>
+        <tbody>
+            [% FOR payment IN ctx.payments %]
+                [% IF payment.mp.amount > 0 %]
+                    <tr>
+                        <td>[% date.format(ctx.parse_datetime(payment.mp.payment_ts), DATE_FORMAT) %]</td>
+                        <td>[%
+                            btype = payment.last_billing_type | html;
+                            ptitle = payment.title | html;
+                            (payment.xact_type == 'grocery') ? btype : ptitle
+                        %]</td>
+                        <td>[% money(payment.mp.amount) %]</td>
+                        <td>
+                            [% IF payment.mp.payment_type == 'credit_card_payment' %]
+                            <form action="[% ctx.opac_root %]/biblio/receipt_print" method="POST">
+                                <input type="hidden" name="payment" value="[% payment.mp.id %]" />
+                                <input type="submit" value="[% l('Print') %]" />
+                            </form>
+                            <form action="[% ctx.opac_root %]/biblio/receipt_email" method="POST">
+                                <input type="hidden" name="payment" value="[% payment.mp.id %]" />
+                                <input type="submit" value="[% l('Email') %]" />
+                            </form>
+                            [% END %]
+                        </td>
+                    </tr>
+                [% END %]
+            [% END %]
+        </tbody>
+    </table>
+    [% ELSE %]
+    <div>[% l('You have no historical payments to display.') %]</div>
+    [% END %]
+</div>
+[% END %]
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/main_refund_policy.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/main_refund_policy.tt2
new file mode 100644 (file)
index 0000000..0a22d81
--- /dev/null
@@ -0,0 +1,24 @@
+<tr>
+    <td colspan="3">
+        <br />
+        <strong style="color:red;font-size:16px;">
+        Important! You must have a printed receipt to be
+        eligible for a refund on lost items (regulations allow
+        for no exceptions).
+        </strong>
+        <br />
+        <br />
+        <strong>
+            To ensure you have the necessary documentation if a refund is wanted, 
+            make certain you have a printed receipt in hand before closing the payment receipt screen.
+        </strong>
+        <br />
+        Refunds are not available for parts and pieces, overdue
+        fines, or items that do not display a specific title in
+        My Account. For a full list of refundable and
+        non-refundable items, visit
+        <a href="http://www.kcls.org/usingthelibrary/borrowing/refundable.cfm">http://www.kcls.org/usingthelibrary/borrowing/refundable.cfm</a><br /><br />
+        This site uses VeriSign SSL encryption to ensure your
+        privacy.
+    </td>
+</tr>
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/receipt_email.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/receipt_email.tt2
new file mode 100644 (file)
index 0000000..33d3e07
--- /dev/null
@@ -0,0 +1,38 @@
+[%  
+    WRAPPER "opac/biblio/base.tt2";
+    PROCESS "opac/parts/header.tt2";
+%]
+    <div id="header">
+        <div class="float-left">
+            [% INCLUDE "opac/biblio/topnav_logo.tt2" %]
+        </div>
+        <div class="common-no-pad"></div>
+    </div>
+    <div id='fines_payments_wrapper'>
+        <div id='acct_fines_tabs'>
+
+            <a href='[% ctx.opac_root %]/biblio/main_fines'><img src='[% ctx.media_prefix %]/images/acct_fines_off.jpg'/></a>
+            <a href='[% ctx.opac_root %]/biblio/main_payments'><img src='[% ctx.media_prefix %]/images/acct_payments_on.jpg'/></a>
+
+        </div>
+    </div>
+    <div style="background:#fff">
+        [% IF ctx.email_receipt_result; # result should be undef on success %]
+        <div class="payment-error">
+            [% l('Error preparing receipt:') %]
+            <span title="[% ctx.email_receipt_result.textcode | html %]">
+                [% ctx.email_receipt_result.desc | html %]
+            </span>
+        </div>
+        [% ELSE %]
+        <div>
+            [% l('Your receipt will be emailed to [_1]', ctx.user.email) | html %]
+        </div>
+        [% END %]
+        <p>
+            [ <a href="[% ctx.opac_root %]/biblio/main_payments">[%l("Back to Payments History") %] </a> ]
+            [ <a href="javascript:window.close();">[%l("Close Page") %]</a> ]
+        </p>
+    </div>
+
+[% END %]
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/receipt_print.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/receipt_print.tt2
new file mode 100644 (file)
index 0000000..5ae9cd3
--- /dev/null
@@ -0,0 +1,25 @@
+[%# sic! no wrapper %]
+<html>
+    <head>
+        <title>[% l('Receipt') %]</title>
+    </head>
+    <body onload="if (document.getElementById('printable-receipt')) window.print();">
+        [% IF ctx.printable_receipt.template_output %]
+        <tt id="printable-receipt">
+            [% ctx.printable_receipt.template_output.data %]
+        </tt>
+        [% ELSE %]
+        <div class="payment-error">
+            [% l(
+                'Error preparing receipt: [_1]',
+                    (ctx.printable_receipt.textcode ? ctx.printable_receipt.textcode _ ' / ' _ ctx.printable_receipt.desc : 0) ||
+                    ctx.printable_receipt.error_output.data ||
+                    l('No receipt data returned from server')
+                ) | html %]
+        </div>
+        [% END %]
+        <hr />
+        <p>[ <a href="[% ctx.opac_root %]/biblio/main_payments">[%l("Back to Payments History") %] </a> ] [ <a href="javascript:window.close();">[%l("Close Page") %]</a> ]</p>
+
+    </body>
+</html>
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/tester.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/tester.tt2
new file mode 100644 (file)
index 0000000..13b282d
--- /dev/null
@@ -0,0 +1,12 @@
+<p><a href="javascript: void(0)" 
+   onclick="window.open('main_payments',
+  'windowname1', 
+  'width=800, height=550'); 
+   return false;">biblio/main_payments</a></p>
+   
+<p><a href="javascript: void(0)" 
+   onclick="window.open('main_fines',
+  'windowname1', 
+  'width=800, height=550'); 
+   return false;">biblio/main_fines</a></p>
+   
\ No newline at end of file
diff --git a/KCLS/openils/var/templates_kcls/opac/biblio/topnav_logo.tt2 b/KCLS/openils/var/templates_kcls/opac/biblio/topnav_logo.tt2
new file mode 100644 (file)
index 0000000..e69de08
--- /dev/null
@@ -0,0 +1,2 @@
+        <a href="http://www.kcls.org"><img alt="[% l('KCLS Logo') %]" 
+            src="[% ctx.media_prefix %]/images/KCLS_Logo_Nov.png" /></a>
index e93d94c..7bfb863 100644 (file)
@@ -182,6 +182,20 @@ sub load {
             )
         );
     }
+    
+    if($path =~ m|opac/biblio/login|) {
+        return $self->load_login unless $self->editor->requestor; # already logged in?
+
+        # This will be less confusing to users than to be shown a login form
+        # when they're already logged in.
+        return $self->generic_redirect(
+            sprintf(
+                "%s://%s%s/myopac/main",
+                $self->ctx->{proto},
+                $self->ctx->{hostname}, $self->ctx->{opac_root}
+            )
+        );
+    }
 
     if ($path =~ m|opac/sms_cn| and !$self->editor->requestor) {
         my $org_unit = $self->ctx->{physical_loc} || $self->cgi->param('loc') || $self->ctx->{aou_tree}->()->id;
@@ -211,18 +225,11 @@ sub load {
     return $self->load_myopac_messages if $path =~ m|opac/myopac/messages|;
     return $self->load_myopac_payment_form if $path =~ m|opac/myopac/main_payment_form|;
     return $self->load_myopac_payments if $path =~ m|opac/myopac/main_payments|;
-    return $self->load_myopac_payment_form if $path =~ m|opac/myopac/biblio_main_payment_form|;
-    return $self->load_myopac_payments if $path =~ m|opac/myopac/biblio_main_payments|;
-    return $self->load_myopac_main if $path =~ m|opac/myopac/biblio_main_fines|;
-    return $self->biblio_load_myopac_pay_init if $path =~ m|opac/myopac/biblio_main_pay_init|;
-    return $self->load_myopac_pay if $path =~ m|opac/myopac/biblio_main_pay|;
     return $self->load_myopac_pay_init if $path =~ m|opac/myopac/main_pay_init|;
     return $self->load_myopac_pay if $path =~ m|opac/myopac/main_pay|;
     return $self->load_myopac_main if $path =~ m|opac/myopac/main|;
     return $self->load_myopac_receipt_email if $path =~ m|opac/myopac/receipt_email|;
-    return $self->load_myopac_receipt_email if $path =~ m|opac/myopac/biblio_receipt_email|;
     return $self->load_myopac_receipt_print if $path =~ m|opac/myopac/receipt_print|;
-    return $self->load_myopac_receipt_print if $path =~ m|opac/myopac/biblio_receipt_print|;
     return $self->load_myopac_update_email if $path =~ m|opac/myopac/update_email|;
     return $self->load_myopac_update_password if $path =~ m|opac/myopac/update_password|;
     return $self->load_myopac_update_username if $path =~ m|opac/myopac/update_username|;
@@ -237,6 +244,15 @@ sub load {
     return $self->load_myopac_prefs_my_lists if $path =~ m|opac/myopac/prefs_my_lists|;
     return $self->load_myopac_prefs if $path =~ m|opac/myopac/prefs|;
     return $self->load_sms_cn if $path =~ m|opac/sms_cn|;
+    
+    #BiblioCommons E-Commerce Screens
+    return $self->load_myopac_payment_form if $path =~ m|opac/biblio/main_payment_form|;
+    return $self->load_myopac_payments if $path =~ m|opac/biblio/main_payments|;
+    return $self->biblio_load_myopac_pay_init if $path =~ m|opac/biblio/main_pay_init|;
+    return $self->load_myopac_main if $path =~ m|opac/biblio/main_fines|;
+    return $self->load_myopac_pay if $path =~ m|opac/biblio/main_pay|;
+    return $self->load_myopac_receipt_email if $path =~ m|opac/biblio/receipt_email|;
+    return $self->load_myopac_receipt_print if $path =~ m|opac/biblio/receipt_print|;
 
     return Apache2::Const::OK;
 }
@@ -260,10 +276,12 @@ sub redirect_auth {
     my $login_page = sprintf('%s://%s%s/login',($self->ctx->{is_staff} ? 'oils' : 'https'), $self->ctx->{hostname}, $self->ctx->{opac_root});
     my $redirect_to = uri_escape_utf8($self->apache->unparsed_uri);
     
-    if ($redirect_to =~ m/biblio_main_fines/ || $redirect_to =~ m/biblio_main_payment/){
-        $login_page .= '_fines';
-    }
-
+    if ($redirect_to =~ m/biblio%2Fmain_fines/ || $redirect_to =~ m/biblio%2Fmain_payment/){
+        $login_page = sprintf('%s://%s%s/biblio/login',
+            ($self->ctx->{is_staff} ? 'oils' : 'https'), 
+            $self->ctx->{hostname}, $self->ctx->{opac_root});
+        }
+    
     return $self->generic_redirect("$login_page?redirect_to=$redirect_to");
 }
 
index 7280675..e0ddbd2 100644 (file)
@@ -1945,7 +1945,7 @@ sub biblio_load_myopac_pay_init {
     # transactions we were processing, so the UI can bring the user back
     # to the payment form w/ the same xacts if the payment fails.
 
-    my $refresh = "1; url=biblio_main_pay/$token?xact=" . pop(@payment_xacts);
+    my $refresh = "1; url=main_pay/$token?xact=" . pop(@payment_xacts);
     $refresh .= ";xact=$_" for @payment_xacts;
     $self->ctx->{refresh} = $refresh;