diff options
author | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
---|---|---|
committer | Ivan Kohler <ivan@freeside.biz> | 2015-07-09 22:18:55 -0700 |
commit | 1c538bfabc2cd31f27067505f0c3d1a46cba6ef0 (patch) | |
tree | 96922ad4459eda1e649327fd391d60c58d454c53 /rt/lib/RT/ObjectTopic.pm | |
parent | 4f5619288413a185e9933088d9dd8c5afbc55dfa (diff) |
RT 4.2.11, ticket#13852
Diffstat (limited to 'rt/lib/RT/ObjectTopic.pm')
-rw-r--r-- | rt/lib/RT/ObjectTopic.pm | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/rt/lib/RT/ObjectTopic.pm b/rt/lib/RT/ObjectTopic.pm index c17ca48..3364630 100644 --- a/rt/lib/RT/ObjectTopic.pm +++ b/rt/lib/RT/ObjectTopic.pm @@ -63,12 +63,10 @@ use strict; use warnings; no warnings 'redefine'; -use RT::Record; -use RT::Topic; - - use base qw( RT::Record ); +use RT::Topic; + sub _Init { my $self = shift; @@ -95,18 +93,16 @@ Create takes a hash of values and creates a row in the database: sub Create { my $self = shift; - my %args = ( + my %args = ( Topic => '0', ObjectType => '', ObjectId => '0', - - @_); + @_); $self->SUPER::Create( Topic => $args{'Topic'}, ObjectType => $args{'ObjectType'}, ObjectId => $args{'ObjectId'}, -); - + ); } @@ -146,10 +142,10 @@ Returns the Topic Object which has the id returned by Topic =cut sub TopicObj { - my $self = shift; - my $Topic = RT::Topic->new($self->CurrentUser); - $Topic->Load($self->Topic()); - return($Topic); + my $self = shift; + my $Topic = RT::Topic->new($self->CurrentUser); + $Topic->Load($self->Topic()); + return($Topic); } =head2 ObjectType @@ -191,19 +187,31 @@ Returns (1, 'Status message') on success and (0, 'Error Message') on failure. sub _CoreAccessible { { - id => - {read => 1, type => 'int(11)', default => ''}, + {read => 1, type => 'int(11)', default => ''}, Topic => - {read => 1, write => 1, type => 'int(11)', default => '0'}, + {read => 1, write => 1, type => 'int(11)', default => '0'}, ObjectType => - {read => 1, write => 1, type => 'varchar(64)', default => ''}, + {read => 1, write => 1, type => 'varchar(64)', default => ''}, ObjectId => - {read => 1, write => 1, type => 'int(11)', default => '0'}, + {read => 1, write => 1, type => 'int(11)', default => '0'}, } }; +sub FindDependencies { + my $self = shift; + my ($walker, $deps) = @_; + + $self->SUPER::FindDependencies($walker, $deps); + + $deps->Add( out => $self->TopicObj ); + + my $obj = $self->ObjectType->new( $self->CurrentUser ); + $obj->Load( $self->ObjectId ); + $deps->Add( out => $obj ); +} + RT::Base->_ImportOverlays(); 1; |