[Rt-commit] [rtir] 01/01: Support the Unread Messages feature in RTIR
Jim Brandt
jbrandt at bestpractical.com
Thu Jun 12 10:48:22 EDT 2014
This is an automated email from the git hooks/post-receive script.
jbrandt pushed a commit to branch 3.0/display-mark-as-seen
in repository rtir.
commit c8277b52d466fe1b0cf036cf27be8c2c50316bdb
Author: Jim Brandt <jbrandt at bestpractical.com>
Date: Thu Jun 12 10:40:44 2014 -0400
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 726463f367.
Resolves issues 17450 and 30080
---
html/RTIR/Display.html | 10 ++++++++++
html/RTIR/Incident/Display.html | 10 ++++++++++
2 files changed, 20 insertions(+)
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 5cb2608..e6fbedd 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -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' ) {
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index ca8bbbc..3c20afb 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -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
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list