[Bps-public-commit] r19782 - RT-BugTracker/html/Ticket
sartak at bestpractical.com
sartak at bestpractical.com
Thu May 28 13:27:02 EDT 2009
Author: sartak
Date: Thu May 28 13:27:02 2009
New Revision: 19782
Modified:
RT-BugTracker/html/Ticket/Create.html
Log:
Bring Ticket/Create a little closer to 3.6-RELEASE for easier diffing
Modified: RT-BugTracker/html/Ticket/Create.html
==============================================================================
--- RT-BugTracker/html/Ticket/Create.html (original)
+++ RT-BugTracker/html/Ticket/Create.html Thu May 28 13:27:02 2009
@@ -55,6 +55,7 @@
current_tab => 'Dist/Display.html?Queue='. $m->interp->apply_escapes( $Queue, 'u' ),
current_subtab => 'Ticket/Create.html?Queue='. $m->interp->apply_escapes( $Queue, 'u' ),
&>
+<& /Elements/ListActions, actions => \@results &>
<form action="<%$RT::WebPath%>/Ticket/Create.html" method="post" enctype="multipart/form-data" name="TicketCreate">
<input type="hidden" class="hidden" name="id" value="new" />
<& /Elements/Callback, _CallbackName => 'FormStart',ARGSRef =>\%ARGS &>
@@ -88,7 +89,7 @@
</td>
</tr>
<tr>
-<td class="labeltop">
+<td class="label">
<&|/l&>Cc</&>:
</td>
<td class="value" colspan="5">
@@ -98,7 +99,7 @@
</td>
</tr>
<tr>
-<td class="labeltop">
+<td class="label">
<&|/l&>Admin Cc</&>:
</td>
<td class="value" colspan="5">
@@ -154,6 +155,7 @@
<tr>
<td colspan="6">
<&|/l&>Describe the issue below</&>:<br />
+<& /Elements/Callback, _CallbackName => 'BeforeMessageBox', QueueObj => $QueueObj, %ARGS &>
% if (exists $ARGS{Content}) {
<& /Elements/MessageBox, Default => $ARGS{Content}, IncludeSignature => 0 &>
% } else {
@@ -242,6 +244,78 @@
<%INIT>
+my $CloneTicketObj;
+if ( $CloneTicket ) {
+ $CloneTicketObj = RT::Ticket->new( $session{CurrentUser} );
+ $CloneTicketObj->Load($CloneTicket) or Abort(loc("Ticket could not be loaded"));
+
+ my $clone = {
+ Requestors => join( ',', $CloneTicketObj->RequestorAddresses ),
+ Cc => join( ',', $CloneTicketObj->CcAddresses),
+ AdminCc => join( ',', $CloneTicketObj->AdminCcAddresses),
+ InitialPriority => $CloneTicketObj->Priority,
+ };
+
+ $clone->{$_} = $CloneTicketObj->$_()
+ for qw/Owner Subject FinalPriority TimeEstimated TimeWorked
+ Status TimeLeft Starts Started Due Resolved/;
+
+ my $members = $CloneTicketObj->Members;
+ my ( @members, @members_of, @refers, @refers_by, @depends, @depends_by );
+ while ( my $member = $members->Next ) {
+ push @members, $member->LocalBase;
+ }
+ $clone->{'MemberOf-new'} = join ' ', @members;
+
+ my $members_of = $CloneTicketObj->MemberOf;
+ while ( my $member_of = $members_of->Next ) {
+ push @members_of, $member_of->LocalTarget;
+ }
+ $clone->{'new-MemberOf'} = join ' ', @members_of;
+
+ my $refers = $CloneTicketObj->RefersTo;
+ while ( my $refer = $refers->Next ) {
+ push @refers, $refer->LocalTarget;
+ }
+ $clone->{'new-RefersTo'} = join ' ', @refers;
+
+ my $refers_by = $CloneTicketObj->ReferredToBy;
+ while ( my $refer_by = $refers_by->Next ) {
+ push @refers_by, $refer_by->LocalBase;
+ }
+ $clone->{'RefersTo-new'} = join ' ', @refers_by;
+
+ my $depends = $CloneTicketObj->DependsOn;
+ while ( my $depend = $depends->Next ) {
+ push @depends, $depend->LocalTarget;
+ }
+ $clone->{'new-DependsOn'} = join ' ', @depends;
+
+ my $depends_by = $CloneTicketObj->DependedOnBy;
+ while ( my $depend_by = $depends_by->Next ) {
+ push @depends_by, $depend_by->LocalBase;
+ }
+ $clone->{'DependsOn-new'} = join ' ', @depends_by;
+
+
+
+ my $cfs = $CloneTicketObj->QueueObj->TicketCustomFields();
+ while ( my $cf = $cfs->Next ) {
+ my $cf_id = $cf->id;
+ my $cf_values = $CloneTicketObj->CustomFieldValues( $cf->id );
+ my @cf_values;
+ while ( my $cf_value = $cf_values->Next ) {
+ push @cf_values, $cf_value->Content;
+ }
+ $clone->{"Object-RT::Ticket--CustomField-$cf_id-Value"}
+ = join "\n", @cf_values;
+ }
+
+ for ( keys %$clone ) {
+ $ARGS{$_} = $clone->{$_} if not defined $ARGS{$_};
+ }
+
+}
my @results;
my $QueueObj = new RT::Queue($session{'CurrentUser'});
@@ -338,4 +412,5 @@
$MemberOf => undef
$QuoteTransaction => undef
$Queue => undef
+$CloneTicket => undef
</%ARGS>
More information about the Bps-public-commit
mailing list