Bugzilla – Attachment 26128 Details for
Bug 11711
Use new DataTables include in circ templates
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11711 - Use new DataTables include in circ templates
Bug-11711---Use-new-DataTables-include-in-circ-tem.patch (text/plain), 12.82 KB, created by
Alex Sassmannshausen
on 2014-03-11 16:20:36 UTC
(
hide
)
Description:
Bug 11711 - Use new DataTables include in circ templates
Filename:
MIME Type:
Creator:
Alex Sassmannshausen
Created:
2014-03-11 16:20:36 UTC
Size:
12.82 KB
patch
obsolete
>From 7dee555ca9b8c46566c06e38243240cc57a90f2c Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >Date: Fri, 7 Feb 2014 14:06:50 -0500 >Subject: [PATCH] Bug 11711 - Use new DataTables include in circ templates > >Bug 10649 introduced a new include file for adding DataTables-related >JavaScript assets. This patch adds use of this include file to all >circ-related pages which use DataTables. > >Apply the patch and test the following pages to confirm that table >sorting works correctly: > >- Circulation > - The UseTablesortForCirc system preference must be enabled. > - Check out to a patron with existing checkouts. Choose a patron who > is a guarantor to another patron with checkouts in order to test the > relatives' checkouts table. > - The checkouts and relatives' checkouts tables have been modified to > exclude articles when sorting of titles. > >- Hold ratios - The title column has been configured to exclude articles > from sorting > >- Transfer to receive > >- Holds queue > - The title column has been configured to exclude articles when > sorting > - The date column has been modified to use the title-string filter for > sorting. An unformatted date is now passed from C4::HoldsQueue.pm to > the template, where the KohaDates filter is used for formatting. > Sorting is based on the unformatted date. > >- Holds awaiting pickup > - The "available since" column has been configured for sorting on an > unformatted date. waitingreserves.pl now passes the unformatted > date to the template, and formatting is done using the KohaDates > filter. > - The title column has been configured to exclude articles when > sorting. > >Edit: Rebased on current master following commit of Bug 11605 >Signed-off-by: A. Sassmannshausen <alex.sassmannshausen@ptfs-europe.com> >--- > C4/HoldsQueue.pm | 1 - > circ/waitingreserves.pl | 2 +- > .../prog/en/modules/circ/circulation.tt | 8 +++----- > .../prog/en/modules/circ/reserveratios.tt | 7 +++---- > .../prog/en/modules/circ/transferstoreceive.tt | 6 ++---- > .../prog/en/modules/circ/view_holdsqueue.tt | 20 +++++++++----------- > .../prog/en/modules/circ/waitingreserves.tt | 14 ++++++++------ > 7 files changed, 26 insertions(+), 32 deletions(-) > >diff --git a/C4/HoldsQueue.pm b/C4/HoldsQueue.pm >index 6c36402..63f159a 100755 >--- a/C4/HoldsQueue.pm >+++ b/C4/HoldsQueue.pm >@@ -135,7 +135,6 @@ sub GetHoldsQueueItems { > $sth->execute(@bind_params); > my $items = []; > while ( my $row = $sth->fetchrow_hashref ){ >- $row->{reservedate} = format_date($row->{reservedate}); > my $record = GetMarcBiblio($row->{biblionumber}); > if ($record){ > $row->{subtitle} = GetRecordValue('subtitle',$record,'')->[0]->{subfield}; >diff --git a/circ/waitingreserves.pl b/circ/waitingreserves.pl >index 1ec6b2d..fb7a3d1 100755 >--- a/circ/waitingreserves.pl >+++ b/circ/waitingreserves.pl >@@ -105,7 +105,7 @@ foreach my $num (@getreserves) { > $gettitle->{'itemtype'} = C4::Context->preference('item-level_itypes') ? $gettitle->{'itype'} : $gettitle->{'itemtype'}; > my $getborrower = GetMember(borrowernumber => $num->{'borrowernumber'}); > my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); # using the fixed up itype/itemtype >- $getreserv{'waitingdate'} = format_date( $num->{'waitingdate'} ); >+ $getreserv{'waitingdate'} = $num->{'waitingdate'}; > my ( $waiting_year, $waiting_month, $waiting_day ) = split (/-/, $num->{'waitingdate'}); > ( $waiting_year, $waiting_month, $waiting_day ) = > Add_Delta_Days( $waiting_year, $waiting_month, $waiting_day, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >index e667bc3..1c536b5 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt >@@ -14,9 +14,7 @@ > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > [% IF ( UseTablesortForCirc ) %]<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script>[% END %] >+[% INCLUDE 'datatables.inc' %][% END %] > <script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.checkboxes.min.js"></script> > <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery-ui-timepicker-addon.min.js"></script> > [% INCLUDE 'timepicker.inc' %] >@@ -47,7 +45,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); > { "aTargets": [ -1, -2[% IF ( exports_enabled ) %], -3[% END %] ], "bSortable": false, "bSearchable": false } > ], > "aoColumns": [ >- { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %] >+ { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,null,null[% IF ( exports_enabled ) %],null[% END %] > ], > "bPaginate": false > })); >@@ -56,7 +54,7 @@ var MSG_EXPORT_SELECT_CHECKOUTS = _("You must select checkout(s) to export"); > "sDom": 't', > "aaSorting": [], > "aoColumns": [ >- { "sType": "title-string" },{ "sType": "html" },null,{ "sType": "title-string" },null,null,null,null,{ "sType": "html" } >+ { "sType": "title-string" },{ "sType": "anti-the" },null,{ "sType": "title-string" },null,null,null,null,{ "sType": "html" } > ], > "bPaginate": false > })); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >index 521a8d8..7672c26 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/reserveratios.tt >@@ -3,9 +3,7 @@ > [% INCLUDE 'doc-head-close.inc' %] > [% INCLUDE 'calendar.inc' %] > <link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >-<script type="text/javascript" src="[% themelang %]/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="[% themelang %]/js/datatables.js"></script> >+[% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> > //<![CDATA[ > $(document).ready(function() { >@@ -19,7 +17,8 @@ > $("#holdst").dataTable($.extend(true, {}, dataTablesDefaults, { > "aaSorting": [ [0,'desc'], [3,'asc'] ], > "aoColumnDefs": [ >- { "aTargets": [ 8 ], "sType": "natural" } >+ { "aTargets": [ 8 ], "sType": "natural" }, >+ { "aTargets": [ 3 ], "sType": "anti-the" } > ], > "aoColumns": [ > null, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt >index d0286ca..d3cc93b 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/transferstoreceive.tt >@@ -2,10 +2,8 @@ > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Circulation › Transfers to your library</title> > [% INCLUDE 'doc-head-close.inc' %] >-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" /> >-<script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script> >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> > //<![CDATA[ > [% IF (dateformat == 'metric') %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >index f42bb47..cc2a694 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/view_holdsqueue.tt >@@ -1,3 +1,4 @@ >+[% USE KohaDates %] > [% USE ItemTypes %] > [% USE AuthorisedValues %] > [% INCLUDE 'doc-head-open.inc' %] >@@ -8,20 +9,17 @@ > <body id="circ_view_holdsqueue" class="circ"> > [% INCLUDE 'header.inc' %] > [% INCLUDE 'cat-search.inc' %] >-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" /> >-<script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script> >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] > <script type="text/javascript">//<![CDATA[ > $(document).ready(function() { > $("#holdst").dataTable({ > "aaSorting": [[ 3, "asc" ]], >- "bPaginate": false, >- "bLengthChange": false, >- "bFilter": false, >- "bSort": true, >- "bInfo": false, >- "bAutoWidth": false >+ "aoColumns": [ >+ { "sType": "anti-the" },null,null,null,null,null,null,null,null,{ "sType": "title-string" },null >+ ], >+ "sDom": 't', >+ "bPaginate": false > }); > }); > //]]> >@@ -91,7 +89,7 @@ $(document).ready(function() { > </td> > <td class="hq-patron"><p><a href="/cgi-bin/koha/circ/circulation.pl?findborrower=[% itemsloo.cardnumber %]#reserves">[% itemsloo.surname %], [% itemsloo.firstname %] ([% itemsloo.cardnumber %])</a></p> <p>[% itemsloo.phone %]</p></td> > <td class="hq-sendto">[% itemsloo.pickbranch %]</td> >- <td class="hq-date">[% itemsloo.reservedate %]</td> >+ <td class="hq-date"><span title="[% itemsloo.reservedate %]">[% itemsloo.reservedate | $KohaDates %]</span></td> > <td class="hq-notes">[% itemsloo.notes %]</td> > </tr> > [% END %]</tbody> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >index 1d7182b..6edfd85 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/waitingreserves.tt >@@ -1,10 +1,9 @@ >+[% USE KohaDates %] > [% INCLUDE 'doc-head-open.inc' %] > <title>Koha › Circulation › Holds awaiting pickup</title> > [% INCLUDE 'doc-head-close.inc' %] >-<link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/en/css/datatables.css" /> >-<script type="text/javascript" src="[% interface %]/[% theme %]/en/lib/jquery/plugins/jquery.dataTables.min.js"></script> >-[% INCLUDE 'datatables-strings.inc' %] >-<script type="text/javascript" src="[% interface %]/[% theme %]/en/js/datatables.js"></script> >+<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> >+[% INCLUDE 'datatables.inc' %] > <script type="text/javascript"> > //<![CDATA[ > [% IF (dateformat == 'metric') %] >@@ -17,6 +16,9 @@ dt_add_type_uk_date(); > "aoColumnDefs": [ > { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false }, > ], >+ "aoColumns": [ >+ { "sType": "title-string" },{ "sType": "anti-the" },null,null,null,null,null >+ ], > "sPaginationType": "four_button" > })); > }); >@@ -89,7 +91,7 @@ dt_add_type_uk_date(); > </tr></thead> > <tbody>[% FOREACH reserveloo IN reserveloop %] > <tr> >- <td><p>[% reserveloo.waitingdate %]</p></td> >+ <td><span title="[% reserveloo.waitingdate %]">[% reserveloo.waitingdate | $KohaDates %]</span></td> > <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = reserveloo.biblionumber %] > [% reserveloo.title |html %] [% reserveloo.subtitle |html %] > </a> >@@ -149,7 +151,7 @@ dt_add_type_uk_date(); > </tr></thead> > <tbody>[% FOREACH overloo IN overloop %] > <tr> >- <td><p>[% overloo.waitingdate %]</p></td> >+ <td><p><span title="[% overloo.waitingdate %]">[% overloo.waitingdate | $KohaDates %]</span></p></td> > <td>[% INCLUDE 'biblio-default-view.inc' biblionumber = overloo.biblionumber %][% overloo.title |html %] [% overloo.subtitle |html %] > </a> > [% UNLESS ( item_level_itypes ) %][% IF ( overloo.itemtype ) %] (<b>[% overloo.itemtype %]</b>)[% END %][% END %] >-- >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 11711
:
25149
|
26105
|
26116
|
26128
|
26460