-%# {{{ BEGIN BPS TAGGED BLOCK
+%# BEGIN BPS TAGGED BLOCK {{{
%#
%# COPYRIGHT:
%#
-%# This software is Copyright (c) 1996-2004 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2007 Best Practical Solutions, LLC
%# <jesse@bestpractical.com>
%#
%# (Except where explicitly superseded by other copyright notices)
%#
%# You should have received a copy of the GNU General Public License
%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+%# 02110-1301 or visit their web page on the internet at
+%# http://www.gnu.org/copyleft/gpl.html.
%#
%#
%# CONTRIBUTION SUBMISSION POLICY:
%# works based on those contributions, and sublicense and distribute
%# those contributions and any derivatives thereof.
%#
-%# }}} END BPS TAGGED BLOCK
+%# END BPS TAGGED BLOCK }}}
+<%doc>
+# This is (ab)used in Admin/(Users|Groups)/History.html and should probably
+# be generalized at some point.
+</%doc>
<%perl>
- if ($ShowDisplayModes or $ShowTitle) {
-my $title;
-my $titleright;
-if ($ShowTitle) {
- $title = loc('History');
-}
-else {
- $title = ' ';
-}
-$titleright = loc('Display mode') . ":";
-if ($ShowHeaders) {
- $titleright .= "[<A HREF=\"" . $URIFile . "?id="
- . $Ticket->id . "\">"
- . loc("Brief headers")
- . "</a>] <b>["
- . loc("Full headers") . "]</b>";
-}
-else {
- $titleright .= "<b>["
- . loc("Brief headers")
- . "]</b> [<A HREF=\""
- . $URIFile
- . "?ShowHeaders=1"
- . "&id="
- . $Ticket->id . "\">"
- . loc("Full headers") . "</a>]";
-}
+if ($ShowDisplayModes or $ShowTitle) {
+ my $title = $ShowTitle
+ ? loc('History')
+ : ' ';
+
+ my $titleright;
+
+ if ($ShowDisplayModes) {
+ $titleright = q[<span style="color: black">] . loc('Display mode') . ':</span> ';
+
+ if ($ShowHeaders) {
+ $titleright .= qq{<a href="$URIFile?id=} .
+ $Ticket->id.qq{">} .
+ loc("Brief headers") .
+ qq{</a> — };
+ $titleright .= q[<span class="selected">] . loc("Full headers") . "</span>";
+ }
+ else {
+ $titleright .= q[<span class="selected">] . loc("Brief headers") . "</span> — ";
+ $titleright .= qq{<a href="$URIFile?ShowHeaders=1;id=} .
+ $Ticket->id.qq{">} .
+ loc("Full headers") .
+ qq{</a>};
+ }
+ }
</%perl>
-<& /Elements/TitleBoxStart, title => $title, titleright => $titleright, bodyclass=> ''&>
+<& /Widgets/TitleBoxStart, title => $title, titleright => $titleright &>
% }
-<TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>
+<div id="ticket-history">
<%perl>
my @attachments = @{$Attachments->ItemsArrayRef()};
my @attachment_content = @{$AttachmentContent->ItemsArrayRef()};
-
-
-
-
while ( my $Transaction = $Transactions->Next ) {
my $skip = 0;
$m->comp( '/Elements/Callback',
$m->comp( 'ShowTransaction',
%ARGS,
- AttachPath => $AttachPath,
- UpdatePath => $UpdatePath,
+ AttachPath => $AttachPath,
+ UpdatePath => $UpdatePath,
Ticket => $Ticket,
Transaction => $Transaction,
ShowHeaders => $ShowHeaders,
AttachmentContent => $trans_content,
LastTransaction => $Transactions->IsLast
);
+
+# manually flush the content buffer after each txn, so the user sees
+# some update
+$m->flush_buffer();
}
</%perl>
-</TABLE>
+</div>
% if ($ShowDisplayModes or $ShowTitle) {
-<& /Elements/TitleBoxEnd &>
+<& /Widgets/TitleBoxEnd &>
% }
<%INIT>
my $Transactions = new RT::Transactions($session{'CurrentUser'});
if ($Tickets) {
while (my $t = $Tickets->Next) {
- $Transactions->Limit(FIELD => 'Ticket',
- OPERATOR => '=',
- VALUE => $t->Id);
+ $Transactions->LimitToTicket($t->id);
}
} else {
$Transactions = $Ticket->Transactions;
}
-my $i;
+
+my $OldestFirst = $RT::OldestTransactionsFirst? 'ASC': 'DESC';
+$Transactions->OrderByCols( { FIELD => 'Created',
+ ORDER => $OldestFirst },
+ { FIELD => 'id',
+ ORDER => $OldestFirst },
+ );
+
+my $i;
$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket, Tickets => $Tickets || undef);
$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket);
$ShowTitleBarCommands => 1
$AttachPath => $RT::WebPath."/Ticket/Attachment"
$UpdatePath => $RT::WebPath."/Ticket/Update.html"
-
</%ARGS>