X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FObjectTopic.pm;h=c9429fd1bf6f7b17798ce3928f188b9134ff8f54;hp=8ca01ae9d94187cebfa1ced81fccd094b296b110;hb=7322f2afedcc2f427e997d1535a503613a83f088;hpb=3d0a1bb06b895c5be6e3f0517d355442a6b1e125 diff --git a/rt/lib/RT/ObjectTopic.pm b/rt/lib/RT/ObjectTopic.pm index 8ca01ae9d..c9429fd1b 100644 --- a/rt/lib/RT/ObjectTopic.pm +++ b/rt/lib/RT/ObjectTopic.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2016 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -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;