From 840cfaadee6b0016f90c4670cf4fd76402faef94 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 28 Jan 2014 09:07:21 -0500 Subject: [PATCH] Bug 6427 [Part 19] - Add full debit and credit table Print and Download features --- .../intranet-tmpl/prog/en/includes/datatables.inc | 3 +- koha-tmpl/intranet-tmpl/prog/en/js/datatables.js | 24 ++++++++++ .../prog/en/modules/members/account.tt | 48 ++++++++++++++++++-- 3 files changed, 70 insertions(+), 5 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc index 703d1e3..b306d0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/datatables.inc @@ -1,4 +1,5 @@ + - \ No newline at end of file + diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js index c2a2cf8..d3e9b99 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/datatables.js @@ -26,6 +26,30 @@ var dataTablesDefaults = { "sDom": '<"top pager"ilpf>t<"bottom pager"ip>' }; +// Set the classes that TableTools uses to something suitable for Bootstrap +$.extend( true, $.fn.DataTable.TableTools.classes, { + "container": "btn-group", + "buttons": { + "normal": "btn btn-small", + "disabled": "btn btn-small disabled" + }, + "collection": { + "container": "DTTT_dropdown dropdown-menu", + "buttons": { + "normal": "", + "disabled": "disabled" + } + } +} ); + +// Have the collection use a bootstrap compatible dropdown +$.extend( true, $.fn.DataTable.TableTools.DEFAULTS.oTags, { + "collection": { + "container": "ul", + "button": "li", + "liner": "a" + } +} ); // Return an array of string containing the values of a particular column $.fn.dataTableExt.oApi.fnGetColumnData = function ( oSettings, iColumn, bUnique, bFiltered, bIgnoreEmpty ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt index 1595307..aa98407 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/account.tt @@ -33,6 +33,26 @@ $(document).ready(function() { var sImageUrl = "[% interface %]/[% theme %]/img/"; var debitsTable = $('#debits-table').dataTable( { + "sDom": "<'row-fluid'<'span6'T><'span6'>r>t<'row-fluid'><'top pager'ilpf>t<'bottom pager'ip>", + "oTableTools": { + "sSwfPath": "/intranet-tmpl/lib/jquery/plugins/TableTools/media/swf/copy_csv_xls_pdf.swf", + "aButtons": [ + { + "sExtends": "print", + "sButtonText": " " + _("Print") + }, + { + "sExtends": "collection", + "sButtonText": " " + _("Download") + " ", + "aButtons": [ + { + "sExtends": "csv", + "sButtonText": " " + _("CSV") + } + ] + } + ] + }, "bProcessing": true, "aoColumns": [ { @@ -118,6 +138,26 @@ $(document).ready(function() { } ); var creditsTable = $('#credits-table').dataTable( { + "sDom": "<'row-fluid'<'span6'T><'span6'>r>t<'row-fluid'><'top pager'ilpf>t<'bottom pager'ip>", + "oTableTools": { + "sSwfPath": "/intranet-tmpl/lib/jquery/plugins/TableTools/media/swf/copy_csv_xls_pdf.swf", + "aButtons": [ + { + "sExtends": "print", + "sButtonText": " " + _("Print") + }, + { + "sExtends": "collection", + "sButtonText": " " + _("Download") + " ", + "aButtons": [ + { + "sExtends": "csv", + "sButtonText": " " + _("CSV") + } + ] + } + ] + }, "bProcessing": true, "aoColumns": [ { @@ -188,7 +228,7 @@ function fnFormatDebitDetails( debitsTable, nTr ) { var account_offsets = oData.account_offsets; - sOut += "" + + sOut += "" + " " + _("Print receipt") + ""; @@ -276,7 +316,7 @@ function fnFormatCreditDetails( creditsTable, nTr ) { var sOut = "