diff options
author | Mark Wells <mark@freeside.biz> | 2015-07-10 16:38:28 -0700 |
---|---|---|
committer | Mark Wells <mark@freeside.biz> | 2015-07-10 16:38:28 -0700 |
commit | 0ed195595b5c7ea404c8848d9d1881ada4214489 (patch) | |
tree | 6d6f3fe6e980cd123ff7a648d27fb9eb6b16ab13 /rt/lib/RT/ObjectTopic.pm | |
parent | af05c3dda381122e0a45f72dbc0b4e9492f13fe7 (diff) | |
parent | df4a68099abfa067014f36f92874fccefdea662e (diff) |
Merge branch 'master' of git.freeside.biz:/home/git/freeside
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 c17ca481c..33646305c 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; |