Bugzilla – Attachment 32996 Details for
Bug 12258
Datatable in Patrons Account Fines
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[Signed-off] Bug 12258 [Template follow-up] Datatable in Patrons Account Fines
Signed-off-Bug-12258-Template-follow-up-Datatable-.patch (text/plain), 4.84 KB, created by
Marc Véron
on 2014-10-30 19:32:23 UTC
(
hide
)
Description:
[Signed-off] Bug 12258 [Template follow-up] Datatable in Patrons Account Fines
Filename:
MIME Type:
Creator:
Marc Véron
Created:
2014-10-30 19:32:23 UTC
Size:
4.84 KB
patch
obsolete
>From 638feb69a8da94e68dea14a01837c9daeb697183 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Thu, 30 Oct 2014 09:57:49 -0400 >Subject: [PATCH] [Signed-off] Bug 12258 [Template follow-up] Datatable in > Patrons Account Fines >MIME-Version: 1.0 >Content-Type: text/plain; charset=UTF-8 >Content-Transfer-Encoding: 8bit > >This follow-up corrects some of the QA issues affecting the other patch, >as well as changing the way the "filter" option is displayed: > >- Added the use of the DataTables include file >- Removed redundant document.ready >- Fixed single quotes >- Fixed default sort (should be date descending to match the current > functionality) >- Adding missing <tr> >- Converted filter button to a link > >The last change is a judgement call, but the button in the DataTables >toolbar looked awkward and caused ugly wrapping at narrower viewport >sizes. I think a link is more keeping with the pattern established by >"select all / clear all" links. > >To test, apply both patches and view the account page >(members/boraccount.pl) for a patron who has paid and unpaid fines (the >more the better). > >- Confirm that the default sort is by date descending. >- Confirm that DataTables controls (paging, search, result count) work > correctly. >- Confirm that clicking the "Filter paid transactions" link works > correctly to toggle display of paid transactions. > >Works as expected. Passed koha-qa.pl. >Signed-off-by: Marc Véron <veron@veron.ch> >--- > .../prog/en/modules/members/boraccount.tt | 50 ++++++++++---------- > 1 file changed, 26 insertions(+), 24 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index b6c06d9..f87c475 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -1,32 +1,32 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Patrons › Account for [% INCLUDE 'patron-title.inc' %]</title> > [% INCLUDE 'doc-head-close.inc' %] >-<link rel="stylesheet" type="text/css" href="/intranet-tmpl/prog/en/css/datatables.css" /> >-<script type="text/javascript" src="/intranet-tmpl/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="/intranet-tmpl/prog/en/js/datatables.js"></script> >-<script type="text/javascript" id="js">$(document).ready(function() { >- $(document).ready(function() { >- var txtActivefilter = _('Filter paid transactions'); >- var txtInactivefilter = _('Show all transactions'); >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] >+<script type="text/javascript"> >+$(document).ready(function() { >+ var txtActivefilter = _("Filter paid transactions"); >+ var txtInactivefilter = _("Show all transactions"); > var table_account_fines = $("#table_account_fines").dataTable($.extend(true, {}, dataTablesDefaults, { > "sPaginationType": "four_button", >- "iDisplayLength" : 25 >+ 'aaSorting': [[0, 'desc']], >+ "sDom": 'C<"top pager"ilpf><"#filter_c">tr<"bottom pager"ip>' > })); >- $('<button id="filter_transacs">'+txtActivefilter+'</button>').appendTo($("#table_account_fines_filter")); >- $('#filter_transacs').click(function() { >+ $("#filter_c").html('<p><a href="#" id="filter_transacs">'+txtActivefilter+'</a>'); >+ $('#filter_transacs').click(function(e) { >+ e.preventDefault(); > if ($(this).hasClass('filtered')) { > var filteredValue = ''; >- $('#filter_transacs').text(txtActivefilter); >+ $(this).text(txtActivefilter); > } else { //Not filtered. Let's do it! > var filteredValue = '^((?!0.00).*)$'; //Filter not matching 0.00 http://stackoverflow.com/a/406408 >- $('#filter_transacs').text(txtInactivefilter); >+ $(this).text(txtInactivefilter); > } > table_account_fines.fnFilter(filteredValue, 4, true, false); > $(this).toggleClass('filtered'); > }); >- }); >-}); </script> >+}); >+</script> > </head> > <body id="pat_borraccount" class="pat"> > [% INCLUDE 'header.inc' %] >@@ -54,15 +54,17 @@ > <!-- The table with the account items --> > <table id="table_account_fines"> > <thead> >- <th>Date</th> >- <th>Description of charges</th> >- <th>Note</th> >- <th>Amount</th> >- <th>Outstanding</th> >- [% IF ( reverse_col ) %] >- <th> </th> >- [% END %] >- <th>Print</th> >+ <tr> >+ <th>Date</th> >+ <th>Description of charges</th> >+ <th>Note</th> >+ <th>Amount</th> >+ <th>Outstanding</th> >+ [% IF ( reverse_col ) %] >+ <th> </th> >+ [% END %] >+ <th>Print</th> >+ </tr> > </thead> > > <!-- FIXME: Shouldn't hardcode dollar signs, since Euro or Pound might be needed --> >-- >1.7.10.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 12258
:
28265
|
32940
|
32941
|
32972
|
32996
|
33022
|
33023