From a16b71249796a8f7c531ad9a44ebdbbcf4dcf3b2 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. --- C4/Items.pm | 13 ++----------- .../intranet-tmpl/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 aab6582..91bc0ab 100644 --- a/C4/Items.pm +++ b/C4/Items.pm @@ -957,7 +957,7 @@ sub GetItemLocation { =head2 GetLostItems - $items = GetLostItems( $where, $orderby ); + $items = GetLostItems( $where ); This function gets a list of lost items. @@ -971,9 +971,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 @@ -982,7 +979,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 @@ -992,7 +989,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 = " @@ -1012,11 +1008,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. - +
    +
      +