Bugzilla – Attachment 34404 Details for
Bug 13372
Items lost report improvements
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 13372: Sort is done by DataTables
Bug-13372-Sort-is-done-by-DataTables.patch (text/plain), 4.67 KB, created by
Jonathan Druart
on 2014-12-15 10:18:38 UTC
(
hide
)
Description:
Bug 13372: Sort is done by DataTables
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-12-15 10:18:38 UTC
Size:
4.67 KB
patch
obsolete
>From a16b71249796a8f7c531ad9a44ebdbbcf4dcf3b2 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >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 %] > > <form name="f" action="/cgi-bin/koha/reports/itemslost.pl" method="post"> >-<fieldset class="rows"><ol> <li><label for="orderbyfilter">Order by: </label> >- <select id="orderbyfilter" name="orderbyfilter"> >- <option value=""> --- </option> >- <option value="title">Title</option> >- <option value="author">Author</option> >- <option value="homebranch">Home library</option> >- <option value="itype">Item types</option> >- <option value="barcode">Barcode</option> >- <option value="price">Price</option> >- <option value="replacementprice">Replacement price</option> >- <option value="lib">Lost code</option> >- <option value="datelastseen">Date last seen</option> >- <option value="location">Location</option> >- </select></li> >- >+ <fieldset class="rows"> >+ <ol> >+ > <li><label for="barcodefilter">Barcode: </label><input type="text" name="barcodefilter" id="barcodefilter" size="6" /></li> > <li><label for="branchfilter">Library: </label><select name="branchfilter" id="branchfilter"> > <option value="">All</option> >diff --git a/reports/itemslost.pl b/reports/itemslost.pl >index cb283d5..427cd07 100755 >--- a/reports/itemslost.pl >+++ b/reports/itemslost.pl >@@ -53,7 +53,6 @@ my $params = $query->Vars; > my $get_items = $params->{'get_items'}; > > if ( $get_items ) { >- my $orderbyfilter = $params->{'orderbyfilter'} || undef; > my $branchfilter = $params->{'branchfilter'} || undef; > my $barcodefilter = $params->{'barcodefilter'} || undef; > my $itemtypesfilter = $params->{'itemtypesfilter'} || undef; >@@ -63,11 +62,11 @@ if ( $get_items ) { > $where{'homebranch'} = $branchfilter if defined $branchfilter; > $where{'barcode'} = $barcodefilter if defined $barcodefilter; > $where{'authorised_value'} = $loststatusfilter if defined $loststatusfilter; >- >+ > my $itype = C4::Context->preference('item-level_itypes') ? "itype" : "itemtype"; > $where{$itype} = $itemtypesfilter if defined $itemtypesfilter; > >- my $items = GetLostItems( \%where, $orderbyfilter ); >+ my $items = GetLostItems( \%where ); > foreach my $it (@$items) { > $it->{'datelastseen'} = format_date($it->{'datelastseen'}); > } >-- >2.1.0
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 13372
:
34062
|
34163
|
34404
|
34913
|
34914