[Rt-commit] r7017 - in rt/branches/3.7-EXPERIMENTAL: .
html/Elements/RT__Ticket html/Ticket/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Thu Feb 15 09:46:56 EST 2007
Author: ruz
Date: Thu Feb 15 09:46:56 2007
New Revision: 7017
Added:
rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowUpdateStatus
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap
rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html
Log:
r4580 at cubic-pc: cubic | 2007-02-15 04:09:32 +0300
* UpdateStatus
Modified: rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap (original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Elements/RT__Ticket/ColumnMap Thu Feb 15 09:46:56 2007
@@ -294,6 +294,15 @@
attribute => 'Resolved',
value => sub { return $_[0]->ResolvedObj->AsString }
},
+ UpdateStatus => {
+ title => loc('New messages'),
+ value => sub {
+ my $txn = $_[0]->SeenUpTo or return $_[0]->loc('No');
+ return \('<a href="'. RT->Config->Get('WebPath') .'/Ticket/Display.html?id='
+ . $_[0]->id .'#txn-'. $txn->id .'">'),
+ $_[0]->loc('New'), \'</a>';
+ },
+ },
# Everything from LINKTYPEMAP
(map {
Modified: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html (original)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Display.html Thu Feb 15 09:46:56 2007
@@ -51,6 +51,8 @@
Title => loc("#[_1]: [_2]", $TicketObj->Id, $TicketObj->Subject) &>
<& /Elements/ListActions, actions => \@Actions &>
+<& Elements/ShowUpdateStatus, Ticket => $TicketObj &>
+
% $m->callback( %ARGS, Ticket => $TicketObj, CallbackName => 'BeforeShowSummary' );
<&| /Widgets/TitleBox, title => loc('Ticket metadata') &>
<& /Ticket/Elements/ShowSummary, Ticket => $TicketObj, Attachments => $attachments &>
@@ -131,6 +133,13 @@
unless ($TicketObj->CurrentUserHasRight('ShowTicket')) {
Abort("No permission to view ticket");
}
+ if ( $ARGS{'MarkAsSeen'} ) {
+ $TicketObj->SetAttribute(
+ Name => 'User-'. $TicketObj->CurrentUser->id .'-SeenUpTo',
+ Content => $TicketObj->LastUpdated,
+ );
+ push @Actions, loc('Marked all messages as seen');
+ }
}
$m->callback(
@@ -144,8 +153,6 @@
# This code does automatic redirection if any updates happen.
# It doesn't work for the client.
-
-
if (@Actions) {
# We've done something, so we need to clear the decks to avoid
# resubmission on refresh.
Added: rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowUpdateStatus
==============================================================================
--- (empty file)
+++ rt/branches/3.7-EXPERIMENTAL/html/Ticket/Elements/ShowUpdateStatus Thu Feb 15 09:46:56 2007
@@ -0,0 +1,10 @@
+<&| /Widgets/TitleBox, title => loc('New messages'), title_href => "#txn-". $txn->id &>
+There is new messages you havn't seen, click on title box to jump to the oldest message.
+You can also <a href="<% RT->Config->Get('WebPath') %>/Ticket/Display.html?id=<% $Ticket->id %>&MarkAsSeen=1">mark</a> the current available messages as seen.
+</&>
+<%ARGS>
+$Ticket
+</%ARGS>
+<%INIT>
+my $txn = $Ticket->SeenUpTo or return;
+</%INIT>
More information about the Rt-commit
mailing list