import of rt 3.0.4
[freeside.git] / rt / html / Ticket / Elements / ShowHistory
1 %# BEGIN LICENSE BLOCK
2 %# 
3 %# Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com>
4 %# 
5 %# (Except where explictly superceded by other copyright notices)
6 %# 
7 %# This work is made available to you under the terms of Version 2 of
8 %# the GNU General Public License. A copy of that license should have
9 %# been provided with this software, but in any event can be snarfed
10 %# from www.gnu.org.
11 %# 
12 %# This work is distributed in the hope that it will be useful, but
13 %# WITHOUT ANY WARRANTY; without even the implied warranty of
14 %# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 %# General Public License for more details.
16 %# 
17 %# Unless otherwise specified, all modifications, corrections or
18 %# extensions to this work which alter its source code become the
19 %# property of Best Practical Solutions, LLC when submitted for
20 %# inclusion in the work.
21 %# 
22 %# 
23 %# END LICENSE BLOCK
24 <%perl>
25  if ($ShowDisplayModes or $ShowTitle) {
26 my $title;
27 my $titleright;
28 if ($ShowTitle) {
29     $title = loc('History');
30 }
31 else {
32     $title = '&nbsp;';
33 }
34 $titleright = loc('Display mode') . ":";
35 if ($ShowHeaders &&  $ShowHeaders == $Ticket->Id ) {
36     $titleright .= "[<A HREF=\"" . $URIFile . "?id="
37       . $Ticket->id . "\">"
38       . loc("Brief headers")
39       . "</a>] <b>["
40       . loc("Full headers") . "]</b>";
41 }
42 else {
43     $titleright .= "<b>["
44       . loc("Brief headers")
45       . "]</b> [<A HREF=\""
46       . $URIFile
47       . "?ShowHeaders="
48       . $Ticket->Id . "&id="
49       . $Ticket->id . "\">"
50       . loc("Full headers") . "</a>]";
51 }
52 </%perl>
53 <& /Elements/TitleBoxStart, title => $title, titleright => $titleright, bodyclass=> ''&>
54 % }
55
56 <TABLE WIDTH=100% CELLSPACING=0 CELLPADDING=2 BORDER=0>
57 % while (my $Transaction = $Transactions->Next) {
58 % my $skip = 0;
59 % $m->comp('/Elements/Callback', _CallbackName => 'SkipTransaction', Transaction => $Transaction, skip => \$skip, %ARGS);
60 % next if $skip;
61 % $i++;
62 %       if ($Transactions->IsLast) {
63         <a name="lasttrans"></a>
64 %       }
65             <& ShowTransaction, Ticket => $Ticket, Transaction => $Transaction, ShowHeaders => $ShowHeaders, Collapsed => $Collapsed, RowNum => $i, ShowTitleBarCommands => $ShowTitleBarCommands  &>
66 % }
67 </TABLE>
68 % if ($ShowDisplayModes or $ShowTitle) {
69 <& /Elements/TitleBoxEnd &>
70 % }
71 <%INIT>
72
73 my $Transactions = $Ticket->Transactions;
74 my $i;
75
76
77 </%INIT>
78 <%ARGS>
79 $URIFile => 'Display.html'
80 $Ticket => undef
81 $ShowHeaders => undef
82 $Collapsed => undef
83 $ShowTitle => 1
84 $ShowDisplayModes => 1
85 $ShowTitleBarCommands => 1
86 </%ARGS>