From 050fd17801c6e1577eca4eca42de117cf97a203c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 15 Dec 2014 11:16:50 +0100 Subject: [PATCH] [PASSED QA] Bug 13372: Sort is done by DataTables This patch removes the order by filter on the items lost report. The sort can now be done by DataTables. Signed-off-by: Kyle M Hall --- C4/Items.pm | 13 ++----------- .../prog/en/modules/reports/itemslost.tt | 18 +++--------------- reports/itemslost.pl | 5 ++--- 3 files changed, 7 insertions(+), 29 deletions(-) diff --git a/C4/Items.pm b/C4/Items.pm index 35407ce..bad2a82 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -958,7 +958,7 @@ sub GetItemLocation { =head2 GetLostItems - $items = GetLostItems( $where, $orderby ); + $items = GetLostItems( $where ); This function gets a list of lost items. @@ -972,9 +972,6 @@ and the value to match as value. For example: { barcode => 'abc123', homebranch => 'CPL', } -C<$orderby> is a field of the items table by which the resultset -should be orderd. - =item return: C<$items> is a reference to an array full of hashrefs with columns @@ -983,7 +980,7 @@ from the "items" table as keys. =item usage in the perl script: my $where = { barcode => '0001548' }; - my $items = GetLostItems( $where, "homebranch" ); + my $items = GetLostItems( $where ); $template->param( itemsloop => $items ); =back @@ -993,7 +990,6 @@ from the "items" table as keys. sub GetLostItems { # Getting input args. my $where = shift; - my $orderby = shift; my $dbh = C4::Context->dbh; my $query = " @@ -1013,11 +1009,6 @@ sub GetLostItems { $query .= " AND $key LIKE ?"; push @query_parameters, "%$where->{$key}%"; } - my @ordervalues = qw/title author homebranch itype barcode price replacementprice lib datelastseen location/; - - if ( defined $orderby && grep($orderby, @ordervalues)) { - $query .= ' ORDER BY '.$orderby; - } my $sth = $dbh->prepare($query); $sth->execute( @query_parameters ); diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt index b751a29..e72f446 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/itemslost.tt @@ -96,21 +96,9 @@ [% ELSE %]
-
  1. -
  2. - +
    +
      +