Bug 17877: Add columns settings to the orders table on subscription-detail
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Wed, 19 Sep 2018 22:45:12 +0000 (19:45 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 1 Oct 2018 13:56:29 +0000 (13:56 +0000)
Test plan:
- Apply this patch and make sure to restart memcached (to re-read the yaml
file that is cached)
- Go to Home › Administration › Columns settings
- Confirm that a new "Serials" tab contain the different columns of the
"Acquisition details" table displayed on the subscription detail page
(if an order exist for this subscription)
- Play with it
- Go to Home › Serials › Details for subscription #ID
- Confirm that the "Column visibility" button is now displayed on top of
the table that it works correctly.

Signed-off-by: Séverine QUEUNE <severine.queune@bulac.fr>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
admin/columns_settings.yml
koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt
koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt

index a76acc0..0a4f66f 100644 (file)
@@ -592,3 +592,25 @@ modules:
           columnname: serial_status
         -
           columnname: serial_notes
+
+  serials:
+    subscription-detail:
+      orders:
+        -
+          columnname: invoice
+        -
+          columnname: basket
+        -
+          columnname: ordernumber
+        -
+          columnname: creation_date
+        -
+          columnname: receive_date
+        -
+          columnname: status
+        -
+          columnname: fund
+        -
+          columnname: ordered
+        -
+          columnname: spent
index b41b653..ebcd53e 100644 (file)
             [% PROCESS pagelist module=modules.reports modulename="reports" %]
           </div>
 
+          <h3><a href="#serials">Serials</a></h3>
+          <div id="serials">
+            <h4>Serials tables</h4>
+            [% PROCESS pagelist module=modules.serials modulename="serials" %]
+          </div>
+
         </div>
             </main>
         </div> <!-- /.col-sm-10.col-sm-push-2 -->
index e8e8364..498ceb2 100644 (file)
@@ -5,6 +5,7 @@
 [% USE Branches %]
 [% USE AuthorisedValues %]
 [% USE Price %]
+[% USE ColumnsSettings %]
 [% SET footerjs = 1 %]
 [% INCLUDE 'doc-head-open.inc' %]
 <title>Koha &rsaquo; Serials &rsaquo; Details for subscription #[% subscriptionid | html %]</title>
     </script>
     [% Asset.js("js/serials-toolbar.js") | $raw %]
     [% INCLUDE 'datatables.inc' %]
+    [% INCLUDE 'columns_settings.inc' %]
     <script type="text/javascript">
         // the english words used in display purposes
         var text = new Array(_("Number"),_("Volume"),_("Issue"),_("Month"),_("Week"),_("Starting with:"),_("Rollover at:"),_("Choose Hemisphere:"),_("Northern"),_("Southern",
                 return false;
             })
 
-            var table = $("#orders").dataTable($.extend(true, {}, dataTablesDefaults, {
+            var columns_settings = [% ColumnsSettings.GetColumns( 'serials', 'subscription-detail', 'orders', 'json' ) | $raw %];
+            var table = KohaTable("orders", {
                 'bPaginate': false,
                 'bAutoWidth': false,
                 "aaSorting": [[ 5, "asc" ], [ 2, "desc" ]], // Order by status then ordernumber
                 "aoColumnDefs": [
                     { "aTargets": "title-string", "sType": "title-string" }
                 ]
-            }));
+            }, columns_settings);
 
             $("#hide_received_orders").click(function(e){
                 e.preventDefault();