=cut
use strict;
+use warnings;
use CGI;
use C4::Auth;
use C4::Output;
query => $query,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { circulate => 1 },
+ flagsrequired => { circulate => "circulate_remaining_permissions" },
debug => 1,
}
);
sub GetHoldsQueueItems {
my ($branchlimit,$itemtypelimit) = @_;
my $dbh = C4::Context->dbh;
- my $query = "SELECT * FROM tmp_holdsqueue";
- $query.=" WHERE holdingbranch = \"$branchlimit\"" if $branchlimit;
+
+ my @bind_params = ();
+ my $query = q/SELECT tmp_holdsqueue.*, biblio.author, items.ccode, items.location, items.enumchron, items.cn_sort, biblioitems.publishercode,biblio.copyrightdate,biblioitems.publicationyear,biblioitems.pages,biblioitems.size,biblioitems.publicationyear,biblioitems.isbn
+ FROM tmp_holdsqueue
+ JOIN biblio USING (biblionumber)
+ LEFT JOIN biblioitems USING (biblionumber)
+ LEFT JOIN items USING (itemnumber)
+ /;
+ if ($branchlimit) {
+ $query .=" WHERE tmp_holdsqueue.holdingbranch = ?";
+ push @bind_params, $branchlimit;
+ }
+ $query .= " ORDER BY ccode, location, cn_sort, author, title, pickbranch, reservedate";
my $sth = $dbh->prepare($query);
- $sth->execute();
+ $sth->execute(@bind_params);
my $items = [];
while ( my $row = $sth->fetchrow_hashref ){
$row->{reservedate} = format_date($row->{reservedate});