NewValue => undef,
MIMEObj => undef,
ActivateScrips => 1,
- CommitScrips => 1,
- ObjectType => 'RT::Ticket',
- ObjectId => 0,
- ReferenceType => undef,
- OldReference => undef,
- NewReference => undef,
+ CommitScrips => 1,
+ ObjectType => 'RT::Ticket',
+ ObjectId => 0,
+ ReferenceType => undef,
+ OldReference => undef,
+ NewReference => undef,
+ CustomFields => {},
@_
);
#lets create our transaction
my %params = (
- Type => $args{'Type'},
- Data => $args{'Data'},
- Field => $args{'Field'},
- OldValue => $args{'OldValue'},
- NewValue => $args{'NewValue'},
- Created => $args{'Created'},
- ObjectType => $args{'ObjectType'},
- ObjectId => $args{'ObjectId'},
+ Type => $args{'Type'},
+ Data => $args{'Data'},
+ Field => $args{'Field'},
+ OldValue => $args{'OldValue'},
+ NewValue => $args{'NewValue'},
+ Created => $args{'Created'},
+ ObjectType => $args{'ObjectType'},
+ ObjectId => $args{'ObjectId'},
ReferenceType => $args{'ReferenceType'},
- OldReference => $args{'OldReference'},
- NewReference => $args{'NewReference'},
+ OldReference => $args{'OldReference'},
+ NewReference => $args{'NewReference'},
);
# Parameters passed in during an import that we probably don't want to touch, otherwise
- foreach my $attr qw(id Creator Created LastUpdated TimeTaken LastUpdatedBy) {
+ foreach my $attr (qw(id Creator Created LastUpdated TimeTaken LastUpdatedBy)) {
$params{$attr} = $args{$attr} if ($args{$attr});
}
}
}
+ # Set up any custom fields passed at creation. Has to happen
+ # before scrips.
+
+ $self->UpdateCustomFields(%{ $args{'CustomFields'} });
#Provide a way to turn off scrips if we need to
$RT::Logger->debug('About to think about scrips for transaction #' .$self->Id);
returns undef.
Takes a paramhash. If the $args{'Quote'} parameter is set, wraps this message
-at $args{'Wrap'}. $args{'Wrap'} defaults to 70.
+at $args{'Wrap'}. $args{'Wrap'} defaults to $RT::MessageBoxWidth - 2 or 70.
If $args{'Type'} is set to C<text/html>, this will return an HTML
part of the message, if available. Otherwise it looks for a text/plain
Type => $PreferredContentType || '',
Quote => 0,
Wrap => 70,
+ Wrap => ( $RT::MessageBoxWidth || 72 ) - 2,
@_
);
$max = length if length > $max;
}
- if ( $max > 76 ) {
+ if ( $max > $args{'Wrap'}+6 ) { # 76 ) {
require Text::Wrapper;
my $wrapper = new Text::Wrapper(
columns => $args{'Wrap'},
unless ( $arg =~
/^(?:Object-RT::Transaction--)?CustomField-(\d+)/ );
next if $arg =~ /-Magic$/;
+ next if $arg =~ /-TimeUnits$/;
my $cfid = $1;
my $values = $args->{$arg};
foreach