diff options
author | Christian Pointner <equinox@helsinki.at> | 2016-07-31 16:13:40 (GMT) |
---|---|---|
committer | Christian Pointner <equinox@helsinki.at> | 2016-07-31 16:13:40 (GMT) |
commit | 0a0d031e1c33411188fdd51d99ee61b0434c3742 (patch) | |
tree | b505630e5e2369e23f7c2ebb0ee9770da62d9726 /lib/RHRD | |
parent | 131be9a185bd6d92cd0bafc9892a0a51189a3946 (diff) |
updating pool title works too
Diffstat (limited to 'lib/RHRD')
-rwxr-xr-x | lib/RHRD/rddb.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm index 3d19ff5..d0c2a47 100755 --- a/lib/RHRD/rddb.pm +++ b/lib/RHRD/rddb.pm @@ -2260,6 +2260,28 @@ sub create_musicpool_dropbox return ($cnt, 'OK', 'success'); } +sub update_musicpool_title +{ + my ($ctx, $shortname, $title) = @_; + + my ($groupname, $status, $errorstring) = get_musicpool_group($ctx, $shortname); + unless (defined $groupname) { + return (undef, $status, $errorstring); + } + + my $sql = qq{update GROUPS set DESCRIPTION = ? where NAME = ?;}; + + my $sth = $ctx->{'dbh'}->prepare($sql) + or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr); + + my $cnt = $sth->execute($title, $groupname) + or return (undef, 'ERROR', "Database Error: " . $sth->errstr); + + $sth->finish(); + + return ($cnt, 'OK', 'success'); +} + sub remove_musicpool { my ($ctx, $shortname) = @_; |