%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
%# <sales@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
my $ticket = LoadTicket($1);
- if ( $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ) {
- my $notes = MIME::Entity->build(
- Data => [ $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ]
- );
- RT::I18N::SetMIMEEntityToUTF8($notes); # convert text parts into utf-8
+ my $skip_update = 0;
+ $m->callback( CallbackName => 'BeforeApproval',
+ skip_update => \$skip_update,
+ Ticket => $ticket,
+ actions => \@actions);
+ next if $skip_update;
- my ( $notesval, $notesmsg ) = $ticket->Correspond( MIMEObj => $notes );
+ if ( $ARGS{ "Approval-" . $ticket->Id . "-Notes" } ) {
+ my ( $notesval, $notesmsg ) = $ticket->Correspond(
+ Content => $ARGS{ "Approval-" . $ticket->Id . "-Notes" }
+ );
if ($notesval) {
push ( @actions, loc("Approval #[_1]: Notes recorded",$ticket->Id ));
} else {