5 # Special case: Pass a value starting with 'R' to set priority
6 # relative to the current level. Used for bulk updates, though
7 # it can be used anywhere else too.
10 if ( $value =~ /^R([+-]?\d+)$/ ) {
11 $value = $1 + ($Ticket->Priority || 0);
13 $Ticket->SUPER::SetPriority($value);
18 Creates a Touch transaction (a null transaction). Like Comment and
19 Correspond but without any content.
32 unless ( $self->CurrentUserHasRight('ModifyTicket')
33 or $self->CurrentUserHasRight('CommentOnTicket')
34 or $self->CurrentUserHasRight('ReplyToTicket')) {
35 return ( 0, $self->loc("Permission Denied"));
37 $self->_NewTransaction(
39 TimeTaken => $args{'TimeTaken'},
40 ActivateScrips => $args{'ActivateScrips'},
41 CommitScrips => $args{'CommitScrips'},
42 CustomFields => $args{'CustomFields'},
47 =head2 MissingRequiredFields {
49 Return all custom fields with the Required flag set for which this object
50 doesn't have any non-empty values.
54 sub MissingRequiredFields {
56 my $CustomFields = $self->CustomFields;
58 while ( my $CF = $CustomFields->Next ) {
59 next if !$CF->Required;
60 if ( !length($self->FirstCustomFieldValue($CF->Id) || '') ) {
67 # Declare the 'WillResolve' field
68 sub _VendorAccessible {
71 {read => 1, write => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
78 my $time = new RT::Date( $self->CurrentUser );
80 if ( my $willresolve = $self->WillResolve ) {
81 $time->Set( Format => 'sql', Value => $willresolve );
84 $time->Set( Format => 'unix', Value => -1 );
90 sub WillResolveAsString {
92 return $self->WillResolveObj->AsString();
97 Returns true if there's a Correspond or Create transaction more recent than
98 the Told date of this ticket (or the ticket has no Told date) and the ticket
99 is not rejected or resolved.
105 return 0 if $self->Status eq 'resolved'
106 or $self->Status eq 'rejected';
108 my $Told = $self->Told || '1970-01-01';
109 my $Txns = $self->Transactions;
110 $Txns->Limit(FIELD => 'Type',
112 VALUE => [ 'Correspond', 'Create' ]);
113 $Txns->Limit(FIELD => 'Created',
116 $Txns->Count ? 1 : 0;