Bugzilla – Attachment 76179 Details for
Bug 20966
Add column configuration to table of orders in a basket
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 20966: Add column configuration to table of orders in a basket
Bug-20966-Add-column-configuration-to-table-of-ord.patch (text/plain), 13.86 KB, created by
Owen Leonard
on 2018-06-19 17:26:32 UTC
(
hide
)
Description:
Bug 20966: Add column configuration to table of orders in a basket
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2018-06-19 17:26:32 UTC
Size:
13.86 KB
patch
obsolete
>From b7965565657f75573b7ba7a3881e29158a8db30a Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Tue, 19 Jun 2018 17:02:14 +0000 >Subject: [PATCH] Bug 20966: Add column configuration to table of orders in a > basket > >This patch adds column configuration to the table of orders in a basket. >It replaces the "Show all details" checkbox which previously was used to >show the hidden "tax included" columns. Now those columns are hidden by >default in the columns configuration file. > >To test, apply the patch and view a basket with multiple orders. Test >all DataTables functionality (paging, sorting, filtering) including >showing and hiding columns. > >Test with both an open and a closed basket. >--- > admin/columns_settings.yml | 39 +++++++ > .../intranet-tmpl/prog/en/modules/acqui/basket.tt | 117 +++++++++------------ > 2 files changed, 88 insertions(+), 68 deletions(-) > >diff --git a/admin/columns_settings.yml b/admin/columns_settings.yml >index 8f0628f..4c7d7fe 100644 >--- a/admin/columns_settings.yml >+++ b/admin/columns_settings.yml >@@ -59,6 +59,45 @@ modules: > columnname: claims_count > - > columnname: claimed_date >+ basket: >+ orders: >+ - >+ columnname: basket_number >+ - >+ columnname: order_information >+ - >+ columnname: recommended_retail_price_tax_excluded >+ - >+ columnname: ecost_tax_excluded >+ - >+ columnname: recommended_retail_price_tax_included >+ is_hidden: 1 >+ - >+ columnname: ecost_tax_included >+ is_hidden: 1 >+ - >+ columnname: quantity >+ - >+ columnname: total_tax_excluded >+ - >+ columnname: total_tax_included >+ is_hidden: 1 >+ - >+ columnname: goods_and_services_tax_percentage >+ - >+ columnname: goods_and_services_tax >+ - >+ columnname: fund >+ - >+ columnname: supplier_report >+ - >+ columnname: modify >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 >+ - >+ columnname: cancel >+ cannot_be_toggled: 1 >+ cannot_be_modified: 1 > > admin: > currency: >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >index e9a94f8..021335e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basket.tt >@@ -17,6 +17,7 @@ > [% USE Branches %] > [% USE Price %] > [% USE AuthorisedValues %] >+[% USE ColumnsSettings %] > [% SET footerjs = 1 %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Acquisitions › [% UNLESS ( basketno ) %]New [% END %]Basket [% basketname|html %] ([% basketno |html %]) for [% booksellername|html %]</title> >@@ -343,31 +344,27 @@ > > <div id="acqui_basket_content" class="yui-g"> > [% IF ( books_loop ) %] >- <h2>Orders</h2> >- <label for="show_all_details"> >- <input type="checkbox" style="vertical-align: middle;" id="show_all_details" /> >- Show all details >- </label> >+ <h2>Orders</h2> > <table id="orders"> > <thead> > <tr> > <th>No.</th> >- <th class="anti-the">Order</th> >- <th class="tax_excluded">RRP tax exc.</th> >- <th class="tax_excluded">ecost tax exc.</th> >- <th class="tax_included">RRP tax inc.</th> >- <th class="tax_included">ecost tax inc.</th> >+ <th>Order</th> >+ <th>RRP tax exc.</th> >+ <th>ecost tax exc.</th> >+ <th>RRP tax inc.</th> >+ <th>ecost tax inc.</th> > <th>Qty.</th> >- <th class="tax_excluded">Total tax exc. ([% currency %])</th> >- <th class="tax_included">Total tax inc. ([% currency %])</th> >+ <th>Total tax exc. ([% currency %])</th> >+ <th>Total tax inc. ([% currency %])</th> > <th>GST %</th> > <th>GST</th> > <th>Fund</th> > <th>Supplier report</th> > [% IF ( active ) %] > [% UNLESS ( closedate ) %] >- <th>Modify</th> >- <th>Cancel order</th> >+ <th class="NoSort">Modify</th> >+ <th class="NoSort">Cancel order</th> > [% END %] > [% END %] > </tr> >@@ -377,13 +374,13 @@ > <tr> > <th></th> > <th>Total (GST [% foot_loo.tax_rate * 100 %])</th> >- <th class="tax_excluded"> </th> >- <th class="tax_excluded"> </th> >- <th class="tax_included"> </th> >- <th class="tax_included"> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> > <th>[% foot_loo.quantity %]</th> >- <th class="tax_excluded">[% foot_loo.total_tax_excluded | $Price%]</th> >- <th class="tax_included">[% foot_loo.total_tax_included | $Price %]</th> >+ <th>[% foot_loo.total_tax_excluded | $Price%]</th> >+ <th>[% foot_loo.total_tax_included | $Price %]</th> > <th> </th> > <th>[% foot_loo.tax_value | $Price %]</th> > <th> </th> >@@ -399,13 +396,13 @@ > <tr> > <th></th> > <th>Total ([% currency %])</th> >- <th class="tax_excluded"> </th> >- <th class="tax_excluded"> </th> >- <th class="tax_included"> </th> >- <th class="tax_included"> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> >+ <th> </th> > <th>[% total_quantity %]</th> >- <th class="tax_excluded">[% total_tax_excluded | $Price %]</th> >- <th class="tax_included">[% total_tax_included | $Price %]</th> >+ <th>[% total_tax_excluded | $Price %]</th> >+ <th>[% total_tax_included | $Price %]</th> > <th> </th> > <th>[% total_tax_value | $Price %]</th> > <th> </th> >@@ -474,13 +471,13 @@ > </td> > [% SET zero_regex = "^0{1,}\.?0{1,}[^1-9]" %] [%# 0 or 0.0 or 0.00 or 00 or 00.0 or 00.00 or 0.000 ... %] > [%# FIXME: use of a regexp is not ideal; bugs 9410 and 10929 suggest better way of handling this %] >- <td class="number tax_excluded [% IF books_loo.rrp_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_excluded | $Price %]</td> >- <td class="number tax_excluded [% IF books_loo.ecost_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_excluded | $Price%]</td> >- <td class="number tax_included [% IF books_loo.rrp_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_included | $Price %]</td> >- <td class="number tax_included [% IF books_loo.ecost_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_included | $Price %]</td> >+ <td class="number [% IF books_loo.rrp_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_excluded | $Price %]</td> >+ <td class="number [% IF books_loo.ecost_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_excluded | $Price%]</td> >+ <td class="number [% IF books_loo.rrp_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.rrp_tax_included | $Price %]</td> >+ <td class="number [% IF books_loo.ecost_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.ecost_tax_included | $Price %]</td> > <td class="number [% IF books_loo.quantity.search(zero_regex) %]error[% END %]">[% books_loo.quantity %]</td> >- <td class="number tax_excluded [% IF books_loo.total_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_excluded | $Price %]</td> >- <td class="number tax_included [% IF books_loo.total_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_included | $Price %]</td> >+ <td class="number [% IF books_loo.total_tax_excluded.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_excluded | $Price %]</td> >+ <td class="number [% IF books_loo.total_tax_included.search(zero_regex) %]error[% END %]">[% books_loo.total_tax_included | $Price %]</td> > <td class="number">[% books_loo.tax_rate * 100 %]</td> > <td class="number [% IF books_loo.tax_value.search(zero_regex) %]error[% END %]">[% books_loo.tax_value | $Price %]</td> > <td>[% books_loo.budget_name %]</td> >@@ -536,13 +533,13 @@ > <tr> > <th>No.</th> > <th>Order</th> >- <th class="tax_excluded">RRP tax exc.</th> >- <th class="tax_excluded">ecost tax exc.</th> >- <th class="tax_included">RRP tax inc.</th> >- <th class="tax_included">ecost tax inc.</th> >+ <th>RRP tax exc.</th> >+ <th>ecost tax exc.</th> >+ <th>RRP tax inc.</th> >+ <th>ecost tax inc.</th> > <th>Qty.</th> >- <th class="tax_excluded">Total tax exc. ([% currency %])</th> >- <th class="tax_included">Total tax inc. ([% currency %])</th> >+ <th>Total tax exc. ([% currency %])</th> >+ <th>Total tax inc. ([% currency %])</th> > <th>GST %</th> > <th>GST</th> > <th>Fund</th> >@@ -687,29 +684,12 @@ > > [% MACRO jsinclude BLOCK %] > [% Asset.js("js/acquisitions-menu.js") %] >-[% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'datatables.inc' %] >+ [% INCLUDE 'columns_settings.inc' %] > [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %] >- <script type="text/javascript"> >- function updateColumnsVisibility(visible) { >- if ( visible ) { >- $("table .tax_excluded, .tax_included").show(); >- } else { >- [% IF ( listincgst ) %] >- $("table .tax_excluded").hide(); >- [% ELSE %] >- $("table .tax_included").hide(); >- [% END %] >- } >- } >- >+ <script> > $(document).ready(function() { > if ( $('#toolbar').length ) {$('#toolbar').fixFloat();} >- $("#show_all_details").click(function(){ >- updateColumnsVisibility($(this).is(":checked")); >- }); >- >- $("#show_all_details").prop('checked', false); >- updateColumnsVisibility(false); > [% UNLESS ( closedate ) %] > $('#addtoBasket').on('show', function () { > $(this).find(".modal-body").html($(".acqui_basket_add")[0].outerHTML); >@@ -734,7 +714,7 @@ > </script> > > [% UNLESS ( closedate ) %] >- <script type="text/javascript"> >+ <script> > function transfer_order_popup(ordernumber) { > var url = "/cgi-bin/koha/acqui/transferorder.pl?" > + "ordernumber=" + ordernumber >@@ -749,7 +729,7 @@ > } > </script> > [% ELSE %] >- <script type="text/javascript"> >+ <script> > $(document).ready(function(){ > $("#basketgroupid").change(function(){ > if($(this).val() == "new"){ >@@ -759,7 +739,7 @@ > }); > </script> > [% UNLESS ( grouped ) %] >- <script type="text/javascript"> >+ <script> > function confirm_reopen() { > var skip = [% IF ( skip_confirm_reopen ) %] 1 [% ELSE %] 0 [% END %]; > var is_confirmed = skip || confirm(_("Are you sure you want to reopen this basket?")); >@@ -770,19 +750,20 @@ > </script> > [% END %] > [% END %] >- <script type="text/javascript"> >+ <script> >+ var columns_settings = [% ColumnsSettings.GetColumns( 'acqui', 'basket', 'orders', 'json' ) %]; > $(document).ready(function() { >- var orderst = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, { >- "sPaginationType": "four_button", >+ KohaTable("orders", { > [% IF ( active ) %] > "aoColumnDefs": [ >- [% UNLESS ( closedate ) %] >- { "aTargets": [ -1, -2 ], "bSortable": false, "bSearchable": false }, >- [% END %] >+ { "bSortable": false, "bSearchable": false, 'aTargets': [ 'NoSort' ] }, > { "sType": "anti-the", "aTargets": [ "anti-the" ] } > ], > [% END %] >- } ) ); >+ "sPaginationType": "four_button", >+ "autoWidth": false >+ }, columns_settings); >+ > var cancelledorderst = $("#cancelledorderst").dataTable($.extend(true, {}, dataTablesDefaults, { > "sPaginationType": "four_button" > } ) ); >-- >2.1.4
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 20966
:
76179
|
77891
|
78310
|
80404
|
81498
|
81636
|
81792
|
81793
|
81910
|
81911
|
82134
|
82135