diff options
Diffstat (limited to 'rt/share/html/Ticket/Create.html')
-rwxr-xr-x | rt/share/html/Ticket/Create.html | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/rt/share/html/Ticket/Create.html b/rt/share/html/Ticket/Create.html index 28b655691..2c8e35778 100755 --- a/rt/share/html/Ticket/Create.html +++ b/rt/share/html/Ticket/Create.html @@ -112,6 +112,7 @@ </td> <td class="value" colspan="5"> <input name="Subject" size="60" maxsize="200" value="<%$ARGS{Subject} || ''%>" /> +% $m->callback( %ARGS, CallbackName => 'AfterSubject' ); </td> </tr> <tr> @@ -158,6 +159,7 @@ % } else { <& /Elements/MessageBox, QuoteTransaction => $QuoteTransaction &> %} +% $m->callback( %ARGS, QueueObj => $QueueObj, CallbackName => 'AfterMessageBox' ); <br /> </td> @@ -392,6 +394,22 @@ if ( !exists $ARGS{'AddMoreAttach'} && ($ARGS{'id'}||'') eq 'new' ) { $checks_failure = 1 unless $status; } +# check email addresses for RT's +{ + foreach my $field ( qw(Requestors Cc AdminCc) ) { + my $value = $ARGS{ $field }; + next unless defined $value && length $value; + + my @emails = Email::Address->parse( $value ); + foreach my $email ( grep RT::EmailParser->IsRTAddress($_->address), @emails ) { + push @results, loc("[_1] is an address RT receives mail at. Adding it as a '[_2]' would create a mail loop", $email->format, loc($field =~ /^(.*?)s?$/) ); + $checks_failure = 1; + $email = undef; + } + $ARGS{ $field } = join ', ', map $_->format, grep defined, @emails; + } +} + my $skip_create = 0; $m->callback( CallbackName => 'BeforeCreate', ARGSRef => \%ARGS, skip_create => \$skip_create, checks_failure => $checks_failure, results => \@results ); |