Hi,
This patch lifts the "New Message!" message logic from AgentMailbox
and adds it to AgentQueueView. I'd like it considered for inclusion
into the OTRS codebase.
Feedback is, as always, appreciated.
Thankyou,
Adrian
--
Adrian Chadd The University of Western Australia
<[EMAIL PROTECTED]> CRICOS: 00126G
Ph: +61 8 6488 2574
Mob: +61 421 597 819
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 @@
<tr>
<td align="left" width="50%" class="table0">
<b>$Env{"Box0"}$Config{"TicketHook"}: $Data{"TicketNumber"}$Env{"Box1"}</b>
- $Data{"Message"}
+ <font color="red">$Data{"Message"}</font>
</td>
<td align="right" width="50%" class="table0">
<b>$Env{"Box0"}$Text{"Age"}: $Data{"Age"}$Env{"Box1"}</b>
diff -u -r /home/otrs/otrs/Kernel/Output/HTML/Standard/TicketViewLite.dtl
./Kernel/Output/HTML/Standard/TicketViewLite.dtl
--- /home/otrs/otrs/Kernel/Output/HTML/Standard/TicketViewLite.dtl 2004-05-20
10:44:17.000000000 +0800
+++ ./Kernel/Output/HTML/Standard/TicketViewLite.dtl 2004-06-01 12:13:12.000000000
+0800
@@ -13,7 +13,7 @@
<table border="0" width="100%" cellspacing="0" cellpadding="3" cols="2">
<tr>
<td align="left" width="50%" class="table0">
- <b>$Env{"Box0"}$Config{"TicketHook"}: $Data{"TicketNumber"}$Env{"Box1"}</b>
+ <b>$Env{"Box0"}$Config{"TicketHook"}: $Data{"TicketNumber"}$Env{"Box1"}</b> <font
color="red">$Text{"$Data{"Message"}"}
</td>
<td align="right" width="50%" class="table0">
<b>$Env{"Box0"}$Text{"Age"}: $Data{"Age"}$Env{"Box1"}</b>
Only in ./var: INBOX.Backup.2004-05
Only in ./var/log: TicketCounter.log
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev