[otrs-cvs] CVS: otrs/Kernel/System/Ticket Article.pm,1.107,1.108
cvs-log at otrs.org
cvs-log at otrs.org
Mon Jul 24 13:40:35 CEST 2006
Update of /home/cvs/otrs/Kernel/System/Ticket
In directory lancelot:/tmp/cvs-serv30359/Kernel/System/Ticket
Modified Files:
Article.pm
Log Message:
added <OTRS_CUSTOMER_DATA_*> tags to auto responses
Index: Article.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Ticket/Article.pm,v
retrieving revision 1.107
retrieving revision 1.108
diff -C2 -r1.107 -r1.108
*** Article.pm 13 Jun 2006 14:12:32 -0000 1.107
--- Article.pm 24 Jul 2006 10:40:32 -0000 1.108
***************
*** 1563,1566 ****
--- 1563,1572 ----
# get ref of email params
my %GetParam = %{$Param{CustomerMessageParams}};
+ # fill up required attributes
+ foreach (qw(Subject Body)) {
+ if (!$GetParam{$_}) {
+ $GetParam{$_} = '-';
+ }
+ }
# get old article for quoteing
my %Article = $Self->ArticleLastCustomerArticle(TicketID => $Param{TicketID});
***************
*** 2078,2081 ****
--- 2084,2104 ----
$Param{Body} =~ s/<OTRS_TICKET_.+?>/-/gi;
+ # get customer data and replace it with <OTRS_CUSTOMER_DATA_...
+ if ($Article{CustomerUserID}) {
+ my %CustomerUser = $Self->{CustomerUserObject}->CustomerUserDataGet(
+ User => $Article{CustomerUserID},
+ );
+ # replace customer stuff with tags
+ foreach (keys %CustomerUser) {
+ if ($CustomerUser{$_}) {
+ $Param{Body} =~ s/<OTRS_CUSTOMER_DATA_$_>/$CustomerUser{$_}/gi;
+ $Param{Subject} =~ s/<OTRS_CUSTOMER_DATA_$_>/$CustomerUser{$_}/gi;
+ }
+ }
+ }
+ # cleanup all not needed <OTRS_CUSTOMER_DATA_ tags
+ $Param{Body} =~ s/<OTRS_CUSTOMER_DATA_.+?>/-/gi;
+ $Param{Subject} =~ s/<OTRS_CUSTOMER_DATA_.+?>/-/gi;
+
# replace config options
$Param{Body} =~ s{<OTRS_CONFIG_(.+?)>}{$Self->{ConfigObject}->Get($1)}egx;
More information about the cvs-log
mailing list