[Rt-commit] r15682 - in rt/branches/3.999-DANGEROUS: lib/RT/Shredder share/html/Admin/Tools/Shredder/Elements/Object share/html/Ticket share/html/Ticket/Attachment share/html/Ticket/Elements
ruz at bestpractical.com
ruz at bestpractical.com
Sun Aug 31 22:38:24 EDT 2008
Author: ruz
Date: Sun Aug 31 22:38:24 2008
New Revision: 15682
Modified:
rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm
rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment
rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/attachments
rt/branches/3.999-DANGEROUS/share/html/Ticket/Attachment/dhandler
rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowAttachments
rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowHistory
rt/branches/3.999-DANGEROUS/share/html/Ticket/ShowEmailRecord.html
Log:
* finish refactoring with transaction* method of Attachment
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Shredder/Attachment.pm Sun Aug 31 22:38:24 2008
@@ -120,7 +120,7 @@
my $rec = $args{'shredder'}->get_record( object => $self );
$self = $rec->{'object'};
$rec->{'state'} |= INVALID;
- $rec->{'description'} = "Have no related transaction #" . $self->transaction_id . " object";
+ $rec->{'description'} = "Have no related transaction #" . $self->transaction->id . " object";
}
$deps->_push_dependencies(
Modified: rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment Sun Aug 31 22:38:24 2008
@@ -48,6 +48,6 @@
<%ARGS>
$object => undef
</%ARGS>
-<a href="<% RT->config->get('WebURL') %>/Ticket/Attachment/<% $object->transaction_id %>/<% $object->id %>/">
+<a href="<% RT->config->get('WebURL') %>/Ticket/Attachment/<% $object->transaction->id %>/<% $object->id %>/">
Attachment(id:<% $object->id %>, Filename: <% $object->filename || '(no value)' %>)
</a>
Modified: rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/attachments
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/attachments (original)
+++ rt/branches/3.999-DANGEROUS/share/html/REST/1.0/Forms/ticket/attachments Sun Aug 31 22:38:24 2008
@@ -94,7 +94,7 @@
push @data, [ subject => $attachment->subject ];
push @data, [ Creator => $attachment->creator ];
push @data, [ Created => $attachment->created ];
- push @data, [ Transaction => $attachment->transaction_id ];
+ push @data, [ Transaction => $attachment->transaction->id ];
push @data, [ Parent => $attachment->parent ];
push @data, [ message_id => $attachment->message_id ];
push @data, [ Filename => $attachment->filename ];
Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Attachment/dhandler
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Attachment/dhandler (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Attachment/dhandler Sun Aug 31 22:38:24 2008
@@ -62,8 +62,8 @@
unless ($AttachmentObj->id) {
abort("Bad attachment id. Couldn't find attachment '$attach'\n");
}
- unless ($AttachmentObj->transaction_id() == $trans ) {
- abort("Bad transaction number for attachment. $trans should be".$AttachmentObj->transaction_id() ."\n");
+ unless ($AttachmentObj->transaction->id == $trans ) {
+ abort("Bad transaction number for attachment. $trans should be".$AttachmentObj->transaction->id ."\n");
}
Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowAttachments
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowAttachments (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowAttachments Sun Aug 31 22:38:24 2008
@@ -71,7 +71,7 @@
</%PERL>
<li><font size="-2">
-<a href="<%RT->config->get('WebPath')%>/Ticket/Attachment/<%$rev->transaction_id%>/<%$rev->id%>/<%$rev->filename | u%>">
+<a href="<%RT->config->get('WebPath')%>/Ticket/Attachment/<%$rev->transaction->id%>/<%$rev->id%>/<%$rev->filename | u%>">
<&|/l, $rev->created_as_string, $size, $rev->creator_obj->name &>%1 (%2) by %3</&>
</a>
</font></li>
Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowHistory
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowHistory (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/Elements/ShowHistory Sun Aug 31 22:38:24 2008
@@ -97,10 +97,10 @@
$i++;
- my @trans_attachments = grep { $_->transaction_id == $Transaction->id } @attachments;
+ my @trans_attachments = grep { $_->transaction->id == $Transaction->id } @attachments;
my $trans_content = {};
- grep { ($_->transaction_id == $Transaction->id ) && ($trans_content->{$_->id} = $_) } @attachment_content;
+ grep { ($_->transaction->id == $Transaction->id ) && ($trans_content->{$_->id} = $_) } @attachment_content;
#Args is first because we're clobbering the "Attachments" parameter
Modified: rt/branches/3.999-DANGEROUS/share/html/Ticket/ShowEmailRecord.html
==============================================================================
--- rt/branches/3.999-DANGEROUS/share/html/Ticket/ShowEmailRecord.html (original)
+++ rt/branches/3.999-DANGEROUS/share/html/Ticket/ShowEmailRecord.html Sun Aug 31 22:38:24 2008
@@ -57,7 +57,7 @@
return;
}
my $href = RT->config->get('WebPath') .'/Ticket/Attachment/'
- . $attach->transaction_id .'/'. $attach->id .'/'
+ . $attach->transaction->id .'/'. $attach->id .'/'
. $m->interp->apply_escapes( $attach->filename, 'u' );
$m->out( '<a href="'. $href .'">'. _('download') .'</a>' );
};
@@ -84,7 +84,7 @@
unless ( $AttachmentObj->id ) {
abort(_("Attachment '%1' could not be loaded", $attachment));
}
-unless ($AttachmentObj->transaction_id() == $transaction ) {
+unless ($AttachmentObj->transaction->id == $transaction ) {
abort(_("Attachment '%1' could not be loaded", $attachment));
}
More information about the Rt-commit
mailing list