Commit c8277b52 authored by Jim Brandt's avatar Jim Brandt
Browse files

Support the Unread Messages feature in RTIR

Add support for displaying a message on ticket display when
there are unread messages on a ticket. This is a standard
feature in core RT.

Adding this feature gives users a way to clear the New messages
setting shown on the incidents listing on the RTIR homepage
which was added in 726463f3.

Resolves issues 17450 and 30080
parent 3131f5a8
......@@ -51,6 +51,7 @@
% $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS, Ticket => $Ticket);
<& /Elements/ListActions, actions => \@results &>
<& /Ticket/Elements/ShowUpdateStatus, Ticket => $Ticket &>
<div class="summary"><&| /Widgets/TitleBox, title => loc('Ticket metadata') &>
......@@ -219,6 +220,14 @@ unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) {
Abort("No permission to view ticket");
}
if ( $ARGS{'MarkAsSeen'} ) {
$Ticket->SetAttribute(
Name => 'User-'. $Ticket->CurrentUser->id .'-SeenUpTo',
Content => $Ticket->LastUpdated,
);
push @results, loc('Marked all messages as seen');
}
# update id argument in the case we took merged or created new
$ARGS{'id'} = $id = $Ticket->Id;
......@@ -226,6 +235,7 @@ MaybeRedirectForResults(
Path => '/RTIR/Display.html',
Actions => \@results,
Arguments => { id => $id },
Anchor => $ARGS{'Anchor'},
);
if ( $Type eq 'Report' ) {
......
......@@ -50,6 +50,7 @@
% $m->callback(CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS, Ticket => $TicketObj);
<& /Elements/ListActions, actions => \@results &>
<& /Ticket/Elements/ShowUpdateStatus, Ticket => $TicketObj &>
<div class="summary"><&| /Widgets/TitleBox, title => loc('Ticket metadata') &>
<table class="ticket-summary" width="100%"><tr><td class="boxcontainer" valign="top">
......@@ -268,10 +269,19 @@ unless( $new_ticket ) {
push @results, ProcessUpdateMessage( ARGSRef => \%ARGS, TicketObj => $TicketObj );
}
if ( $ARGS{'MarkAsSeen'} ) {
$TicketObj->SetAttribute(
Name => 'User-'. $TicketObj->CurrentUser->id .'-SeenUpTo',
Content => $TicketObj->LastUpdated,
);
push @results, loc('Marked all messages as seen');
}
MaybeRedirectForResults(
Actions => \@results,
Path => "/RTIR/Display.html",
Arguments => { id => $TicketObj->id },
Anchor => $ARGS{'Anchor'},
);
# XXX: need the way to show @results when aborting
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment