summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rwxr-xr-xlib/RHRD/rddb.pm24
1 files changed, 24 insertions, 0 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm
index 228f76c..26dcc12 100755
--- a/lib/RHRD/rddb.pm
+++ b/lib/RHRD/rddb.pm
@@ -197,6 +197,30 @@ sub get_next_free_slot
return ($low_cart, $high_cart);
}
+sub set_cut_evergreen
+{
+ my ($ctx, $cart, $cut, $value) = @_;
+
+ my $cut_name = sprintf("%06d_%03d", $cart, $cut);
+ if($value && $value ne 'N') {
+ $value = 'Y';
+ } else {
+ $value = 'N';
+ }
+
+ my $sql = qq{update CUTS set EVERGREEN = ? where CUT_NAME = ?;};
+
+ my $sth = $ctx->{'dbh'}->prepare($sql)
+ or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr);
+
+ my $cnt = $sth->execute($value, $cut_name)
+ or return (undef, 'ERROR', "Database Error: " . $sth->errstr);
+
+ $sth->finish();
+
+ return ($cnt, 'OK', 'success');
+}
+
sub check_log_exists
{
my ($ctx, $logname) = @_;