Bugzilla – Attachment 29705 Details for
Bug 10212
Columns configuration for tables
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 10212: Columns configuration for tables - POC
Bug-10212-Columns-configuration-for-tables---POC.patch (text/plain), 5.54 KB, created by
Jonathan Druart
on 2014-07-15 15:56:26 UTC
(
hide
)
Description:
Bug 10212: Columns configuration for tables - POC
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-07-15 15:56:26 UTC
Size:
5.54 KB
patch
obsolete
>From 8fd796c68ead888fc519f4f82a900f8679df3533 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Mon, 7 Jul 2014 13:08:13 +0200 >Subject: [PATCH] Bug 10212: Columns configuration for tables - POC > >This patch proves that this feature is useful with a concret use case. > >Test plan: >1/ Execute the updatedatabase in order to create the new table. >2/ Take a look to the yml structure. >3/ Go on the admin currency page (admin/currency.pl). >4/ Check that you cannot hide the 2 first columns on the table. >5/ Try to hide/show columns. >6/ Go on the columns configuration page (admin/columns_settings.pl). >7/ Only the admin tab are filled with data. Check/uncheck checkboxes and >save. >8/ Go on the admin currency page and check that the behavior is what >you expected. >9/ Give me some feedback :) >--- > .../prog/en/modules/admin/columns_settings.tt | 9 ++++- > .../prog/en/modules/admin/currency.tt | 45 ++++++++++++++++------ > 2 files changed, 40 insertions(+), 14 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >index 5d7d133..cd98a9e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/columns_settings.tt >@@ -13,8 +13,13 @@ > [% IF tables.$pagename.keys and tables.$pagename.keys.size > 0 %] > [% FOR tablename IN tables.$pagename.keys.sort %] > <table> >- <caption>[% tablename %]</caption> >- <thead><tr><th>Column name</th><th>Is Hidden by default</th><th>Cannot be toggled</th></tr></thead> >+ <caption> >+ [% IF tablename == 'currencies-table' %] >+ Currency >+ [% END %] >+ (id=[% tablename %]) >+ </caption> >+ <thead><tr><th>Column name</th><th>Is hidden by default</th><th>Cannot be toggled</th></tr></thead> > <tbody> > [% FOR column IN tables.$pagename.$tablename %] > <tr> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >index 3165634..f3dc5dc 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tt >@@ -1,3 +1,5 @@ >+[% USE KohaDates %] >+[% USE ColumnsSettings %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Administration › Currencies & Exchange rates › > [% IF ( add_form ) %][% IF ( searchfield ) %]Modify currency '[% searchfield %]'[% ELSE %]New currency[% END %][% END %] >@@ -5,6 +7,11 @@ > [% IF ( delete_confirmed ) %]Currency deleted[% END %] > [% IF ( else ) %]Currencies[% END %]</title> > [% INCLUDE 'doc-head-close.inc' %] >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.colvis.css" /> >+<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.dataTables.colvis.js"></script> >+[% INCLUDE 'columns_settings.inc' %] > <script type="text/javascript"> > //<![CDATA[ > >@@ -20,6 +27,17 @@ > } > > $(document).ready(function() { >+ columns_settings = [% ColumnsSettings.GetColumns( 'admin', 'currency', 'currencies-table', 'json' ) %] >+ var issuest = KohaTable("#currencies-table", { >+ "sDom": 'C<"clearfix">t', >+ "aaSorting": [], >+ "aoColumnDefs": [ >+ { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, >+ { "sType": "title-string", "aTargets" : [ "title-string" ] } >+ ], >+ "bPaginate": false, >+ }, columns_settings); >+ > // prevents users to check active with a currency != 1 > $("#rate").keyup(function() { > check_currency( $(this).val() ); >@@ -158,32 +176,35 @@ > You searched for [% searchfield %]</span> > [% END %] > >- <table> >+ <table id='currencies-table'> >+ <thead> > <tr> > <th>Currency</th> > <th>Rate</th> > <th>Symbol</th> > <th>ISO code</th> >- <th>Last updated</th> >+ <th class="title-string">Last updated</th> > <th>Active</th> >- <th colspan="2">Actions </th> >+ <th>Actions</th> > </tr> >+ </thead> >+ <tbody> > [% FOREACH loo IN loop %] >- [% UNLESS ( loop.odd ) %] >- <tr class="highlight"> >- [% ELSE %] >- <tr> >- [% END %] >+ <tr> > <td>[% loo.currency %]</td> > <td>[% loo.rate %]</td> > <td>[% loo.symbol |html %]</td> > <td>[% loo.isocode |html %]</td> >- <td>[% loo.timestamp %]</td> >+ <td><span title="[% loo.timestamp %]">[% loo.timestamp | $KohaDates %]</span></td> > <td style="color:green;">[% IF ( loo.active ) %]รข[% END %]</td> >- <td><a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.currency %]">Edit</a></td> >- <td><a href="[% loo.script_name %]?op=delete_confirm&searchfield=[% loo.currency %]">Delete</a></td> >- </tr> >+ <td> >+ <a href="[% loo.script_name %]?op=add_form&searchfield=[% loo.currency %]">Edit</a> >+ | >+ <a href="[% loo.script_name %]?op=delete_confirm&searchfield=[% loo.currency %]">Delete</a> >+ </td> >+ </tr> > [% END %] >+ </tbody> > </table> > <br /> > >-- >2.0.0.rc2
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 10212
:
17978
|
17979
|
18861
|
20625
|
20640
|
21178
|
21179
|
21180
|
21583
|
21584
|
21585
|
24083
|
24084
|
24085
|
24149
|
24150
|
24151
|
24167
|
24168
|
24577
|
27700
|
27701
|
27702
|
27703
|
27704
|
27705
|
29075
|
29076
|
29077
|
29078
|
29079
|
29080
|
29537
|
29538
|
29539
|
29540
|
29541
|
29701
|
29702
|
29703
|
29704
|
29705
|
29718
|
29830
|
29836
|
29837
|
29838
|
29839
|
29840
|
29841
|
29842
|
29882
|
29883
|
29884
|
29885
|
29886
|
29887
|
29888
|
29947
|
31158
|
31159