import rt 3.8.11
[freeside.git] / rt / html / Ticket / Elements / ShowTransaction
index f0b8326..9fe08ce 100644 (file)
@@ -1,8 +1,8 @@
-%# {{{ 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-2009 Best Practical Solutions, LLC 
 %#                                          <jesse@bestpractical.com>
 %# 
 %# (Except where explicitly superseded by other copyright notices)
@@ -22,7 +22,9 @@
 %# 
 %# 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/licenses/old-licenses/gpl-2.0.html.
 %# 
 %# 
 %# CONTRIBUTION SUBMISSION POLICY:
 %# works based on those contributions, and sublicense and distribute
 %# those contributions and any derivatives thereof.
 %# 
-%# }}} END BPS TAGGED BLOCK
-<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>" >
-<TD rowspan="2" valign="top" bgcolor="<%$bgcolor%>"><A NAME="txn-<%$Transaction->Id%>" href="#txn-<%$Transaction->Id%>">#</A><% $LastTransaction ? '<a name="lasttrans">&nbsp;</a>' : '&nbsp;' |n %></TD>
-<TD>&nbsp&nbsp;</TD>
-<TD><font size=-2><% $transdate|n %></font>&nbsp;</TD>
+%# END BPS TAGGED BLOCK }}}
+<div class="ticket-transaction<% $type_class && " $type_class" %><% $RowNum % 2 ? ' odd' : ' even' %>">
+% $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', titlebar_cmd => \$titlebar_commands, Transaction => $Transaction, %ARGS);
+
+<table width="100%" cellspacing="0" cellpadding="2" border="0">
+  <tr>
+    <td rowspan="2" valign="top" class="type">
+      <a name="txn-<%$Transaction->Id%>" href="<% $DisplayPath %>#txn-<%$Transaction->Id%>">#</a>
+      <% $LastTransaction ? '<a name="lasttrans">&nbsp;</a>' : '&nbsp;' |n %>
+    </td>
+    <td class="date"><% $transdate|n %></td>
 % my $desc = $Transaction->BriefDescription;
 % $m->comp('/Elements/Callback', _CallbackName => 'ModifyDisplay', text => \$desc, Transaction => $Transaction, %ARGS);
-<TD ALIGN="LEFT"><b><%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%>
-
-</b></TD>
-<TD><%$TimeTaken%>&nbsp;</TD>
-<TD ALIGN="RIGHT"><font size=-1><%$titlebar_commands|n%></font></TD>
-</TR>
-<TR class="<% $RowNum%2 ? 'oddline' : 'evenline'%>"><TD colspan=5>
+    <td class="description">
+      <%$Transaction->CreatorObj->Name%> - <%$TicketString%> <%$desc%>
+    </td>
+    <td class="time-taken"><%$TimeTaken%></td>
+    <td class="actions"><%$titlebar_commands|n%></td>
+  </tr>
+
+  <tr>
+    <td colspan="4" class="content">
+% if ($Transaction->CustomFieldValues->Count) {
+      <& /Elements/ShowCustomFields, Object => $Transaction &>
+% }
 % $m->comp('ShowTransactionAttachments', %ARGS, Parent => 0) unless ($Collapsed ||!$ShowBody);
-</TD>
-</TR>
+    </td>
+  </tr>
+
+</table>
+</div>
 
 <%ARGS>
 $Ticket => undef
@@ -67,6 +83,7 @@ $ShowHeaders => 0
 $Collapsed => undef
 $ShowTitleBarCommands => 1
 $RowNum => 1
+$DisplayPath => $RT::WebPath."/Ticket/Display.html?id=".$Ticket->id
 $AttachPath => $RT::WebPath."/Ticket/Attachment"
 $UpdatePath => $RT::WebPath."/Ticket/Update.html"
 $EmailRecordPath => $RT::WebPath."/Ticket/ShowEmailRecord.html"
@@ -78,42 +95,43 @@ $LastTransaction => 0
 
 <%INIT>
 
-my ( $TimeTaken, $TicketString, $bgcolor );
+my ( $TimeTaken, $TicketString, $type_class );
 
 my $transdate = $Transaction->CreatedAsString();
 $transdate =~ s/\s/&nbsp;/g;
 
 if ( $Transaction->Type =~ /^(Create|Correspond|Comment$)/ ) {
     if ( $Transaction->IsInbound ) {
-        $bgcolor = "#336699";
+        $type_class = 'message';
     }
     else {
-        $bgcolor = "#339999";
+        $type_class = 'message';
     }
 }
 elsif (    ( $Transaction->Field =~ /^Owner$/ )
         or ( $Transaction->Type =~ /^(AddWatcher|DelWatcher)$/ ) ) {
-    $bgcolor = "#333399";
+    $type_class = 'people';
 
 }
 elsif ( $Transaction->Type =~ /^(AddLink|DeleteLink)$/ ) {
-    $bgcolor = "#336633";
+    $type_class = 'links';
 }
 elsif ( $Transaction->Type =~ /^(Status|Set|Told)$/ ) {
     if ( $Transaction->Field =~ /^(Told|Starts|Started|Due)$/ ) {
-        $bgcolor = "#663366";
+        $type_class = 'dates';
     }
     else {
-        $bgcolor = "#993333";
+        $type_class = 'basics';
     }
 }
 else {
-    $bgcolor = "#cccccc";
+    $type_class = 'other';
 }
 
 if ( $Ticket->Id != $Transaction->Ticket ) {
     $TicketString = "Ticket " . $Transaction->Ticket . ": ";
 }
+$TicketString ||= '';
 
 if ( $Transaction->TimeTaken != 0 ) {
     $TimeTaken = $Transaction->TimeTaken . " min";
@@ -139,9 +157,7 @@ if ( $Transaction->Type =~ /EmailRecord$/ ) {
       . "&Transaction="
       . $Transaction->Id
       . "&Attachment="
-      . (    $Transaction->Attachments->First
-          && $Transaction->Attachments->First->Id )
-
+      . ( $Attachments->[0] && $Attachments->[0]->id )
       . '">' . loc('Show') . "</a>]&nbsp;";
     $ShowBody = 0;
 }