diff -u -r /home/otrs/otrs/Kernel/Modules/AgentQueueView.pm ./Kernel/Modules/AgentQueueView.pm --- /home/otrs/otrs/Kernel/Modules/AgentQueueView.pm 2004-01-28 10:04:41.000000000 +0800 +++ ./Kernel/Modules/AgentQueueView.pm 2004-06-01 12:14:38.000000000 +0800 @@ -206,6 +206,30 @@ my %Param = @_; my $TicketID = $Param{TicketID} || return; my $Output = ''; + my $Message = ""; + my $LastSenderType; + my $LastSenderID; + my $SQL; + + # Grab the last sender type/id for the given ticket + # Stolen from AgentMailbox.pm + my $SQL = "SELECT sdt.name, sa.create_by, st.until_time " . + " FROM " . + " article_sender_type sdt, article sa, ticket st " . + " WHERE " . + " st.id = $TicketID " . + " AND " . + " sa.ticket_id = st.id " . + " AND " . + " sdt.id = sa.article_sender_type_id" . + " ORDER BY " . + " sa.create_time"; + $Self->{DBObject}->Prepare(SQL => $SQL); + while (my @RowTmp = $Self->{DBObject}->FetchrowArray()) { + $LastSenderType = $RowTmp[0]; + $LastSenderID = $RowTmp[1]; + } + $Param{QueueViewQueueID} = $Self->{QueueID}; my %MoveQueues = $Self->{QueueObject}->GetAllQueues( UserID => $Self->{UserID}, @@ -327,6 +351,26 @@ Data => {%Param, %Article}, ); } + # + # Whether its a 'new' message + # [AHC] this was just for experimentation. +# if ($Article{"State"} eq "new") { +# $Message = $Message . " New ticket! "; +# } + + # + # Check whether the last message we've seen from the + # ticket was external correspondance + # + if ($LastSenderID ne $Self->{UserID} || $LastSenderType eq 'customer') { + $Message = $Message . " New Message! "; + } + + # + # Store message + # + $Article{"Message"} = $Message; + # create & return output if (!$Self->{UserQueueView} || $Self->{UserQueueView} ne 'TicketViewLite') { return $Self->{LayoutObject}->Output( diff -u -r /home/otrs/otrs/Kernel/Output/HTML/Standard/TicketView.dtl ./Kernel/Output/HTML/Standard/TicketView.dtl --- /home/otrs/otrs/Kernel/Output/HTML/Standard/TicketView.dtl 2004-05-20 10:53:40.000000000 +0800 +++ ./Kernel/Output/HTML/Standard/TicketView.dtl 2004-06-01 12:13:56.000000000 +0800 @@ -14,7 +14,7 @@
- $Env{"Box0"}$Config{"TicketHook"}: $Data{"TicketNumber"}$Env{"Box1"} + $Env{"Box0"}$Config{"TicketHook"}: $Data{"TicketNumber"}$Env{"Box1"} $Text{"$Data{"Message"}"} | $Env{"Box0"}$Text{"Age"}: $Data{"Age"}$Env{"Box1"} Only in ./var: INBOX.Backup.2004-05 Only in ./var/log: TicketCounter.log |