[Rt-commit] r5236 -
RT-Extension-CommandByEmail/lib/RT/Interface/Email/Filter
ruz at bestpractical.com
ruz at bestpractical.com
Tue May 16 13:24:26 EDT 2006
Author: ruz
Date: Tue May 16 13:24:24 2006
New Revision: 5236
Modified:
RT-Extension-CommandByEmail/lib/RT/Interface/Email/Filter/TakeAction.pm
Log:
* CF.{} is compliant with QB
* implement crazy regexp for CFs, but document only canonic variant
Modified: RT-Extension-CommandByEmail/lib/RT/Interface/Email/Filter/TakeAction.pm
==============================================================================
--- RT-Extension-CommandByEmail/lib/RT/Interface/Email/Filter/TakeAction.pm (original)
+++ RT-Extension-CommandByEmail/lib/RT/Interface/Email/Filter/TakeAction.pm Tue May 16 13:24:24 2006
@@ -45,12 +45,12 @@
+HasMember:
+MemberOf:
-CustomField{C<CFName>}:
-AddCustomField{C<CFName>}:
-DelCustomField{C<CFName>}:
-CF{C<CFName>}:
-AddCF{C<CFName>}:
-DelCF{C<CFName>}:
+CustomField.{C<CFName>}:
+AddCustomField.{C<CFName>}:
+DelCustomField.{C<CFName>}:
+CF.{C<CFName>}:
+AddCF.{C<CFName>}:
+DelCF.{C<CFName>}:
=cut
@@ -98,12 +98,8 @@
push( @items, $1 => $2 );
}
my %cmds;
- while ( my $key = lc shift @items ) {
- # canonicalize CF commands
- $key =~ s/^(add|del|)cf/$1customfield/i;
-
+ while ( my $key = _CanonicalizeCommand( lc shift @items ) ) {
my $val = shift @items;
-
# strip leading and trailing spaces
$val =~ s/^\s+|\s+$//g;
@@ -436,7 +432,13 @@
};
}
-1;
+
+sub _CanonicalizeCommand {
+ my $key = shift;
+ # CustomField commands
+ $key =~ s/^(add|del|)c(?:field)?-?f(?:ield)?\.?[({\[](.*)[)}\]]$/$1customfield{$2}/i;
+ return $key;
+}
sub _SetWatcherAttribute {
my $ticket = shift;
@@ -466,10 +468,12 @@
my $report_msg = '';
- foreach my $key (keys %$report) {
+ foreach my $key ( keys %$report ) {
+ unless $result
# $report_msg .= $key.":".$report->{$key}->{'value'};
}
}
+
1;
More information about the Rt-commit
mailing list