projects
/
koha.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revert "2298 2299 : Search.pm and opac-search.pl"
[koha.git]
/
C4
/
VirtualShelves.pm
diff --git
a/C4/VirtualShelves.pm
b/C4/VirtualShelves.pm
index
eaebb54
..
b8a5a83
100644
(file)
--- a/
C4/VirtualShelves.pm
+++ b/
C4/VirtualShelves.pm
@@
-27,6
+27,7
@@
use C4::Context;
use C4::Circulation;
use C4::Debug;
use C4::Members;
use C4::Circulation;
use C4::Debug;
use C4::Members;
+require C4::Auth;
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
use vars qw($VERSION @ISA @EXPORT @EXPORT_OK);
@@
-48,7
+49,6
@@
BEGIN {
);
}
);
}
-use C4::Auth qw(get_session);
my $dbh = C4::Context->dbh;
my $dbh = C4::Context->dbh;
@@
-252,7
+252,7
@@
from C4::Circulation.
=cut
=cut
-sub GetShelfContents ($
$;
$$) {
+sub GetShelfContents ($
;$
$$) {
my ($shelfnumber, $row_count, $offset, $sortfield) = @_;
my $dbh=C4::Context->dbh();
my $sth1 = $dbh->prepare("SELECT count(*) FROM virtualshelfcontents WHERE shelfnumber = ?");
my ($shelfnumber, $row_count, $offset, $sortfield) = @_;
my $dbh=C4::Context->dbh();
my $sth1 = $dbh->prepare("SELECT count(*) FROM virtualshelfcontents WHERE shelfnumber = ?");
@@
-264,8
+264,8
@@
sub GetShelfContents ($$;$$) {
($sortfield) = $sth2->fetchrow_array;
}
my $query =
($sortfield) = $sth2->fetchrow_array;
}
my $query =
- " SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded,
- biblio.*, biblioitems.itemtype,
itemtypes.*
+ " SELECT vc.biblionumber, vc.shelfnumber, vc.dateadded,
itemtypes.*,
+ biblio.*, biblioitems.itemtype,
biblioitems.publicationyear
FROM virtualshelfcontents vc
LEFT JOIN biblio ON vc.biblionumber = biblio.biblionumber
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
FROM virtualshelfcontents vc
LEFT JOIN biblio ON vc.biblionumber = biblio.biblionumber
LEFT JOIN biblioitems ON biblio.biblionumber = biblioitems.biblionumber
@@
-277,9
+277,11
@@
sub GetShelfContents ($$;$$) {
$query .= " DESC " if ($sortfield eq 'copyrightdate');
push (@params, $sortfield);
}
$query .= " DESC " if ($sortfield eq 'copyrightdate');
push (@params, $sortfield);
}
- $query .= " LIMIT ?, ? ";
- push (@params, ($offset ? $offset : 0));
- push (@params, $row_count);
+ if($row_count){
+ $query .= " LIMIT ?, ? ";
+ push (@params, ($offset ? $offset : 0));
+ push (@params, $row_count);
+ }
my $sth3 = $dbh->prepare($query);
$sth3->execute(@params);
return ($sth3->fetchall_arrayref({}), $total);
my $sth3 = $dbh->prepare($query);
$sth3->execute(@params);
return ($sth3->fetchall_arrayref({}), $total);
@@
-544,7
+546,7
@@
This function is used in conjunction with the 'Lists' button in masthead.inc.
sub RefreshShelvesSummary ($$$) {
my ($sessionID, $loggedinuser, $row_count) = @_;
sub RefreshShelvesSummary ($$$) {
my ($sessionID, $loggedinuser, $row_count) = @_;
- my $session = get_session($sessionID);
+ my $session =
C4::Auth::
get_session($sessionID);
my ($total, $totshelves, $barshelves, $pubshelves);
($barshelves, $totshelves) = GetRecentShelves(1, $row_count, $loggedinuser);
my ($total, $totshelves, $barshelves, $pubshelves);
($barshelves, $totshelves) = GetRecentShelves(1, $row_count, $loggedinuser);