[Bps-public-commit] r9458 - RT-Extension-SLA/lib/RT/Extension

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Oct 25 08:27:52 EDT 2007


Author: sunnavy
Date: Thu Oct 25 08:27:48 2007
New Revision: 9458

Added:
   RT-Extension-SLA/lib/RT/Extension/QueueSLA.pm

Log:
Queue SLA Attribute support

Added: RT-Extension-SLA/lib/RT/Extension/QueueSLA.pm
==============================================================================
--- (empty file)
+++ RT-Extension-SLA/lib/RT/Extension/QueueSLA.pm	Thu Oct 25 08:27:48 2007
@@ -0,0 +1,46 @@
+package RT::Extension::QueueSLA;
+
+our $VERSION = '0.01';
+
+
+=head1 NAME
+
+RT::Extension::QueueSLA - default SLA for Queue
+
+=cut
+
+use RT::Queue;
+package RT::Queue;
+
+use strict;
+use warnings;
+
+
+sub SLA {
+    my $self = shift;
+    my $value = shift;
+
+# TODO: ACL check
+#    return undef unless $self->CurrentUserHasRight('XXX');
+    my $attr = $self->FirstAttribute('SLA') or return undef;
+    return $attr->Content;
+}
+
+sub SetSLA {
+    my $self = shift;
+    my $value = shift;
+
+# TODO: ACL check
+#    return ( 0, $self->loc('Permission Denied') )
+#        unless $self->CurrentUserHasRight('XXX');
+
+    my ($status, $msg) = $self->SetAttribute(
+        Name        => 'SLA',
+        Description => 'Default Queue SLA',
+        Content     => $value,
+    );
+    return ($status, $msg) unless $status;
+    return ($status, $self->loc('Queue SLA changed'));
+}
+
+1;



More information about the Bps-public-commit mailing list