[Rt-commit] r8233 - in rt/branches/3.6-RELEASE: .
jesse at bestpractical.com
jesse at bestpractical.com
Thu Jul 19 15:30:02 EDT 2007
Author: jesse
Date: Thu Jul 19 15:30:01 2007
New Revision: 8233
Modified:
rt/branches/3.6-RELEASE/ (props changed)
rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm
Log:
r60965 at pinglin: jesse | 2007-07-19 15:29:22 -0400
* Backported 6766 to RT 3.6, with additional cleanups
Modified: rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm (original)
+++ rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm Thu Jul 19 15:30:01 2007
@@ -331,10 +331,6 @@
my $starts = new RT::Date( $session{'CurrentUser'} );
$starts->Set( Format => 'unknown', Value => $ARGS{'Starts'} );
- my @Requestors = split ( /\s*,\s*/, $ARGS{'Requestors'} );
- my @Cc = split ( /\s*,\s*/, $ARGS{'Cc'} );
- my @AdminCc = split ( /\s*,\s*/, $ARGS{'AdminCc'} );
-
my $MIMEObj = MakeMIMEEntity(
Subject => $ARGS{'Subject'},
From => $ARGS{'From'},
@@ -365,15 +361,32 @@
TimeLeft => $ARGS{'TimeLeft'},
TimeEstimated => $ARGS{'TimeEstimated'},
TimeWorked => $ARGS{'TimeWorked'},
- Requestor => \@Requestors,
- Cc => \@Cc,
- AdminCc => \@AdminCc,
Subject => $ARGS{'Subject'},
Status => $ARGS{'Status'},
Due => $due->ISO,
Starts => $starts->ISO,
MIMEObj => $MIMEObj
);
+
+ my @temp_squelch;
+ foreach my $type (qw(Requestors Cc AdminCc)) {
+ my @tmp = map { $_->format } grep { $_->address} Mail::Address->parse( $ARGS{ $type } );
+
+ $create_args{ $type } = [
+ grep $_, map {
+ my $user = RT::User->new( $RT::SystemUser );
+ $user->LoadOrCreateByEmail( $_ );
+ # convert to ids to avoid work later
+ $user->id;
+ } @tmp
+ ];
+ $RT::Logger->debug(
+ "$type got ".join(',',@{$create_args{ $type }}) );
+
+ }
+ # XXX: workaround for name conflict :(
+ $create_args{'Requestor'} = delete $create_args{'Requestors'};
+
foreach my $arg (keys %ARGS) {
next if $arg =~ /-(?:Magic|Category)$/;
More information about the Rt-commit
mailing list