-
-
-=head2 SetDisabled
-
-Takes a boolean.
-1 will cause this queue to no longer be available for tickets.
-0 will re-enable this queue.
-
-=cut
-
-sub SetDisabled {
- my $self = shift;
- my $val = shift;
-
- $RT::Handle->BeginTransaction();
- my ($ok, $msg) = $self->_Set( Field =>'Disabled', Value => $val);
- unless ($ok) {
- $RT::Handle->Rollback();
- $RT::Logger->warning("Couldn't ".(($val == 0) ? "enable" : "disable")." queue ".$self->Name.": $msg");
- return ($ok, $msg);
- }
- $self->_NewTransaction( Type => ($val == 0) ? "Enabled" : "Disabled" );
-
- $RT::Handle->Commit();
-
- RT->System->QueueCacheNeedsUpdate(1);
-
- if ( $val == 0 ) {
- return (1, $self->loc("Queue enabled"));
- } else {
- return (1, $self->loc("Queue disabled"));
- }
-
-}
-
-
-