summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/RHRD/rddb.pm16
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm
index 5aedef4..67b431f 100755
--- a/lib/RHRD/rddb.pm
+++ b/lib/RHRD/rddb.pm
@@ -907,15 +907,23 @@ sub get_shows_next_free_slot
sub list_shows
{
- my ($ctx) = @_;
+ my ($ctx, $groupname) = @_;
- my $sql = qq{select TO_CART,SET_USER_DEFINED from DROPBOXES where STATION_NAME=? order by TO_CART;};
+ my $sql = qq{select TO_CART,SET_USER_DEFINED from DROPBOXES where STATION_NAME = ? order by TO_CART;};
+ if(defined($groupname)) {
+ $sql = qq{select TO_CART,SET_USER_DEFINED from DROPBOXES where STATION_NAME = ? and GROUP_NAME = ? order by TO_CART;};
+ }
my $sth = $ctx->{'dbh'}->prepare($sql)
or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr);
- $sth->execute($ctx->{'config'}{'dropboxes'}{'dropbox-pseudo-station'})
- or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
+ unless(defined($groupname)) {
+ $sth->execute($ctx->{'config'}{'dropboxes'}{'dropbox-pseudo-station'})
+ or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
+ } else {
+ $sth->execute($ctx->{'config'}{'dropboxes'}{'dropbox-pseudo-station'}, $groupname)
+ or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
+ }
my @show_dbs;
while(my ($to_cart, $params, $lowcart, $highcart) = $sth->fetchrow_array()) {