@@ -, +, @@
- replaces the MySQLism SQL_CALC_FOUND_ROWS
- uses Koha::DateUtils instead of C4::Dates
- replaces "branch" and "location" with "library"
- fixes wrong capitalisation on "Clear all" and "Select all"
---
C4/Items.pm | 21 +++++++++++-------
.../prog/en/modules/tools/inventory.tt | 23 ++++++++++----------
tools/ajax-inventory.pl | 22 +------------------
tools/inventory.pl | 18 +++++++++------
4 files changed, 37 insertions(+), 47 deletions(-)
--- a/C4/Items.pm
+++ a/C4/Items.pm
@@ -992,12 +992,15 @@ sub GetItemsForInventory {
my $dbh = C4::Context->dbh;
my ( @bind_params, @where_strings );
- my $query = <<'END_SQL';
-SELECT SQL_CALC_FOUND_ROWS items.itemnumber, barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, stocknumber
-FROM items
- LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
- LEFT JOIN biblioitems on items.biblionumber = biblioitems.biblionumber
-END_SQL
+ my $select_columns = q{
+ SELECT SQL_CALC_FOUND_ROWS items.itemnumber, barcode, itemcallnumber, title, author, biblio.biblionumber, biblio.frameworkcode, datelastseen, homebranch, location, notforloan, damaged, itemlost, stocknumber
+ };
+ my $select_count = q{SELECT COUNT(*)};
+ my $query = q{
+ FROM items
+ LEFT JOIN biblio ON items.biblionumber = biblio.biblionumber
+ LEFT JOIN biblioitems on items.biblionumber = biblioitems.biblionumber
+ };
if ($statushash){
for my $authvfield (keys %$statushash){
if ( scalar @{$statushash->{$authvfield}} > 0 ){
@@ -1052,14 +1055,16 @@ END_SQL
$query .= join ' AND ', @where_strings;
}
$query .= ' ORDER BY items.cn_sort, itemcallnumber, title';
+ my $count_query = $select_count . $query;
$query .= " LIMIT $offset, $size" if ($offset and $size);
+ $query = $select_columns . $query;
my $sth = $dbh->prepare($query);
$sth->execute( @bind_params );
my @results;
my $tmpresults = $sth->fetchall_arrayref({});
- $sth = $dbh->prepare("SELECT FOUND_ROWS()");
- $sth->execute();
+ $sth = $dbh->prepare( $count_query );
+ $sth->execute( @bind_params );
my ($iTotalRecords) = $sth->fetchrow_array();
foreach my $row (@$tmpresults) {
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
+++ a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/inventory.tt
@@ -1,3 +1,4 @@
+[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
Koha › Tools › Inventory
[% INCLUDE 'doc-head-close.inc' %]
@@ -16,8 +17,8 @@ $(document).ready(function(){
} ));
- $("#continuewithoutmarkingbutton").click(function(){
- inventorydt.fnPageChange( 'next' );
+ $("#continuewithoutmarkingbutton").click(function(){
+ inventorydt.fnPageChange( 'next' );
return false;
});
@@ -82,7 +83,7 @@ $(document).ready(function(){
Inventory/Stocktaking
- [% IF (moddatecount) %]
[% moddatecount %] items modified : datelastseen set to [% date %]
[% END %]
+ [% IF (moddatecount) %]
[% moddatecount %] items modified : datelastseen set to [% date | $KohaDates %]
[% END %]
[% IF (errorfile) %]
[% errorfile %] can't be opened
[% END %]
[% FOREACH error IN errorloop %]
@@ -100,7 +101,7 @@ $(document).ready(function(){
-
- -
+
-
@@ -109,10 +110,10 @@ $(document).ready(function(){
-
Home library
- Current location
+ Current library
-