X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=rt%2Flib%2FRT%2FTicket_Vendor.pm;h=a55bb7b0d503411a91a1852eb252fa68a0368351;hb=f2731f7f3883905cd17633f486d2aeb9593173da;hp=2039f3e2d7d13ca2093a51f866b0800d5108ef64;hpb=e02e5448d8fdad322dbe5562f92d9623e5d6f0dd;p=freeside.git diff --git a/rt/lib/RT/Ticket_Vendor.pm b/rt/lib/RT/Ticket_Vendor.pm index 2039f3e2d..a55bb7b0d 100644 --- a/rt/lib/RT/Ticket_Vendor.pm +++ b/rt/lib/RT/Ticket_Vendor.pm @@ -13,6 +13,37 @@ sub SetPriority { $Ticket->SUPER::SetPriority($value); } +=head2 Touch + +Creates a Touch transaction (a null transaction). Like Comment and +Correspond but without any content. + +=cut + +sub Touch { + my $self = shift; + my %args = ( + TimeTaken => 0, + ActivateScrips => 1, + CommitScrips => 1, + CustomFields => {}, + @_ + ); + unless ( $self->CurrentUserHasRight('ModifyTicket') + or $self->CurrentUserHasRight('CommentOnTicket') + or $self->CurrentUserHasRight('ReplyToTicket')) { + return ( 0, $self->loc("Permission Denied")); + } + $self->_NewTransaction( + Type => 'Touch', + TimeTaken => $args{'TimeTaken'}, + ActivateScrips => $args{'ActivateScrips'}, + CommitScrips => $args{'CommitScrips'}, + CustomFields => $args{'CustomFields'}, + ); +} + + =head2 MissingRequiredFields { Return all custom fields with the Required flag set for which this object @@ -33,4 +64,33 @@ sub MissingRequiredFields { return @results; } +# Declare the 'WillResolve' field +sub _VendorAccessible { + { + WillResolve => + {read => 1, write => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''}, + }, +}; + +sub WillResolveObj { + my $self = shift; + + my $time = new RT::Date( $self->CurrentUser ); + + if ( my $willresolve = $self->WillResolve ) { + $time->Set( Format => 'sql', Value => $willresolve ); + } + else { + $time->Set( Format => 'unix', Value => -1 ); + } + + return $time; +} + +sub WillResolveAsString { + my $self = shift; + return $self->WillResolveObj->AsString(); +} + + 1;