LP#1778972: convert DOS newlines in charges.tt2 to Unix
authorGalen Charlton <gmc@equinoxinitiative.org>
Thu, 10 Sep 2020 14:28:46 +0000 (10:28 -0400)
committerJane Sandberg <sandbej@linnbenton.edu>
Sat, 12 Sep 2020 15:53:13 +0000 (08:53 -0700)
Signed-off-by: Galen Charlton <gmc@equinoxinitiative.org>
Signed-off-by: Jane Sandberg <sandbej@linnbenton.edu>
Open-ILS/src/templates-bootstrap/opac/myopac/charges.tt2

index d05bd98..d1c8475 100755 (executable)
-[%  PROCESS "opac/parts/header.tt2";\r
-    PROCESS "opac/parts/misc_util.tt2";\r
-    WRAPPER "opac/parts/myopac/base.tt2";\r
-    myopac_page = "charges";\r
-    myopac_main_page = "main";\r
-    parent = "charges";\r
-    myopac_cc_allowed = 0;\r
-    IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;\r
-        myopac_cc_allowed = 1;\r
-    END\r
-%]\r
-[%  IF myopac_cc_allowed; %]\r
-<form action="[% ctx.opac_root %]/myopac/main_payment_form#payment" method="get" id="selected_fines">\r
-[% END %]\r
-\r
-    [% IF ctx.fines.circulation.size > 0 %]\r
-    <div id='myopac_circ_trans_div'>\r
-        <div class="header_middle">\r
-           <span class="acct_fines_header">\r
-           <!-- Different heading when not able to pay -->\r
-             [% IF myopac_cc_allowed %]\r
-                [% l("Pay Selected Circulation Charges") %]\r
-            [% ELSE %] \r
-                [% l("Circulation Charges") %]\r
-             [% END %]\r
-           </span>\r
-           \r
-        </div>\r
-\r
-     \r
-    \r
-        <table id="acct_fines_main_header" class="table table-hover table-responsive table-bordered miniTable chargesMainTable" title="[% l('Items Checked Out') %]">\r
-            <thead>\r
-               \r
-                <tr>\r
-\r
-                   [% IF myopac_cc_allowed %]\r
-                    <th style="white-space:nowrap;">\r
-                        <input id="pay_fines_box1" checked="checked"\r
-                            type="checkbox" onclick="select_all_checkboxes('xact', this.checked)"\r
-                            title="[% l('Click to (un)select all charges') %]" />\r
-                    </th> \r
-                    [% END %]\r
-                    <th>[% l("Owed") %]</th>\r
-                    <th>[% l("Billing Type") %]</th>\r
-                    <th>[% l("Title") %]</th>\r
-                    <th>[% l("Checkout") %]</th> \r
-                    <th>[% l(" Due ") %]</th> \r
-                    <th>\r
-                       <span>[% l(" Returned/Renewed") %]</span>\r
-                       <span>[% l(" Returned&#42;") %]</span>\r
-                    </th>\r
-                    \r
-                </tr>\r
-            </thead>\r
-            <tbody id='myopac_circ_trans_tbody'>\r
-                [% FOR f IN ctx.fines.circulation;\r
-                    attrs = {marc_xml => f.marc_xml};\r
-                    IF f.marc_xml;\r
-                        PROCESS get_marc_attrs args=attrs;\r
-                    ELSIF f.xact.reservation;\r
-                        attrs.title = f.xact.reservation.target_resource_type.name;\r
-                    END %]\r
-                <tr id='myopac_circ_trans_row'>\r
-                    [% IF myopac_cc_allowed %]\r
-                    <td class="checkCell">\r
-                        <input type="checkbox" checked="checked" \r
-                            title="[% l('Pay this fine') %]" name="xact"\r
-                            value="[% f.xact.id %]" class="fineCheck"/>\r
-                    </td>\r
-                    [% END %]\r
-                    \r
-                    <td>\r
-                        <strong>\r
-                            [% money(f.xact.balance_owed) %]\r
-                        </strong>\r
-                        <input class="fineAmount" value="[% f.xact.balance_owed %]" hidden />\r
-                    </td>\r
-                    \r
-                    <td>\r
-                       [% f.xact.last_billing_type %]\r
-                    </td>\r
-                                  \r
-                    <td>\r
-                        [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;\r
-                        IF recid; %]\r
-                        <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,\r
-                            {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>\r
-                        [% ELSE %]\r
-                        [% attrs.title | html %]\r
-                        [% END %]\r
-                    </td>\r
-                    \r
-                   <td name='myopac_circ_trans_start'>\r
-                        [% ts = f.xact.circulation.xact_start || f.xact.reservation.start_time || 0;\r
-                        IF ts;\r
-                            date.format(ctx.parse_datetime(ts), DATE_FORMAT);\r
-                        END %]\r
-                    </td>\r
-                    \r
-                    <td name='myopac_circ_trans_due' >\r
-                        [% ts = f.xact.circulation.due_date || f.xact.reservation.end_time || 0;\r
-                           due_org = f.xact.circulation.circ_lib || f.xact.reservation.pickup_lib;\r
-                        IF ts;\r
-                            date.format(ctx.parse_datetime(ts, due_org), DATE_FORMAT);\r
-                        END %]\r
-                    </td>\r
-                    \r
-                    <td name='myopac_circ_trans_finished' >\r
-                        [%  ts = f.xact.circulation.checkin_time || f.xact.reservation.return_time || 0;\r
-                            IF ts;\r
-                                date.format(ctx.parse_datetime(ts), DATE_FORMAT);\r
-                            ELSE %]\r
-                            <!-- XXX TODO fines aren't really accruing\r
-                                if circ has hit maxfines. more clarity\r
-                                here? --> \r
-                            <span class="danger">[% l('(fines accruing)') %]</span>\r
-                        [%  END %]\r
-                    </td>\r
-                   \r
-                </tr>\r
-                [% END %]\r
-            </tbody>\r
-        </table>\r
-        <!-- Disclaimer for mobile -->\r
-        <span class="mobile_view cc_disclaimer"> <strong>&#42;</strong>Items may have been renewed. </span>\r
-    </div>\r
-    [% END %]\r
-\r
-    [% IF ctx.fines.grocery.size > 0 %]\r
-    <!-- Table for all non-circulation transactions -->\r
-    <div id='myopac_trans_div'>\r
-        <h3>\r
-                [% l("Charges On Your Account") %]\r
-        </h3>\r
-\r
-        [% IF myopac_cc_allowed %]\r
-        <div class="d-block d-md-none">\r
-            <input id="pay_fines_check" checked="checked"\r
-            type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"\r
-            aria-label="[% l('Check/Uncheck All') %]" />    \r
-            <label for="pay_fines_check">[% l('Check/Uncheck All') %]</label>  \r
-        </div>             \r
-        [% END %]\r
-        \r
-         <table id="acct_fees_main_header" class="table table-hover table-bordered miniTable chargesTable my-3" title="[% l('Other Fines and Fees') %]">\r
-            <thead>\r
-                <tr>\r
-                \r
-                     [% IF myopac_cc_allowed %]\r
-                    <th style="white-space:nowrap;">\r
-                        <input id="pay_fines_box2" checked="checked"\r
-                            type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"\r
-                            aria-label="[% l('Check/Uncheck All') %]" />\r
-                    </th>\r
-                    [% END %]\r
-                    <th >[% l("Owed") %]</th>\r
-                    <th >[% l("Billing Type") %]</th>\r
-                    <th >[% l("Note") %]</th>\r
-                    <th >[% l("Date") %]</th>\r
-                    \r
-\r
-                </tr>\r
-            </thead>\r
-            <tbody id='myopac_trans_tbody'>\r
-                [% c = 0; %]\r
-                [% FOR f IN ctx.fines.grocery %]\r
-                <tr class ='myopac_trans_row'>\r
-                [% c = c + 1; %]\r
-                    [% IF myopac_cc_allowed %]\r
-                    <td class="checkCell">\r
-                        <label class="sr-only">Billing Number [% c %]</label>\r
-                        <input aria-label="Pay This Bill" class="fineCheck" type="checkbox" name="xact_misc" value="[% f.xact.id %]" checked="checked" />\r
-                    </td>\r
-                    [% END %]\r
-                    \r
-                    <td class="danger">\r
-                        <span class="sr-only">Amount Owed</span>\r
-                        <strong>\r
-                            [% money(f.xact.balance_owed) %]\r
-                        </strong>\r
-                         <input type="hidden" class="fineAmount" value="[% f.xact.balance_owed %]" hidden />\r
-                    </td>\r
-                    \r
-                    <td>\r
-                        <span class="sr-only">Billing For</span>\r
-                        [% f.xact.last_billing_type %]\r
-                    </td>\r
-                    \r
-                    <td>\r
-                        [% IF f.xact.last_billing_note; %]\r
-                            <span class="sr-only">Note</span>\r
-                            [% f.xact.last_billing_note %]\r
-                        [% END %]\r
-                    </td>\r
-                    \r
-                    <td>\r
-                        <span class="sr-only">Date of Billing</span>\r
-                        [% date.format(ctx.parse_datetime(f.xact.xact_start),DATE_FORMAT) %]\r
-                    </td>\r
-\r
-                </tr>\r
-                [% END %]\r
-            </tbody>\r
-        </table>\r
-   \r
-    </div>\r
-    [% END %]\r
-    [% UNLESS ctx.fines.grocery.size OR ctx.fines.circulation.size %]\r
-    <div>[% l('You have no current fines.') %]</div>\r
-    [% ELSIF myopac_cc_allowed %]\r
-   \r
-    <div class="my-3">\r
-        <button type="submit" value="[% l('Pay selected charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]" title="[% l('Pay selected charges') %]" class="btn btn-confirm my-1"\r
-            id="selectPay"> <i class='fas fa-money-bill-wave'></i> [% l('Pay Selected Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>\r
-    <button type="submit" class="btn btn-confirm my-1"><i class="fas fa-cash-register"></i> [% l('Pay All Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>\r
-    </div>\r
-    [% END %]\r
-[% IF myopac_cc_allowed %]\r
-</form>\r
-[% END %]\r
-<script >\r
-$( document ).ready(function() {\r
-   $("input[type=checkbox]").click(function () {\r
-       var amount = 0;\r
-    $("td input:checked").each(function () {\r
-               var item = jQuery( this ).parent().parent().children("td").children(".fineAmount").attr("value");\r
-        item = parseFloat(item);\r
-        amount += item;\r
-    });\r
-    $("#total").val(amount);\r
-    $("#selectPay").html('<i class="fas fa-money-bill-wave"></i> Pay Selected Charges - $' + amount.toFixed(2));\r
-});\r
-});\r
-\r
-</script>\r
-[% END %]\r
-\r
-<!--Table functions ~ Running total of selected items for use in a Paypal module or where running total is needed-->\r
+[%  PROCESS "opac/parts/header.tt2";
+    PROCESS "opac/parts/misc_util.tt2";
+    WRAPPER "opac/parts/myopac/base.tt2";
+    myopac_page = "charges";
+    myopac_main_page = "main";
+    parent = "charges";
+    myopac_cc_allowed = 0;
+    IF (ctx.fines.grocery.size OR ctx.fines.circulation.size) AND ctx.get_org_setting(ctx.user.home_ou, 'credit.payments.allow') == 1;
+        myopac_cc_allowed = 1;
+    END
+%]
+[%  IF myopac_cc_allowed; %]
+<form action="[% ctx.opac_root %]/myopac/main_payment_form#payment" method="get" id="selected_fines">
+[% END %]
+
+    [% IF ctx.fines.circulation.size > 0 %]
+    <div id='myopac_circ_trans_div'>
+        <div class="header_middle">
+           <span class="acct_fines_header">
+           <!-- Different heading when not able to pay -->
+             [% IF myopac_cc_allowed %]
+                [% l("Pay Selected Circulation Charges") %]
+            [% ELSE %] 
+                [% l("Circulation Charges") %]
+             [% END %]
+           </span>
+           
+        </div>
+
+     
+    
+        <table id="acct_fines_main_header" class="table table-hover table-responsive table-bordered miniTable chargesMainTable" title="[% l('Items Checked Out') %]">
+            <thead>
+               
+                <tr>
+
+                   [% IF myopac_cc_allowed %]
+                    <th 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 charges') %]" />
+                    </th> 
+                    [% END %]
+                    <th>[% l("Owed") %]</th>
+                    <th>[% l("Billing Type") %]</th>
+                    <th>[% l("Title") %]</th>
+                    <th>[% l("Checkout") %]</th> 
+                    <th>[% l(" Due ") %]</th> 
+                    <th>
+                       <span>[% l(" Returned/Renewed") %]</span>
+                       <span>[% l(" Returned&#42;") %]</span>
+                    </th>
+                    
+                </tr>
+            </thead>
+            <tbody id='myopac_circ_trans_tbody'>
+                [% FOR f IN ctx.fines.circulation;
+                    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'>
+                    [% IF myopac_cc_allowed %]
+                    <td class="checkCell">
+                        <input type="checkbox" checked="checked" 
+                            title="[% l('Pay this fine') %]" name="xact"
+                            value="[% f.xact.id %]" class="fineCheck"/>
+                    </td>
+                    [% END %]
+                    
+                    <td>
+                        <strong>
+                            [% money(f.xact.balance_owed) %]
+                        </strong>
+                        <input class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
+                    </td>
+                    
+                    <td>
+                       [% f.xact.last_billing_type %]
+                    </td>
+                                  
+                    <td>
+                        [% recid = f.xact.circulation.target_copy.call_number.record.id || f.xact.reservation.target_resource_type.record.id;
+                        IF recid; %]
+                        <a href="[% mkurl(ctx.opac_root _ '/record/' _ recid,
+                            {loc => ctx.search_ou}) %]">[% attrs.title | html %]</a>
+                        [% ELSE %]
+                        [% attrs.title | html %]
+                        [% END %]
+                    </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;
+                           due_org = f.xact.circulation.circ_lib || f.xact.reservation.pickup_lib;
+                        IF ts;
+                            date.format(ctx.parse_datetime(ts, due_org), 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="danger">[% l('(fines accruing)') %]</span>
+                        [%  END %]
+                    </td>
+                   
+                </tr>
+                [% END %]
+            </tbody>
+        </table>
+        <!-- Disclaimer for mobile -->
+        <span class="mobile_view cc_disclaimer"> <strong>&#42;</strong>Items may have been renewed. </span>
+    </div>
+    [% END %]
+
+    [% IF ctx.fines.grocery.size > 0 %]
+    <!-- Table for all non-circulation transactions -->
+    <div id='myopac_trans_div'>
+        <h3>
+                [% l("Charges On Your Account") %]
+        </h3>
+
+        [% IF myopac_cc_allowed %]
+        <div class="d-block d-md-none">
+            <input id="pay_fines_check" checked="checked"
+            type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
+            aria-label="[% l('Check/Uncheck All') %]" />    
+            <label for="pay_fines_check">[% l('Check/Uncheck All') %]</label>  
+        </div>             
+        [% END %]
+        
+         <table id="acct_fees_main_header" class="table table-hover table-bordered miniTable chargesTable my-3" title="[% l('Other Fines and Fees') %]">
+            <thead>
+                <tr>
+                
+                     [% IF myopac_cc_allowed %]
+                    <th style="white-space:nowrap;">
+                        <input id="pay_fines_box2" checked="checked"
+                            type="checkbox" onclick="select_all_checkboxes('xact_misc', this.checked)"
+                            aria-label="[% l('Check/Uncheck All') %]" />
+                    </th>
+                    [% END %]
+                    <th >[% l("Owed") %]</th>
+                    <th >[% l("Billing Type") %]</th>
+                    <th >[% l("Note") %]</th>
+                    <th >[% l("Date") %]</th>
+                    
+
+                </tr>
+            </thead>
+            <tbody id='myopac_trans_tbody'>
+                [% c = 0; %]
+                [% FOR f IN ctx.fines.grocery %]
+                <tr class ='myopac_trans_row'>
+                [% c = c + 1; %]
+                    [% IF myopac_cc_allowed %]
+                    <td class="checkCell">
+                        <label class="sr-only">Billing Number [% c %]</label>
+                        <input aria-label="Pay This Bill" class="fineCheck" type="checkbox" name="xact_misc" value="[% f.xact.id %]" checked="checked" />
+                    </td>
+                    [% END %]
+                    
+                    <td class="danger">
+                        <span class="sr-only">Amount Owed</span>
+                        <strong>
+                            [% money(f.xact.balance_owed) %]
+                        </strong>
+                         <input type="hidden" class="fineAmount" value="[% f.xact.balance_owed %]" hidden />
+                    </td>
+                    
+                    <td>
+                        <span class="sr-only">Billing For</span>
+                        [% f.xact.last_billing_type %]
+                    </td>
+                    
+                    <td>
+                        [% IF f.xact.last_billing_note; %]
+                            <span class="sr-only">Note</span>
+                            [% f.xact.last_billing_note %]
+                        [% END %]
+                    </td>
+                    
+                    <td>
+                        <span class="sr-only">Date of Billing</span>
+                        [% date.format(ctx.parse_datetime(f.xact.xact_start),DATE_FORMAT) %]
+                    </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>
+    [% ELSIF myopac_cc_allowed %]
+   
+    <div class="my-3">
+        <button type="submit" value="[% l('Pay selected charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]" title="[% l('Pay selected charges') %]" class="btn btn-confirm my-1"
+            id="selectPay"> <i class='fas fa-money-bill-wave'></i> [% l('Pay Selected Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
+    <button type="submit" class="btn btn-confirm my-1"><i class="fas fa-cash-register"></i> [% l('Pay All Charges') %] - [% money(ctx.user_stats.fines.balance_owed) %]</button>
+    </div>
+    [% END %]
+[% IF myopac_cc_allowed %]
+</form>
+[% END %]
+<script >
+$( document ).ready(function() {
+   $("input[type=checkbox]").click(function () {
+       var amount = 0;
+    $("td input:checked").each(function () {
+               var item = jQuery( this ).parent().parent().children("td").children(".fineAmount").attr("value");
+        item = parseFloat(item);
+        amount += item;
+    });
+    $("#total").val(amount);
+    $("#selectPay").html('<i class="fas fa-money-bill-wave"></i> Pay Selected Charges - $' + amount.toFixed(2));
+});
+});
+
+</script>
+[% END %]
+
+<!--Table functions ~ Running total of selected items for use in a Paypal module or where running total is needed-->