From 135a010446802a314bf2fc0c3a4dbe9453d00011 Mon Sep 17 00:00:00 2001 From: Aleisha Amohia Date: Tue, 14 Feb 2017 01:36:44 +0000 Subject: [PATCH] [SIGNED OFF] Bug 8548: Add datatable to circ overdue report, remove sortby filter This patch adds a datatable to the circ overdue report. Since the datatable makes sorting easy, I've also removed the sort by filter on the side. To test: 1) Go to Circulation -> Overdues 2) Notice overdues report shows as datatable 3) Confirm sorting on all columns works 4) Test the Filters and confirm they all still work as expected Sponsored-by: Catalyst IT Signed-off-by: Baptiste Wojtkowski --- circ/overdue.pl | 26 ----------------- .../intranet-tmpl/prog/en/modules/circ/overdue.tt | 34 +++++----------------- 2 files changed, 8 insertions(+), 52 deletions(-) diff --git a/circ/overdue.pl b/circ/overdue.pl index ab723e1..d7536c3 100755 --- a/circ/overdue.pl +++ b/circ/overdue.pl @@ -105,20 +105,6 @@ for my $attrcode (grep { /^patron_attr_filter_/ } $input->multi_param) { my $have_pattr_filter_data = keys(%cgi_attrcode_to_attrvalues) > 0; my @patron_attr_filter_loop; # array of [ domid cgivalue ismany isclone ordinal code description repeatable authorised_value_category ] -my @patron_attr_order_loop; # array of { label => $patron_attr_label, value => $patron_attr_order } - -my @sort_roots = qw(borrower title barcode date_due); -push @sort_roots, map {$_ . " desc"} @sort_roots; -my @order_loop = ({selected => $order ? 0 : 1}); # initial blank row -foreach (@sort_roots) { - my $tmpl_name = $_; - $tmpl_name =~ s/\s/_/g; - push @order_loop, { - selected => $order eq $_ ? 1 : 0, - ordervalue => $_, - 'order_' . $tmpl_name => 1, - }; -} my $sth = $dbh->prepare('SELECT code,description,repeatable,authorised_value_category FROM borrower_attribute_types @@ -139,19 +125,7 @@ while (my $row = $sth->fetchrow_hashref) { $row->{isclone} = $isclone; push @patron_attr_filter_loop, { %$row }; # careful: must store a *deep copy* of the modified row } continue { $isclone = 1, ++$serial } - foreach my $sortorder ('asc', 'desc') { - my $ordervalue = "patron_attr_${sortorder}_${code}"; - push @order_loop, { - selected => $order eq $ordervalue ? 1 : 0, - ordervalue => $ordervalue, - label => $row->{description}, - $sortorder => 1, - }; - } } continue { ++$ordinal } -for (@patron_attr_order_loop) { $_->{selected} = 1 if $order eq $_->{value} } - -$template->param(ORDER_LOOP => \@order_loop); my %borrowernumber_to_attributes; # hash of { borrowernumber => { attrcode => [ [val,display], [val,display], ... ] } } # i.e. val differs from display when attr is an authorised value diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt index 6c3ee80..5e5f466 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/overdue.tt @@ -3,6 +3,8 @@ Koha › Circulation › Items overdue as of [% todaysdate %] [% INCLUDE 'doc-head-close.inc' %] [% INCLUDE 'calendar.inc' %] +[% INCLUDE 'datatables.inc' %] + [%- USE Branches -%]