summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
6c0962f)
Signed-off-by: Nicole C. Engard <nengard@bywatersolutions.com>
Signed-off-by: Ian Walls <ian.walls@bywatersolutions.com>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
my @params;
my $selection;
if (defined $owner) {
my @params;
my $selection;
if (defined $owner) {
- @params = ($owner, $mincategory, $row_count);
+ @params = ($owner, $mincategory);
$selection = ' WHERE owner = ? AND category = ?';
} else {
$selection = ' WHERE owner = ? AND category = ?';
} else {
- @params = ( $mincategory, $row_count);
+ @params = ( $mincategory);
$selection = ' WHERE category >= ? ';
}
my $query = 'SELECT * FROM virtualshelves';
$query .= $selection;
$selection = ' WHERE category >= ? ';
}
my $query = 'SELECT * FROM virtualshelves';
$query .= $selection;
- $query .= ' ORDER BY lastmodified DESC LIMIT ?';
+ $query .= ' ORDER BY lastmodified DESC';
+ if ($row_count){
+ $query .= ' LIMIT ?';
+ push @params,$row_count;
+ }
my $sth = $dbh->prepare($query);
$sth->execute(@params);
my $shelflist = $sth->fetchall_arrayref({});
my $sth = $dbh->prepare($query);
$sth->execute(@params);
my $shelflist = $sth->fetchall_arrayref({});
}
}
else { # this shelf doesn't already exist.
}
}
else { # this shelf doesn't already exist.
my ($shelflist);
my @shelvesloop;
my %shelvesloop;
#grab each type of shelf, open (type 3) should not be limited by user.
foreach my $shelftype (1,2,3) {
my ($shelflist);
my @shelvesloop;
my %shelvesloop;
#grab each type of shelf, open (type 3) should not be limited by user.
foreach my $shelftype (1,2,3) {
- my ($shelflist) = GetRecentShelves($shelftype, $limit, $shelftype == 3 ? undef : $loggedinuser);
+ my ($shelflist) = GetRecentShelves($shelftype, undef, $shelftype == 3 ? undef : $loggedinuser);
for my $shelf (@{ $shelflist }) {
push(@shelvesloop, $shelf->{shelfnumber});
$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};
for my $shelf (@{ $shelflist }) {
push(@shelvesloop, $shelf->{shelfnumber});
$shelvesloop{$shelf->{shelfnumber}} = $shelf->{shelfname};