[rt-commit] [svn] r620 - in rt/branches/rt-3.1/html: Scope/Elements
Ticket Ticket/Elements
leira at fsck.com
leira at fsck.com
Thu Mar 25 10:20:14 EST 2004
Author: leira
Date: Thu Mar 25 10:20:13 2004
New Revision: 620
Modified:
rt/branches/rt-3.1/html/Scope/Elements/ShowHistory
rt/branches/rt-3.1/html/Scope/Elements/ShowTransaction
rt/branches/rt-3.1/html/Ticket/Display.html
rt/branches/rt-3.1/html/Ticket/Elements/FindAttachments
rt/branches/rt-3.1/html/Ticket/Elements/ShowHistory
rt/branches/rt-3.1/html/Ticket/Elements/ShowTransaction
Log:
ShowHeaders is now boolean.
Allow Transactions, Attachments, etc. to take an optional collection of tickets.
Modified: rt/branches/rt-3.1/html/Scope/Elements/ShowHistory
==============================================================================
--- rt/branches/rt-3.1/html/Scope/Elements/ShowHistory (original)
+++ rt/branches/rt-3.1/html/Scope/Elements/ShowHistory Thu Mar 25 10:20:13 2004
@@ -32,7 +32,7 @@
$title = ' ';
}
$titleright = loc('Display mode') . ":";
-if ($ShowHeaders && $ShowHeaders == $Ticket->Id ) {
+if ($ShowHeaders) {
$titleright .= "[<A HREF=\"" . $URIFile . "?id="
. $Ticket->id . "\">"
. loc("Brief headers")
@@ -44,8 +44,8 @@
. loc("Brief headers")
. "]</b> [<A HREF=\""
. $URIFile
- . "?ShowHeaders="
- . $Ticket->Id . "&id="
+ . "?ShowHeaders=1"
+ . "&id="
. $Ticket->id . "\">"
. loc("Full headers") . "</a>]";
}
@@ -80,7 +80,7 @@
<%ARGS>
$URIFile => 'Display.html'
$Ticket => undef
-$ShowHeaders => undef
+$ShowHeaders => 0
$Collapsed => undef
$ShowTitle => 1
$ShowDisplayModes => 1
Modified: rt/branches/rt-3.1/html/Scope/Elements/ShowTransaction
==============================================================================
--- rt/branches/rt-3.1/html/Scope/Elements/ShowTransaction (original)
+++ rt/branches/rt-3.1/html/Scope/Elements/ShowTransaction Thu Mar 25 10:20:13 2004
@@ -42,7 +42,7 @@
next unless ($message->ContentLength || $message->Children->Count);
my ($headers, $quoted);
- if ($ShowHeaders && ($ShowHeaders == $Ticket->Id)) {
+ if ($ShowHeaders) {
$headers = $message->Headers;
} else {
$headers = $message->NiceHeaders;
Modified: rt/branches/rt-3.1/html/Ticket/Display.html
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Display.html (original)
+++ rt/branches/rt-3.1/html/Ticket/Display.html Thu Mar 25 10:20:13 2004
@@ -38,6 +38,7 @@
<BR>
<& /Ticket/Elements/ShowHistory ,
Ticket => $TicketObj,
+ Tickets => $Tickets,
Collapsed => $ARGS{'Collapsed'},
ShowHeaders => $ARGS{'ShowHeaders'},
Attachments => $attachments,
@@ -49,13 +50,13 @@
<%ARGS>
$id => undef
$Create => undef
-$ShowHeaders => undef
+$ShowHeaders => 0
$Collapsed => undef
$TicketObj => undef
</%ARGS>
<%INIT>
- my ($linkid, $message, $tid, @Actions);
+my ($linkid, $message, $tid, @Actions, $Tickets);
unless ($id || $TicketObj) {
Abort('No ticket specified');
@@ -113,17 +114,16 @@
}
#Process status updates
my @BasicActions = ProcessTicketBasics(ARGSRef => \%ARGS, TicketObj=>$TicketObj);
- my @results = ProcessTicketLinks( TicketObj => $TicketObj, ARGSRef => \%ARGS);
+ my @results = ProcessTicketLinks( TicketObj => $TicketObj, ARGSRef => \%ARGS);
push (@Actions, @BasicActions, @results);
}
-my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj);
-my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => $TicketObj);
-
-
-</%INIT>
-
+$m->comp('/Elements/Callback', _CallbackName => 'BeforeDisplay',
+ TicketObj => \$TicketObj, Tickets => \$Tickets, ARGSRef => \%ARGS);
+my $attachments = $m->comp('Elements/FindAttachments', Ticket => $TicketObj, Tickets => $Tickets);
+my $attachment_content = $m->comp('Elements/LoadTextAttachments', Ticket => $TicketObj);
+</%INIT>
Modified: rt/branches/rt-3.1/html/Ticket/Elements/FindAttachments
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/FindAttachments (original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/FindAttachments Thu Mar 25 10:20:13 2004
@@ -6,45 +6,40 @@
# We force the cache of ticket transactions to get populated up front. otherwise, the
# code that looks at attachments will look at each one in turn.
-my $transactions = $Ticket->Transactions->First;
-
-
my $attachments = RT::Attachments->new( $session{'CurrentUser'} );
$attachments->Columns( qw( Id Filename ContentType Headers Subject Parent ContentEncoding ContentType TransactionId Created));
-if ( $Ticket->CurrentUserHasRight('ShowTicket') ) {
- my $transactions = $attachments->NewAlias('Transactions');
- $attachments->Join( ALIAS1 => 'main',
- FIELD1 => 'TransactionId',
- ALIAS2 => $transactions,
- FIELD2 => 'id' );
+my $transactions = $attachments->NewAlias('Transactions');
+$attachments->Join( ALIAS1 => 'main',
+ FIELD1 => 'TransactionId',
+ ALIAS2 => $transactions,
+ FIELD2 => 'id' );
- my $tickets = $attachments->NewAlias('Tickets');
+my $tickets = $attachments->NewAlias('Tickets');
- $attachments->Join( ALIAS1 => $transactions,
- FIELD1 => 'Ticket',
- ALIAS2 => $tickets,
- FIELD2 => 'id' );
-
- $attachments->Limit( ALIAS => $tickets,
- FIELD => 'EffectiveId',
- VALUE => $Ticket->id() );
- # if the user may not see comments do not return them
- unless ( $Ticket->CurrentUserHasRight('ShowTicketComments') ) {
- $attachments->Limit( ALIAS => $transactions,
- FIELD => 'Type',
- OPERATOR => '!=',
- VALUE => "CommentEmailRecord" );
- $attachments->Limit( ALIAS => $transactions,
- FIELD => 'Type',
- OPERATOR => '!=',
- VALUE => "Comment" );
+$attachments->Join( ALIAS1 => $transactions,
+ FIELD1 => 'Ticket',
+ ALIAS2 => $tickets,
+ FIELD2 => 'id' );
+
+if ($Tickets) {
+ while ($Ticket = $Tickets->Next) {
+ $attachments->Limit( ALIAS => $tickets,
+ FIELD => 'EffectiveId',
+ VALUE => $Ticket->id() );
}
+} else {
+ $attachments->Limit( ALIAS => $tickets,
+ FIELD => 'EffectiveId',
+ VALUE => $Ticket->id() );
}
+
+
return ($attachments);
</%INIT>
<%ARGS>
$Ticket => undef
+$Tickets => undef
</%ARGS>
Modified: rt/branches/rt-3.1/html/Ticket/Elements/ShowHistory
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/ShowHistory (original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/ShowHistory Thu Mar 25 10:20:13 2004
@@ -32,7 +32,7 @@
$title = ' ';
}
$titleright = loc('Display mode') . ":";
-if ($ShowHeaders && $ShowHeaders == $Ticket->Id ) {
+if ($ShowHeaders) {
$titleright .= "[<A HREF=\"" . $URIFile . "?id="
. $Ticket->id . "\">"
. loc("Brief headers")
@@ -44,8 +44,8 @@
. loc("Brief headers")
. "]</b> [<A HREF=\""
. $URIFile
- . "?ShowHeaders="
- . $Ticket->Id . "&id="
+ . "?ShowHeaders=1"
+ . "&id="
. $Ticket->id . "\">"
. loc("Full headers") . "</a>]";
}
@@ -103,12 +103,19 @@
<& /Elements/TitleBoxEnd &>
% }
<%INIT>
-
-my $Transactions = $Ticket->Transactions;
+my $Transactions = new RT::Transactions($session{'CurrentUser'});
+if ($Tickets) {
+ while (my $t = $Tickets->Next) {
+ $Transactions->Limit(FIELD => 'Ticket',
+ OPERATOR => '=',
+ VALUE => $t->Id);
+ }
+} else {
+ $Transactions = $Ticket->Transactions;
+}
my $i;
-
-$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket);
+$Attachments ||= $m->comp('/Ticket/Elements/FindAttachments', Ticket => $Ticket, Tickets => $Tickets || undef);
$AttachmentContent ||= $m->comp('/Ticket/Elements/LoadTextAttachments', Ticket => $Ticket);
@@ -117,9 +124,10 @@
<%ARGS>
$URIFile => 'Display.html'
$Ticket => undef
+$Tickets => undef
$Attachments => undef
+$ShowHeaders => 0
$AttachmentContent => undef
-$ShowHeaders => undef
$Collapsed => undef
$ShowTitle => 1
$ShowDisplayModes => 1
Modified: rt/branches/rt-3.1/html/Ticket/Elements/ShowTransaction
==============================================================================
--- rt/branches/rt-3.1/html/Ticket/Elements/ShowTransaction (original)
+++ rt/branches/rt-3.1/html/Ticket/Elements/ShowTransaction Thu Mar 25 10:20:13 2004
@@ -188,7 +188,7 @@
# If the transaction has anything attached to it at all
else {
- unless ( $ShowHeaders && ( $ShowHeaders == $Ticket->Id ) ) {
+ unless ( $ShowHeaders ) {
@DisplayHeaders = qw(To From RT-Send-Cc Cc Bcc Date Subject);
}
More information about the Rt-commit
mailing list