From cc119bd856eb557bfc0107919a1ac06a669b944b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 15 Dec 2014 11:16:50 +0100 Subject: [PATCH] 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 Signed-off-by: Tomas Cohen Arazi --- 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 aea1c1d159..22a8bc2d08 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -960,7 +960,7 @@ sub GetItemLocation { =head2 GetLostItems - $items = GetLostItems( $where, $orderby ); + $items = GetLostItems( $where ); This function gets a list of lost items. @@ -974,9 +974,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 @@ -985,7 +982,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 @@ -995,7 +992,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 = " @@ -1015,11 +1011,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 b751a290bd..e72f446c41 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. - +
    +
      +