[otrs-cvs] otrs/Kernel/System/PostMaster FollowUp.pm, 1.57, 1.58 NewTicket.pm, 1.66, 1.67
CVS commits notifications of OTRS.org
cvs-log at otrs.org
Tue Apr 29 18:39:39 GMT 2008
Comments:
Update of /home/cvs/otrs/Kernel/System/PostMaster
In directory lancelot:/tmp/cvs-serv23573/Kernel/System/PostMaster
Modified Files:
FollowUp.pm NewTicket.pm
Log Message:
Added X-OTRS-TicketTime and X-OTRS-FollowUp-TicketTime email header support as additional attributes like already existing X-OTRS-Header.
Author: martin
Index: FollowUp.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/PostMaster/FollowUp.pm,v
retrieving revision 1.57
retrieving revision 1.58
diff -C2 -d -r1.57 -r1.58
*** FollowUp.pm 31 Jan 2008 06:20:20 -0000 1.57
--- FollowUp.pm 29 Apr 2008 18:39:34 -0000 1.58
***************
*** 30,34 ****
# check needed Objects
! for (qw(DBObject ConfigObject TicketObject LogObject ParseObject)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
--- 30,34 ----
# check needed Objects
! for (qw(DBObject ConfigObject TicketObject LogObject TimeObject ParseObject)) {
$Self->{$_} = $Param{$_} || die "Got no $_!";
}
***************
*** 210,227 ****
# set free ticket text
my @Values = ( 'X-OTRS-FollowUp-TicketKey', 'X-OTRS-FollowUp-TicketValue' );
! my $CounterTmp = 0;
! while ( $CounterTmp <= 16 ) {
! $CounterTmp++;
! if ( $GetParam{"$Values[0]$CounterTmp"} ) {
$Self->{TicketObject}->TicketFreeTextSet(
TicketID => $Param{TicketID},
! Key => $GetParam{"$Values[0]$CounterTmp"},
! Value => $GetParam{"$Values[1]$CounterTmp"},
! Counter => $CounterTmp,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "TicketKey$CounterTmp: " . $GetParam{"$Values[0]$CounterTmp"} . "\n";
! print "TicketValue$CounterTmp: " . $GetParam{"$Values[1]$CounterTmp"} . "\n";
}
}
--- 210,254 ----
# set free ticket text
my @Values = ( 'X-OTRS-FollowUp-TicketKey', 'X-OTRS-FollowUp-TicketValue' );
! for my $Count ( 1..16 ) {
! if ( $GetParam{ $Values[0] . $Count } ) {
$Self->{TicketObject}->TicketFreeTextSet(
TicketID => $Param{TicketID},
! Key => $GetParam{ $Values[0] . $Count },
! Value => $GetParam{ $Values[1] . $Count },
! Counter => $Count,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "TicketKey$Count: " . $GetParam{ $Values[0]. $Count } . "\n";
! print "TicketValue$Count: " . $GetParam{ $Values[1]. $Count } . "\n";
! }
! }
! }
!
! # set ticket free time
! for my $Count ( 1..6 ) {
! my $Key = 'X-OTRS-FollowUp-TicketTime' . $Count;
! if ( $GetParam{ $Key } ) {
! my $SystemTime = $Self->{TimeObject}->TimeStamp2SystemTime(
! String => $GetParam{ $Key },
! );
! my ($Sec, $Min, $Hour, $Day, $Month, $Year) = $Self->{TimeObject}->SystemTime2Date(
! SystemTime => $SystemTime,
! );
! if ( $Year && $Month && $Day && $Hour && $Min ) {
! $Self->{TicketObject}->TicketFreeTimeSet(
! 'TicketFreeTime' . $Count . 'Year' => $Year,
! 'TicketFreeTime' . $Count . 'Month' => $Month,
! 'TicketFreeTime' . $Count . 'Day' => $Day,
! 'TicketFreeTime' . $Count . 'Hour' => $Hour,
! 'TicketFreeTime' . $Count . 'Minute' => $Min,
! Prefix => 'TicketFreeTime',
! TicketID => $Param{TicketID},
! Counter => $Count,
! UserID => $Param{InmailUserID},
! );
! if ( $Self->{Debug} > 0 ) {
! print "TicketTime$Count: " . $GetParam{ $Key } . "\n";
! }
}
}
***************
*** 285,303 ****
# set free article text
@Values = ( 'X-OTRS-FollowUp-ArticleKey', 'X-OTRS-FollowUp-ArticleValue' );
! $CounterTmp = 0;
! while ( $CounterTmp <= 3 ) {
! $CounterTmp++;
! if ( $GetParam{"$Values[0]$CounterTmp"} ) {
$Self->{TicketObject}->ArticleFreeTextSet(
TicketID => $Param{TicketID},
ArticleID => $ArticleID,
! Key => $GetParam{"$Values[0]$CounterTmp"},
! Value => $GetParam{"$Values[1]$CounterTmp"},
! Counter => $CounterTmp,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "ArticleKey$CounterTmp: " . $GetParam{"$Values[0]$CounterTmp"} . "\n";
! print "ArticleValue$CounterTmp: " . $GetParam{"$Values[1]$CounterTmp"} . "\n";
}
--- 312,328 ----
# set free article text
@Values = ( 'X-OTRS-FollowUp-ArticleKey', 'X-OTRS-FollowUp-ArticleValue' );
! for my $Count ( 1..3 ) {
! if ( $GetParam{ $Values[0] . $Count } ) {
$Self->{TicketObject}->ArticleFreeTextSet(
TicketID => $Param{TicketID},
ArticleID => $ArticleID,
! Key => $GetParam{ $Values[0] . $Count },
! Value => $GetParam{ $Values[1] . $Count },
! Counter => $Count,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "ArticleKey$Count: " . $GetParam{ $Values[0] . $Count } . "\n";
! print "ArticleValue$Count: " . $GetParam{ $Values[1] . $Count } . "\n";
}
Author: martin
Index: NewTicket.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/PostMaster/NewTicket.pm,v
retrieving revision 1.66
retrieving revision 1.67
diff -C2 -d -r1.66 -r1.67
*** NewTicket.pm 24 Apr 2008 21:48:51 -0000 1.66
--- NewTicket.pm 29 Apr 2008 18:39:34 -0000 1.67
***************
*** 31,35 ****
# get all objects
! for (qw(DBObject ConfigObject TicketObject LogObject ParseObject QueueObject)) {
$Self->{$_} = $Param{$_} || die 'Got no $_';
}
--- 31,35 ----
# get all objects
! for (qw(DBObject ConfigObject TicketObject LogObject ParseObject TimeObject QueueObject)) {
$Self->{$_} = $Param{$_} || die 'Got no $_';
}
***************
*** 176,210 ****
# set pending time
if ( $GetParam{'X-OTRS-State-PendingTime'} ) {
! if ($Self->{TicketObject}->TicketPendingTimeSet(
! String => $GetParam{'X-OTRS-State-PendingTime'},
! TicketID => $TicketID,
! UserID => $Param{InmailUserID},
! )
! )
! {
! # debug
! if ( $Self->{Debug} > 0 ) {
! print "State-PendingTime: $GetParam{'X-OTRS-State-PendingTime'}\n";
! }
}
}
! # set free ticket text
my @Values = ( 'X-OTRS-TicketKey', 'X-OTRS-TicketValue' );
! my $CounterTmp = 0;
! while ( $CounterTmp <= 16 ) {
! $CounterTmp++;
! if ( $GetParam{"$Values[0]$CounterTmp"} ) {
$Self->{TicketObject}->TicketFreeTextSet(
TicketID => $TicketID,
! Key => $GetParam{"$Values[0]$CounterTmp"},
! Value => $GetParam{"$Values[1]$CounterTmp"},
! Counter => $CounterTmp,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "TicketKey$CounterTmp: " . $GetParam{"$Values[0]$CounterTmp"} . "\n";
! print "TicketValue$CounterTmp: " . $GetParam{"$Values[1]$CounterTmp"} . "\n";
}
}
--- 176,234 ----
# set pending time
if ( $GetParam{'X-OTRS-State-PendingTime'} ) {
! my $Set = $Self->{TicketObject}->TicketPendingTimeSet(
! String => $GetParam{'X-OTRS-State-PendingTime'},
! TicketID => $TicketID,
! UserID => $Param{InmailUserID},
! );
! # debug
! if ( $Set && $Self->{Debug} > 0 ) {
! print "State-PendingTime: $GetParam{'X-OTRS-State-PendingTime'}\n";
}
}
! # set ticket free text
my @Values = ( 'X-OTRS-TicketKey', 'X-OTRS-TicketValue' );
! for my $Count ( 1..16 ) {
! if ( $GetParam{ $Values[0] . $Count } ) {
$Self->{TicketObject}->TicketFreeTextSet(
TicketID => $TicketID,
! Key => $GetParam{ $Values[0] . $Count },
! Value => $GetParam{ $Values[1] . $Count },
! Counter => $Count,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "TicketKey$Count: " . $GetParam{ $Values[0] . $Count } . "\n";
! print "TicketValue$Count: " . $GetParam{ $Values[1] . $Count } . "\n";
! }
! }
! }
!
! # set ticket free time
! for my $Count ( 1..6 ) {
! my $Key = 'X-OTRS-TicketTime' . $Count;
! if ( $GetParam{ $Key } ) {
! my $SystemTime = $Self->{TimeObject}->TimeStamp2SystemTime(
! String => $GetParam{ $Key },
! );
! my ($Sec, $Min, $Hour, $Day, $Month, $Year) = $Self->{TimeObject}->SystemTime2Date(
! SystemTime => $SystemTime,
! );
! if ( $Year && $Month && $Day && $Hour && $Min ) {
! $Self->{TicketObject}->TicketFreeTimeSet(
! 'TicketFreeTime' . $Count . 'Year' => $Year,
! 'TicketFreeTime' . $Count . 'Month' => $Month,
! 'TicketFreeTime' . $Count . 'Day' => $Day,
! 'TicketFreeTime' . $Count . 'Hour' => $Hour,
! 'TicketFreeTime' . $Count . 'Minute' => $Min,
! Prefix => 'TicketFreeTime',
! TicketID => $TicketID,
! Counter => $Count,
! UserID => $Param{InmailUserID},
! );
! if ( $Self->{Debug} > 0 ) {
! print "TicketTime$Count: " . $GetParam{ $Key } . "\n";
! }
}
}
***************
*** 261,279 ****
# set free article text
@Values = ( 'X-OTRS-ArticleKey', 'X-OTRS-ArticleValue' );
! $CounterTmp = 0;
! while ( $CounterTmp <= 3 ) {
! $CounterTmp++;
! if ( $GetParam{"$Values[0]$CounterTmp"} ) {
$Self->{TicketObject}->ArticleFreeTextSet(
TicketID => $TicketID,
ArticleID => $ArticleID,
! Key => $GetParam{"$Values[0]$CounterTmp"},
! Value => $GetParam{"$Values[1]$CounterTmp"},
! Counter => $CounterTmp,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "ArticleKey$CounterTmp: " . $GetParam{"$Values[0]$CounterTmp"} . "\n";
! print "ArticleValue$CounterTmp: " . $GetParam{"$Values[1]$CounterTmp"} . "\n";
}
}
--- 285,301 ----
# set free article text
@Values = ( 'X-OTRS-ArticleKey', 'X-OTRS-ArticleValue' );
! for my $Count ( 1..3 ) {
! if ( $GetParam{ $Values[0] . $Count } ) {
$Self->{TicketObject}->ArticleFreeTextSet(
TicketID => $TicketID,
ArticleID => $ArticleID,
! Key => $GetParam{ $Values[0] . $Count },
! Value => $GetParam{ $Values[1] . $Count },
! Counter => $Count,
UserID => $Param{InmailUserID},
);
if ( $Self->{Debug} > 0 ) {
! print "ArticleKey$Count: " . $GetParam{ $Values[0] . $Count } . "\n";
! print "ArticleValue$Count: " . $GetParam{ $Values[1] . $Count } . "\n";
}
}
More information about the cvs-log
mailing list