[Rt-commit] r5277 - in rtir/branches/1.9-EXPERIMENTAL:
html/RTIR/Incident
ruz at bestpractical.com
ruz at bestpractical.com
Mon May 22 09:19:39 EDT 2006
Author: ruz
Date: Mon May 22 09:19:39 2006
New Revision: 5277
Modified:
rtir/branches/1.9-EXPERIMENTAL/ (props changed)
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Create.html
rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Split.html
Log:
r1428 at cubic-pc: cubic | 2006-05-22 17:12:31 +0400
* split an inc and launch an investigation on the new inc link
the investigation to both incidents, fix it
* don't link splitted incidents to each other
* in general allow to split and add a child at the same time,
but we have no use case yet
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Create.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Create.html (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Create.html Mon May 22 09:19:39 2006
@@ -32,43 +32,62 @@
<& /Elements/ListActions, actions => \@results &>
<%PERL>
-if ( $link && !$link->CurrentUserHasRight('ModifyTicket') ) {
- $m->out( loc('You are not allowed to [_1] #[_2].', lc( $label ), $link->id ) );
+if ( $TicketObj && !$TicketObj->CurrentUserHasRight('ModifyTicket') ) {
+ $m->out( loc('You are not allowed to split from #[_2].', $TicketObj->id ) );
+ return;
+}
+if ( $ChildObj && !$ChildObj->CurrentUserHasRight('ModifyTicket') ) {
+ $m->out( loc('You are not allowed to link with #[_2].', $ChildObj->id ) );
return;
}
</%PERL>
+% if ( $TicketObj ) {
+<form action="Split.html" method="post" enctype="multipart/form-data">
+% } else {
<form action="Create.html" method="post" enctype="multipart/form-data">
+% }
<input type="hidden" name="id" value="new" />
<input type="hidden" name="Queue" value="<% $QueueObj->Name || '' %>" />
<input type="hidden" name="Status" value="<% $ARGS{'Status'} || 'open' %>" />
-<input type="hidden" name="new-MemberOf" value="<% $ARGS{'new-MemberOf'} || '' %>" />
-<input type="hidden" name="MemberOf-new" value="<% $ARGS{'MemberOf-new'} || '' %>" />
-<a name="top">
+% if ( $ChildObj ) {
+<input type="hidden" name="Child" value="<% $Child %>" />
+<input type="hidden" name="MemberOf-new" value="<% $Child %>" />
+% }
+% if ( $TicketObj ) {
+<input type="hidden" name="Split" value="<% $Split %>" />
+<input type="hidden" name="Ticket" value="<% $TicketObj->Id %>" />
+% }
+<a name="top" />
<&| /Widgets/TitleBox, title => $Title &>
<table border="0" cellpadding="0" cellspacing="2">
-% if ($link) {
-% my ($Type) = $m->comp("/RTIR/Elements/Type", TicketObj => $link );
-<tr><td class="label"><% $label %>:</td>
-<td class="value"><% loc("[_1] #[_2]: [_3]", $Type, $link->Id, $link->Subject) %></td></tr>
+% if ( $TicketObj ) {
+% my ($Type) = $m->comp("/RTIR/Elements/Type", TicketObj => $TicketObj );
+<tr><td class="label"><% loc('Split from') %>:</td>
+<td class="value"><% loc("[_1] #[_2]: [_3]", $Type, $TicketObj->Id, $TicketObj->Subject) %></td></tr>
+% }
+
+% if ( $ChildObj ) {
+% my ($Type) = $m->comp("/RTIR/Elements/Type", TicketObj => $ChildObj );
+<tr><td class="label"><% loc('Link with') %>:</td>
+<td class="value"><% loc("[_1] #[_2]: [_3]", $Type, $ChildObj->Id, $ChildObj->Subject) %></td></tr>
% }
<tr>
-% if ($ChildObj) {
<td class="label"><&|/l&>Owner</&>:</td>
+% if ( $ChildObj ) {
<td class="value">
- <% $ChildObj->OwnerObj->Name %>
- <input type="hidden" name="Owner" value="<% $ChildObj->Owner %>" />
+ <% $ChildObj->OwnerObj->Name %>
+ <input type="hidden" name="Owner" value="<% $ChildObj->Owner %>" />
</td>
% } else {
- <td class="label"><&|/l&>Owner</&>:</td>
- <td><& /Elements/SelectOwner,
+ <td class="value"><& /Elements/SelectOwner,
Name => 'Owner',
QueueObj => $QueueObj,
- Default => $ARGS{Owner} || $session{'CurrentUser'}->Id
+ Default => $ARGS{'Owner'} || $session{'CurrentUser'}->Id
&></td>
% }
</tr>
@@ -78,7 +97,7 @@
<tr><td class="labeltop"><&|/l&>Message</&>:</td>
<td>
<%PERL>
-unless ( exists $ARGS{Content} ) {
+unless ( exists $ARGS{'Content'} ) {
my $Transactions;
if ( $TicketObj ) {
$Transactions = $TicketObj->Transactions;
@@ -86,16 +105,16 @@
$Transactions = $ChildObj->Transactions;
}
if ( $Transactions ) {
- $ARGS{Content} = $m->scomp("/RTIR/Elements/TransactionData",
+ $ARGS{'Content'} = $m->scomp("/RTIR/Elements/TransactionData",
Transactions => $Transactions,
Type => 'messages',
- Include => {'Create', 'Correspond'},
+ Include => ['Create', 'Correspond'],
);
- $ARGS{Content} =~ s/\>/>/g;
+ $ARGS{'Content'} =~ s/\>/>/g;
}
}
</%PERL>
-<& /Elements/MessageBox, Default => $ARGS{Content} &>
+<& /Elements/MessageBox, Default => $ARGS{'Content'} &>
</td></tr>
@@ -173,27 +192,13 @@
my $ChildObj;
if ( $Child ) {
$ChildObj = LoadTicket( $Child );
+ $Child = $ARGS{'Child'} = $ChildObj->id;
$ARGS{'Subject'} ||= $ChildObj->Subject;
}
-my ($link, $label);
-if ($ARGS{'new-MemberOf'}) {
- $link = LoadTicket($ARGS{'new-MemberOf'});
- $label = loc("Split from");
-} elsif ($ARGS{'MemberOf-new'}) {
- $link = LoadTicket($ARGS{'MemberOf-new'});
- $label = loc("Link with");
-} elsif ($Child) {
- $link = LoadTicket($Child);
- $label = loc("Link with");
- $ARGS{'MemberOf-new'} = $Child;
-}
-
my $QueueObj = new RT::Queue( $session{'CurrentUser'} );
$QueueObj->Load( 'Incidents' ) || Abort( loc("Queue could not be loaded.") );
-my $TicketObj = $ARGS{TicketObj}; #XXX: .html(public) pages shouldn't take objects as argument
-
$m->comp( '/RTIR/Create.html:ProcessAttachments', %ARGS );
if ( $CreateIncident ) {
@@ -201,8 +206,10 @@
($inc_obj, @tmp) = $m->comp(
'/RTIR/Investigation/Elements/Create:Process',
%ARGS,
- NamePrefix => '',
- DefualtsNamePrefix => '',
+ $Child? ('MemberOf-new' => $Child): (),
+
+ NamePrefix => '',
+ DefaultsNamePrefix => '',
);
push @results, @tmp;
@@ -233,11 +240,18 @@
</%INIT>
<%ARGS>
-$QuoteTransaction => undef
$Title => loc("Create a new Incident")
-$Child => undef
+$QuoteTransaction => undef
+
$CreateWithInvestigation => 0
$CreateIncident => $CreateWithInvestigation
+
+$Split => 0
+# Split source
+$TicketObj => undef
+
+$Child => undef
+
$current_tab => "RTIR/Create.html?Queue=Incidents"
$current_subtab => "RTIR/Create.html?Queue=Incidents"
</%ARGS>
Modified: rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Split.html
==============================================================================
--- rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Split.html (original)
+++ rtir/branches/1.9-EXPERIMENTAL/html/RTIR/Incident/Split.html Mon May 22 09:19:39 2006
@@ -23,19 +23,24 @@
%#
%# END LICENSE BLOCK
<& /RTIR/Create.html,
- 'new-MemberOf' => $TicketObj->Id,
- QuoteTransaction => $QuoteTransaction,
Queue => $TicketObj->QueueObj->Name,
+ Status => $TicketObj->Status,
Subject => $TicketObj->Subject,
+
+ Owner => $TicketObj->Owner,
Requestors => $TicketObj->RequestorAddresses,
Cc => $TicketObj->CcAddresses,
AdminCc => $TicketObj->AdminCcAddresses,
- TicketObj => $TicketObj,
- Status => $TicketObj->Status,
- Owner => $TicketObj->Owner,
+
InitialPriority => $TicketObj->InitialPriority,
FinalPriority => $TicketObj->FinalPriority,
+
+ %ARGS,
+
Title => loc("Split Incident #[_1]: [_2]", $TicketObj->id, $TicketObj->Subject),
+ Split => 1,
+ TicketObj => $TicketObj,
+
current_tab => "RTIR/Display.html?id=".$Ticket,
current_subtab => "RTIR/Split.html?Ticket=".$Ticket,
&>
@@ -45,7 +50,6 @@
</%INIT>
<%ARGS>
-$MemberOf => undef
$QuoteTransaction => undef
$Ticket => undef
</%ARGS>
More information about the Rt-commit
mailing list