Bugzilla – Attachment 26765 Details for
Bug 12018
add table sorting to patron card batches
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12018 - add table sorting to patron card batches
Bug-12018---add-table-sorting-to-patron-card-batch.patch (text/plain), 8.49 KB, created by
Owen Leonard
on 2014-04-02 14:47:07 UTC
(
hide
)
Description:
Bug 12018 - add table sorting to patron card batches
Filename:
MIME Type:
Creator:
Owen Leonard
Created:
2014-04-02 14:47:07 UTC
Size:
8.49 KB
patch
obsolete
>From 4a008e109c3f835115ff725ada7ea4ba9678f3a2 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Wed, 2 Apr 2014 10:13:31 -0400 >Subject: [PATCH] Bug 12018 - add table sorting to patron card batches >Content-Type: text/plain; charset="utf-8" > >When viewing batches of patrons in the patron card creator module the >table is not sortable. This patch adds table sorting. > >The patch also makes some corrections of invalid markup and moves >informational/error messages to the top of the page rather than in a >sidebar. This change lets the table and sorting controls expand into a >wider space. > >This patch also corrects a translation issue with table headers >identical to that addressed by Bug 11505. > >To test, go to Tools -> Patron card creator -> Manage batches. >View an existing batch or create a new batch and populate it with >patrons. Table sorting controls should work correctly. Batch management >operations should work correctly. >--- > .../prog/en/modules/patroncards/edit-batch.tt | 92 ++++++++++++-------- > 1 file changed, 56 insertions(+), 36 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >index ac4e051..60806f1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/patroncards/edit-batch.tt >@@ -2,6 +2,8 @@ > <title>Koha › Tools › Patron card creator › Manage patron card batches</title> > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'greybox.inc' %] >+ <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+ [% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> > //<![CDATA[ > function DeleteConfirm() { >@@ -99,6 +101,13 @@ > }; > > $(document).ready(function() { >+ $("#batcht").dataTable($.extend(true, {}, dataTablesDefaults, { >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false } >+ ], >+ "aaSorting": [[ 1, "asc" ]], >+ "sPaginationType": "four_button" >+ })); > $("#additems").click(function(){ > Add(); > return false; >@@ -151,47 +160,59 @@ > <a class="btn btn-small" id="exportbatch" href="#">Export batch</a>[% END %] > </div> > >+ [% IF ( duplicate_message ) %] >+ <div class="dialog message"> >+ <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %]. >+ </div> >+ [% END %] > > [% INCLUDE 'patroncards-errors.inc' %] >- <div class="yui-g"> >- <div class="yui-u first" id="manage-patroncard-batches"> >- <div class="hint">Current library: [% LoginBranchname %]</div> >- [% IF ( table_loop ) %] >- <form name="items" class="checkboxed"> >- <h2>Items in batch number [% batch_id %]</h2> >- <table> >- [% FOREACH table_loo IN table_loop %] >+ <div id="manage-patroncard-batches"> >+ <div class="hint">Current library: [% LoginBranchname %]</div> >+ [% IF ( table_loop ) %] >+ <form name="items" class="checkboxed"> >+ <h2>Items in batch number [% batch_id %]</h2> >+ <table id="batcht"> >+ [% FOREACH table_loo IN table_loop %] > [% IF ( table_loo.header_fields ) %] >- <tr> >- [% FOREACH header_field IN table_loo.header_fields %] >- <th>[% header_field.field_label %]</th> >- [% END %] >- </tr> >- [% ELSE %] >- <tr> >- [% FOREACH text_field IN table_loo.text_fields %] >- [% IF ( text_field.select_field ) %] >- <td align="center"><input type="checkbox" name="action" value="[% text_field.field_value %]"></td> >+ <thead> >+ <tr> >+ [% FOREACH header_field IN table_loo.header_fields %] >+ [% SWITCH header_field.field_label -%] >+ [% CASE "Card Number" -%] >+ <th>Card number</th> >+ [% CASE "Summary" -%] >+ <th>Summary</th> >+ [% CASE "Borrower Number" %] >+ <th>Borrower number</th> >+ [% CASE "Select" -%] >+ <th>Select</th> >+ [% CASE %] >+ <th>[% header_field.field_label %]</th> >+ [% END -%] >+ [% END %] >+ </tr> >+ </thead> >+ <tbody> > [% ELSE %] >- <td>[% text_field.field_value %]</td> >- [% END %] >- [% END %] >- </tr> >- [% END %] >+ <tr> >+ [% FOREACH text_field IN table_loo.text_fields %] >+ [% IF ( text_field.select_field ) %] >+ <td><input type="checkbox" name="action" value="[% text_field.field_value %]" /></td> >+ [% ELSE %] >+ <td>[% text_field.field_value %]</td> >+ [% END %] >+ [% END %] >+ </tr> > [% END %] >- </table> >- </form> >- [% ELSE %] >- <div class="dialog message"><h4>There are no items in batch [% batch_id %] yet</h4> >- <p>Use the toolbar above to add items.</p></div> >- [% END %] >- </div> >- [% IF ( duplicate_message ) %] >- <div class="yui-u"> >+ [% END %] >+ </tbody> >+ </table> >+ </form> >+ [% ELSE %] > <div class="dialog message"> >- <strong>[% duplicate_count %] duplicate item(s) found</strong> and removed from batch [% batch_id %]. >- </div> >- </div> >+ <h4>There are no items in batch [% batch_id %] yet</h4> >+ <p>Use the toolbar above to add items.</p></div> > [% END %] > </div> > </div> >@@ -200,5 +221,4 @@ > [% INCLUDE 'patroncards-menu.inc' %] > </div> > </div> >- </div> > [% INCLUDE 'intranet-bottom.inc' %] >-- >1.7.9.5
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 12018
:
26765
|
26771
|
26791