[Rt-commit] rtir branch, rt-3.9, updated. 72e900feb972f8ed2335aeea9977fe259bcd1b38
? sunnavy
sunnavy at bestpractical.com
Thu Oct 7 03:00:34 EDT 2010
The branch, rt-3.9 has been updated
via 72e900feb972f8ed2335aeea9977fe259bcd1b38 (commit)
via d3fcdddde54604c6e7d975d8b853acdb6a58e7b6 (commit)
from 714ceb9e5911630466974074f7768c5d42f2247f (commit)
Summary of changes:
etc/initialdata | 49 -------------
html/Callbacks/RTIR/Elements/ListActions/ModifyRow | 5 --
.../RTIR/Elements/RT__Ticket/ColumnMap/Once | 2 +-
.../Elements/EditCustomFields/MassageCustomFields | 2 +-
html/RTIR/Block/Elements/EditState | 21 ------
html/RTIR/Create.html | 14 +++-
html/RTIR/Display.html | 37 ++++------
html/RTIR/Edit.html | 16 ++--
html/RTIR/Elements/AttachReports | 2 +-
html/RTIR/Elements/ChildSummary | 4 +-
html/RTIR/Elements/IncidentSummary | 4 +-
html/RTIR/Elements/NewQuery | 2 +-
html/RTIR/Elements/QueueSummary | 4 +-
html/RTIR/Elements/QueueTabs | 22 +++---
html/RTIR/Elements/ShowChildren | 2 +-
html/RTIR/Elements/ShowIncidents | 4 +-
html/RTIR/Incident/BulkAbandon.html | 12 +---
html/RTIR/Incident/Create.html | 14 +++-
html/RTIR/Incident/Display.html | 11 ++--
html/RTIR/Incident/Edit.html | 16 +++--
html/RTIR/Incident/Reply.html | 25 ++-----
html/RTIR/Investigation/Elements/Create | 2 +-
html/RTIR/Report/BulkReject.html | 11 +---
html/RTIR/Search/Reporting.html | 2 +-
html/RTIR/Update.html | 4 +-
lib/RT/Action/RTIR_SetBlockState.pm | 47 ++-----------
lib/RT/Action/RTIR_SetIncidentState.pm | 1 +
lib/RT/Action/RTIR_SetInvestigationState.pm | 1 +
lib/RT/Action/RTIR_SetState.pm | 15 +---
lib/RT/Condition/RTIR_BlockActivation.pm | 16 +----
lib/RT/Condition/RTIR_RequireStateChange.pm | 2 +-
lib/RT/IR.pm | 34 ++++++---
lib/RT/IR/Test/Web.pm | 20 +++---
t/002-test-reject.t | 18 ++---
t/003-resolve-IR-when-all-incidents-resolved.t | 12 +++-
t/005-resolve-investigations.t | 6 +-
t/008-workflow-blocks.t | 72 ++++++++++----------
t/010-bulk-reject.t | 10 ++--
t/011-merge.t | 8 +-
t/016-date-started.t | 2 +-
t/incident/abandon.t | 14 ++--
t/incident/bulk-abandon.t | 6 +-
42 files changed, 221 insertions(+), 350 deletions(-)
delete mode 100644 html/RTIR/Block/Elements/EditState
- Log -----------------------------------------------------------------
commit d3fcdddde54604c6e7d975d8b853acdb6a58e7b6
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 7 13:26:16 2010 +0800
use status since we have lifecycle
diff --git a/etc/initialdata b/etc/initialdata
index f8018e9..0b536a7 100644
--- a/etc/initialdata
+++ b/etc/initialdata
@@ -38,18 +38,6 @@
@CustomFields = (
{
- Name => 'State',
- Type => 'SelectSingle',
- Queue => 'Incidents',
- Disabled => 0,
- Description => 'State for Incidents RTIR queue',
- Values => [
- { Name => "open", SortOrder => 1 },
- { Name => "resolved", SortOrder => 2 },
- { Name => "abandoned", SortOrder => 3 },
- ],
- },
- {
Name => 'Constituency',
Type => 'SelectSingle',
Queue => ['Incidents', 'Incident Reports', 'Investigations', 'Blocks'],
@@ -61,43 +49,6 @@
],
},
{
- Name => 'State',
- Type => 'SelectSingle',
- Queue => 'Incident Reports',
- Disabled => 0,
- Description => 'State for Incident Reports RTIR queue',
- Values => [
- { Name => "new", SortOrder => 1 },
- { Name => "open", SortOrder => 2 },
- { Name => "resolved", SortOrder => 3 },
- { Name => "rejected", SortOrder => 4 },
- ],
- },
- {
- Name => 'State',
- Type => 'SelectSingle',
- Queue => 'Investigations',
- Disabled => 0,
- Description => 'State for Investigations RTIR queue',
- Values => [
- { Name => "open", SortOrder => 1 },
- { Name => "resolved", SortOrder => 2 },
- ],
- },
- {
- Name => 'State',
- Type => 'SelectSingle',
- Queue => 'Blocks',
- Disabled => 0,
- Description => 'State for Blocks RTIR queue',
- Values => [
- { Name => "pending activation", SortOrder => 1 },
- { Name => "active", SortOrder => 2 },
- { Name => "pending removal", SortOrder => 3 },
- { Name => "removed", SortOrder => 4 }
- ],
- },
- {
Name => 'Description',
Type => 'FreeformSingle',
Queue => 'Incidents',
diff --git a/html/Callbacks/RTIR/Elements/ListActions/ModifyRow b/html/Callbacks/RTIR/Elements/ListActions/ModifyRow
index 3ad45c3..ea2ae0f 100644
--- a/html/Callbacks/RTIR/Elements/ListActions/ModifyRow
+++ b/html/Callbacks/RTIR/Elements/ListActions/ModifyRow
@@ -12,11 +12,6 @@ foreach my $item ( grep $_, @skiplist ) {
# get out of here if we are not in RTIR space
return unless $m->request_comp->path =~ m{^/RTIR/};
-# skip RT status updates
-# XXX: this doesn't work with localization
-if ( $$row =~ /^\s*(?:Ticket\s*#?\d+:\s*)?Status changed from/ ) {
- return $$skip = 1;
-}
</%INIT>
<%ARGS>
diff --git a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
index 5c7a7bf..a1fb3b7 100644
--- a/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
+++ b/html/Callbacks/RTIR/Elements/RT__Ticket/ColumnMap/Once
@@ -52,7 +52,7 @@ $COLUMN_MAP->{'HasIncident'} = {
my $t = shift;
my $yesno;
- my $query = "Queue = 'Incidents' AND HasMember = " . $t->Id . " AND CF.{State} != 'rejected'";
+ my $query = "Queue = 'Incidents' AND HasMember = " . $t->Id . " AND Status != 'rejected'";
my $incidents = new RT::Tickets($session{'CurrentUser'});
$incidents->FromSQL($query);
diff --git a/html/Callbacks/RTIR/Ticket/Elements/EditCustomFields/MassageCustomFields b/html/Callbacks/RTIR/Ticket/Elements/EditCustomFields/MassageCustomFields
index 1f96c13..66bba5b 100644
--- a/html/Callbacks/RTIR/Ticket/Elements/EditCustomFields/MassageCustomFields
+++ b/html/Callbacks/RTIR/Ticket/Elements/EditCustomFields/MassageCustomFields
@@ -11,7 +11,7 @@ my $on_create = $QueueObj && !($TicketObj && $TicketObj->id);
# We never want to see the RTIR custom fields State and Constituency in the edity ui
$CustomFields->_OpenParen('RTIR');
-$CustomFields->Limit( SUBCLAUSE => 'RTIR', ENTRYAGGREGATOR => 'AND', FIELD => 'Name', OPERATOR => '!=', VALUE => 'State');
+# $CustomFields->Limit( SUBCLAUSE => 'RTIR', ENTRYAGGREGATOR => 'AND', FIELD => 'Name', OPERATOR => '!=', VALUE => 'State');
$CustomFields->Limit( SUBCLAUSE => 'RTIR', ENTRYAGGREGATOR => 'AND', FIELD => 'Name', OPERATOR => '!=', VALUE => 'Constituency');
$CustomFields->_CloseParen('RTIR');
</%init>
diff --git a/html/RTIR/Create.html b/html/RTIR/Create.html
index 4094f3f..32d07ef 100644
--- a/html/RTIR/Create.html
+++ b/html/RTIR/Create.html
@@ -62,7 +62,6 @@
% }
<input type="hidden" name="id" value="new" />
<input type="hidden" name="Queue" value="<% $Queue %>" />
-<input type="hidden" name="Status" value="<% $Status || 'new' %>" />
% if ( $Split ) {
<input type="hidden" name="Ticket" value="<% $TicketObj->Id %>" />
% }
@@ -99,6 +98,17 @@
</tr>
% }
<tr>
+ <td class="label"><&|/l&>Status</&>:</td>
+ <td colspan="2">
+ <& /Elements/SelectStatus,
+ Name => 'Status',
+ QueueObj => $QueueObj,
+ DefaultValue => 0,
+# Default => 'new',
+ &>
+ </td>
+ </tr>
+ <tr>
<td class="label"><&|/l&>Owner</&>:</td>
<td colspan="2">
<& /Elements/SelectOwner,
@@ -276,7 +286,7 @@ if ( $Type eq 'Report' ) {
} elsif ( $Type eq 'Investigation' ) {
$Status = 'open';
} elsif ( $Type eq 'Block' ) {
- $Status = 'new';
+ $Status = 'active';
}
$name ||= $Type;
diff --git a/html/RTIR/Display.html b/html/RTIR/Display.html
index 4e38d44..4297eea 100644
--- a/html/RTIR/Display.html
+++ b/html/RTIR/Display.html
@@ -45,6 +45,12 @@
&>
<table>
<tr>
+ <td class="label"><% loc("Status") %>:</td>
+ <td class="value" colspan="2">
+ <% $Ticket->Status %>
+ </td>
+ </tr>
+ <tr>
<td class="label"><% loc("Incident") %>:</td>
<td class="value" colspan="2">
<& /RTIR/Elements/ShowIncidents, Ticket => $Ticket &>
@@ -157,13 +163,12 @@ if ( $id eq 'new' ) {
}
($Ticket, @results) = CreateTicket( %ARGS, Attachments => delete $session{'Attachments'} );
} elsif( $id ) {
- my $oldstate = $Ticket->FirstCustomFieldValue('State') ||'';
$m->callback(
CallbackName => 'ProcessArguments',
Ticket => $Ticket,
ARGSRef => \%ARGS,
- Actions => \@results
+ Actions => \@results,
);
if ( $ARGS{'Action'} && $ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/ ) {
@@ -190,13 +195,6 @@ if ( $id eq 'new' ) {
$ARGS{UpdateAttachments} = delete $session{'Attachments'};
push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => \%ARGS );
- if ( $Type eq 'Block' && ($ARGS{'Status'}||'') eq 'open' && $Ticket->Status eq 'open' ) {
- my ($id, $msg) = $Ticket->AddCustomFieldValue(
- Field => 'State',
- Value => 'active',
- );
- $RT::Logger->error("Couldn't set state: $msg");
- }
push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS );
my $strict_acl = RT->Config->Set( StrictLinkACL => 0 );
@@ -204,11 +202,6 @@ if ( $id eq 'new' ) {
RT->Config->Set( StrictLinkACL => $strict_acl );
push @results, ProcessTicketDates( TicketObj => $Ticket, ARGSRef => \%ARGS );
-
- my $newstate = $Ticket->FirstCustomFieldValue('State') || '';
- if ($newstate ne $oldstate) {
- push (@results, loc("State changed from [_1] to [_2]", $oldstate, $newstate));
- }
}
if ( $ARGS{'BulkArticles'} && @SelectedTickets ) {
@@ -226,15 +219,13 @@ unless ( $Ticket->CurrentUserHasRight('ShowTicket') ) {
# update id argument in the case we took merged or created new
$ARGS{'id'} = $id = $Ticket->Id;
-if ( @results ) {
- # We've done something, so we need to clear the decks to avoid
- # resubmission on refresh. But we need to store Actions somewhere
- # too, so we don't lose them.
- my $key = Digest::MD5::md5_hex( rand(1024) );
- push @{ $session{"Actions"}{ $key } ||= [] }, @results;
- $session{'i'}++;
- RT::Interface::Web::Redirect( RT->Config->Get('WebURL') ."RTIR/Display.html?id=". $id ."&results=" . $key );
-}
+$m->comp(
+ '/Ticket/Elements/MaybeRedirectForResults',
+ Actions => \@results,
+ Path => 'RTIR/Display.html',
+ TicketObj => $Ticket,
+);
+
if ( $Type eq 'Report' ) {
$name = "Incident Report";
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 94ae82f..3de93ce 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -51,12 +51,17 @@
<table>
<tr>
- <td class="label"><%loc("State")%>:</td>
+ <td class="label"><&|/l&>Status</&>:</td>
<td class="value" colspan="2">
% unless ( $Type eq 'Block' ) {
- <& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'State' &>
+ <% $Ticket->Status %>
% } else {
- <& /RTIR/Block/Elements/EditState, TicketObj => $Ticket, Default => $Ticket->Status &>
+ <& /Elements/SelectStatus,
+ Name => 'Status',
+ QueueObj => $Ticket->QueueObj,
+ DefaultValue => 0,
+ Default => $Ticket->Status,
+ &>
% }
</td>
</tr>
@@ -169,7 +174,6 @@ if ( $constituency_propagation eq 'reject' ) {
if ( $SaveChanges && !$OnlySearchForPeople ) {
my $checks_failure = 0;
- my $oldstate = RT::IR::Ticket::FirstCustomFieldValue( $Ticket, 'State' );
push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS );
my $strict_acl = RT->Config->Set( StrictLinkACL => 0 );
@@ -192,10 +196,6 @@ if ( $SaveChanges && !$OnlySearchForPeople ) {
$checks_failure = 1 unless $status;
push @results, ProcessTicketCustomFieldUpdates( ARGSRef => \%ARGS );
- my $newstate = RT::IR::Ticket::FirstCustomFieldValue( $Ticket, 'State' );
- if ($newstate ne $oldstate) {
- push (@results, loc("State changed from [_1] to [_2]", $oldstate, $newstate));
- }
if ( !$checks_failure && RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
$m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
push @{ $session{'Actions'}{''} ||= [] }, @results;
diff --git a/html/RTIR/Elements/AttachReports b/html/RTIR/Elements/AttachReports
index ced93e6..5604efc 100644
--- a/html/RTIR/Elements/AttachReports
+++ b/html/RTIR/Elements/AttachReports
@@ -38,7 +38,7 @@ return unless $siblings->Count;
my $Format = q{
'<b><a HREF="__WebPath__/Ticket/Display.html?id=__id__">__id__</a></b>/TITLE:#',
'<b><a href="__WebPath__/Ticket/Display.html?id=__id__">__Subject__</a></b>/TITLE:Subject',
- '__CustomField.{State}__/TITLE:State',
+ '__Status__/TITLE:Status',
__LastUpdatedRelative__, __CreatedRelative__
};
</%INIT>
diff --git a/html/RTIR/Elements/ChildSummary b/html/RTIR/Elements/ChildSummary
index ac06fa9..a44f3b1 100644
--- a/html/RTIR/Elements/ChildSummary
+++ b/html/RTIR/Elements/ChildSummary
@@ -28,7 +28,7 @@
%# XXX: why we don't use TicketList component here?
<th><b><&|/l&>id<b></&></th>
<th><b><&|/l&>Subject<b></&></th>
-<th><b><&|/l&>State<b></&></th>
+<th><b><&|/l&>Status<b></&></th>
<th><b><&|/l&>Priority<b></&></th>
<th align="right"><b><&|/l&>Actions<b></&></th>
</tr>
@@ -45,7 +45,7 @@
<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%></a></b></td>
<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Subject%></a></b></td>
-<td><& "/RTIR/Elements/ShowRTIRField", Ticket => $Ticket, Name => 'State' &>
+<td><%$Ticket->Status%></td>
<td><%$Ticket->Priority%></td>
% if ($Type eq 'Incident') {
<td align="right"><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?Child=<%$Ticket->Id%>&id=<%$ticket%>">[<%loc("Link")%>]</a></td>
diff --git a/html/RTIR/Elements/IncidentSummary b/html/RTIR/Elements/IncidentSummary
index 2136345..ee168de 100644
--- a/html/RTIR/Elements/IncidentSummary
+++ b/html/RTIR/Elements/IncidentSummary
@@ -27,7 +27,7 @@
<tr>
<td><b><&|/l&>id<b></&></td>
<td><b><&|/l&>Subject<b></&></td>
-<td><b><&|/l&>State<b></&></td>
+<td><b><&|/l&>Status<b></&></td>
<td><b><&|/l&>Priority<b></&></td>
<td align="right"><b><&|/l&>Actions<b></&></td>
</tr>
@@ -44,7 +44,7 @@
<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Id%></a></b></td>
<td><b><a href="<%RT->Config->Get('WebPath')%>/RTIR/Display.html?id=<%$Ticket->Id%>"><%$Ticket->Subject%></a></b></td>
-<td><& "/RTIR/Elements/ShowRTIRField", Ticket => $Ticket, Name => 'State' &>
+<td><%$Ticket->Status%></td>
</td>
<td><%$Ticket->Priority%></td>
<td align="right">
diff --git a/html/RTIR/Elements/NewQuery b/html/RTIR/Elements/NewQuery
index 8a7e4bb..f948565 100644
--- a/html/RTIR/Elements/NewQuery
+++ b/html/RTIR/Elements/NewQuery
@@ -8,7 +8,7 @@ my %seen = ();
@states = grep !$seen{$_}++, map lc, grep $_, @states, @add_states;
my $query = join " OR ",
- map "'CF.{State}' = '$_'",
+ map "'Status' = '$_'",
@states;
$query = "( $query )" if $query;
return $query;
diff --git a/html/RTIR/Elements/QueueSummary b/html/RTIR/Elements/QueueSummary
index f916936..6c74ee2 100644
--- a/html/RTIR/Elements/QueueSummary
+++ b/html/RTIR/Elements/QueueSummary
@@ -18,13 +18,13 @@ Description => loc('RTIR queues summary')
% for my $queue (@queues) {
% $i++;
% my $queue_cond = "Queue = '$queue'";
-% my $all_q = "$queue_cond AND (". join( ' OR ', map "CF.{State} = '$_'", @{ $states{ $queue } } ).')';
+% my $all_q = "$queue_cond AND (". join( ' OR ', map "Status = '$_'", @{ $states{ $queue } } ).')';
<tr class="<% $i%2 ? 'oddline' : 'evenline'%>" >
<td><a href="<% RT->Config->Get('WebPath')%>/Search/Results.html?Query=<% $all_q |un %>""><% $queue %></a></td>
% foreach my $s ( @states ) {
<td align="right">
% if ( grep $_ eq $s, @{ $states{ $queue } } ) {
-% my $query = "$queue_cond AND CF.{State} = '$s'";
+% my $query = "$queue_cond AND Status = '$s'";
% $Tickets->FromSQL( $query );
% my $qs = $m->comp('/Elements/QueryString', Queue => $queue, Query => $query );
<a href="<% RT->Config->Get('WebPath') %>/RTIR/Search/Results.html?<% $qs |n %>"><% $Tickets->Count %></a></td>
diff --git a/html/RTIR/Elements/QueueTabs b/html/RTIR/Elements/QueueTabs
index 183f674..e752c05 100644
--- a/html/RTIR/Elements/QueueTabs
+++ b/html/RTIR/Elements/QueueTabs
@@ -155,12 +155,12 @@ if ( $Ticket && $Ticket->QueueObj->Name eq $QueueName ) {
$actions->{'A'} = {
title => loc('Reply to Reporters'),
path =>
- "RTIR/Incident/Reply.html?id=$id&DefaultStatus=stalled&SelectAllTickets=1",
+ "RTIR/Incident/Reply.html?id=$id&SelectAllTickets=1",
};
$actions->{'Ab'} = {
title => loc('Reply to All'),
path =>
- "RTIR/Incident/Reply.html?id=$id&DefaultStatus=stalled&SelectAllTickets=1&All=1",
+ "RTIR/Incident/Reply.html?id=$id&SelectAllTickets=1&All=1",
};
} elsif ( $Type eq 'Block' ) {
$actions->{'A'} = {
@@ -172,7 +172,7 @@ if ( $Ticket && $Ticket->QueueObj->Name eq $QueueName ) {
$actions->{'A'} = {
title => loc('Reply'),
path =>
- "RTIR/Update.html?id=$id&Action=Respond&DefaultStatus=stalled",
+ "RTIR/Update.html?id=$id&Action=Respond",
};
}
}
@@ -198,32 +198,32 @@ if ( $Ticket && $Ticket->QueueObj->Name eq $QueueName ) {
title => loc('Quick Resolve'),
};
} elsif ( $Type eq 'Block' ) {
- if ( ($Ticket->FirstCustomFieldValue('State')||'') ne 'active' ) {
+ if ( $Ticket->Status ne 'active' ) {
$actions->{'Ab'} = {
- path => "RTIR/Update.html?Action=Comment&DefaultStatus=open&id=$id",
+ path => "RTIR/Update.html?Action=Comment&DefaultStatus=active&id=$id",
title => loc('Activate')
};
}
$actions->{'Ac'} = {
- path => "RTIR/Update.html?Action=Comment&DefaultStatus=resolved&id=$id",
+ path => "RTIR/Update.html?Action=Comment&DefaultStatus=removed&id=$id",
title => loc('Remove'),
};
$actions->{'Acc'} = {
- path => "RTIR/Display.html?Status=resolved&id=$id",
+ path => "RTIR/Display.html?Status=removed&id=$id",
title => loc('Quick Remove'),
};
}
if ( $Type eq 'Incident' ) {
$actions->{'B'} = {
path =>
- "RTIR/Incident/Reply.html?id=$id&Action=Comment&All=1&DefaultStatus=rejected&SelectAllTickets=1",
+ "RTIR/Incident/Reply.html?id=$id&Action=Comment&All=1&DefaultStatus=abandoned&SelectAllTickets=1",
title => loc('Abandon'),
};
}
} else {
if ( $Type eq 'Block' ) {
$actions->{'C'} = {
- path => "RTIR/Update.html?Action=Comment&DefaultStatus=open&id=$id",
+ path => "RTIR/Update.html?Action=Comment&DefaultStatus=active&id=$id",
title => loc('Activate')
};
} else {
@@ -233,9 +233,9 @@ if ( $Ticket && $Ticket->QueueObj->Name eq $QueueName ) {
};
}
}
- if ( $Type eq 'Block' && ($Ticket->FirstCustomFieldValue('State')||'') eq 'active' ) {
+ if ( $Type eq 'Block' && $Ticket->Status eq 'active' ) {
$actions->{'Ab'} = {
- path => "RTIR/Update.html?Action=Respond&DefaultStatus=stalled&id=$id",
+ path => "RTIR/Update.html?Action=Respond&DefaultStatus=pending removal&id=$id",
title => loc('Pending Removal'),
};
}
diff --git a/html/RTIR/Elements/ShowChildren b/html/RTIR/Elements/ShowChildren
index f4d69bd..7aa14c3 100644
--- a/html/RTIR/Elements/ShowChildren
+++ b/html/RTIR/Elements/ShowChildren
@@ -28,7 +28,7 @@
% my $checked = (grep { $_ eq $s } @States)? 'checked': '';
<input type="checkbox" name="States" value="<% $s %>" <% $checked %> /> <% $s %>
% }
-<& /Elements/Submit, Name => 'RefineStates', Label => loc('Filter states') &>
+<& /Elements/Submit, Name => 'RefineStatus', Label => loc('Filter states') &>
% }
% if ($Delete) {
diff --git a/html/RTIR/Elements/ShowIncidents b/html/RTIR/Elements/ShowIncidents
index a67ad36..e5d30b0 100644
--- a/html/RTIR/Elements/ShowIncidents
+++ b/html/RTIR/Elements/ShowIncidents
@@ -25,7 +25,7 @@
% while ( my $incident = $incidents->Next ) {
% $m->out('<ul>') unless $count;
<li>
-<a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $incident->Id %>"><% $incident->Id %>: <% $incident->Subject %></a> <i>( <& /RTIR/Elements/ShowRTIRField, Ticket => $incident, Name => 'State' &> )</i>
+<a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $incident->Id %>"><% $incident->Id %>: <% $incident->Subject %></a> <i>( <% $incident->Status %> )</i>
% if ( $show_unlink ) {
<a href="<% RT->Config->Get('WebPath') %>/RTIR/Display.html?id=<% $Ticket->Id %>&DeleteLink--MemberOf-<% $incident->Id %>=1">[<% loc('Unlink') %>]</a>
% }
@@ -54,7 +54,7 @@
my $count = 0;
-my $query = "Queue = 'Incidents' AND HasMember = " . $Ticket->Id . " AND CF.{State} != 'rejected'";
+my $query = "Queue = 'Incidents' AND HasMember = " . $Ticket->Id . " AND Status != 'rejected'";
my $incidents = new RT::Tickets($session{'CurrentUser'});
$incidents->FromSQL($query);
diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index 71edf36..739f169 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -113,7 +113,7 @@ if ( $ARGS{'BulkAbandon'} ) {
# process replies
if( scalar @ReplyToAll ) {
# XXX: why do we limit to open?
- my $query = "CF.{State} = 'open' AND MemberOf = $id";
+ my $query = "Status = 'open' AND MemberOf = $id";
$query .= " AND (". join(' OR ', map "Queue = '$_'", @ReplyToAll) .")";
my $members = new RT::Tickets( $t->CurrentUser );
$members->FromSQL( $query );
@@ -140,15 +140,7 @@ if ( $ARGS{'BulkAbandon'} ) {
push @tmp, $t;
foreach my $t( @tmp ) {
- my $oldstate = RT::IR::Ticket::FirstCustomFieldValue( $t, 'State' );
-
push @tempresults, ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $t );
-
- my $newstate = RT::IR::Ticket::FirstCustomFieldValue( $t, 'State' );
- if ( $newstate ne $oldstate ) {
- push @tempresults,
- [ $t->id, loc("State changed from [_1] to [_2]", $oldstate, $newstate ) ];
- }
}
}
@@ -176,7 +168,7 @@ my $current_tab = $BaseURL ."&$QueryString";
</%INIT>
<%ARGS>
-$Status => 'rejected'
+$Status => 'abandoned'
$Queue => 'Incidents'
$BaseQuery => $m->comp( '/RTIR/Elements/BaseQuery', Queue => $Queue );
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 9cbc609..04c2373 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -52,7 +52,6 @@ if ( $ChildObj && !$ChildObj->CurrentUserHasRight('ModifyTicket') ) {
<input type="hidden" name="id" value="new" />
<input type="hidden" name="Queue" value="<% $QueueObj->Name || '' %>" />
-<input type="hidden" name="Status" value="<% $ARGS{'Status'} || 'open' %>" />
% if ( $ChildObj ) {
<input type="hidden" name="Child" value="<% $Child %>" />
% }
@@ -80,6 +79,17 @@ if ( $ChildObj && !$ChildObj->CurrentUserHasRight('ModifyTicket') ) {
% }
<tr>
+ <td class="label"><&|/l&>Status</&>:</td>
+ <td colspan="2">
+ <& /Elements/SelectStatus,
+ Name => 'Status',
+ QueueObj => $QueueObj,
+ DefaultValue => 0,
+ Default => 'open',
+ &>
+ </td>
+</tr>
+<tr>
<td class="label"><&|/l&>Owner</&>:</td>
% if ( $ChildObj ) {
<td class="value">
@@ -199,7 +209,7 @@ unless ( exists $ARGS{'Content'} ) {
%ARGS,
NamePrefix => 'Investigation',
Queue => 'Investigations',
- Status => 'new',
+ Status => 'open',
SkipField => { Owner => 1, Attachments => 1, DateFields => 1 },
&>
<& /Elements/Submit,
diff --git a/html/RTIR/Incident/Display.html b/html/RTIR/Incident/Display.html
index bf94ed4..90bb2b8 100644
--- a/html/RTIR/Incident/Display.html
+++ b/html/RTIR/Incident/Display.html
@@ -43,6 +43,12 @@
<table>
<tr>
+ <td class="label"><% loc("Status") %>:</td>
+ <td class="value" colspan="2">
+ <% $TicketObj->Status %>
+ </td>
+ </tr>
+ <tr>
<td class="label"><&|/l&>Owner</&>:</td>
<td class="value"><& /Elements/ShowUser, User => $TicketObj->OwnerObj &></td>
</tr>
@@ -231,7 +237,6 @@ unless( $TicketObj->QueueObj->Name eq 'Incidents' ) {
$ARGS{'id'} = $id = $TicketObj->Id;
if( 1 ) {
- my $oldstate = RT::IR::Ticket::FirstCustomFieldValue( $TicketObj, 'State' );
if ( $ARGS{'Action'} && $ARGS{'Action'} =~ /^(Steal|Kill|Take|SetTold)$/ )
{
@@ -273,10 +278,6 @@ if( 1 ) {
push @results, ProcessUpdateMessage( ARGSRef => \%ARGS, TicketObj => $TicketObj );
}
- my $newstate = RT::IR::Ticket::FirstCustomFieldValue( $TicketObj, 'State' );
- if ($newstate ne $oldstate) {
- push @results, loc("State changed from [_1] to [_2]", $oldstate, $newstate );
- }
}
# XXX: need the way to show @results when aborting
diff --git a/html/RTIR/Incident/Edit.html b/html/RTIR/Incident/Edit.html
index 5c9dab8..066fbe7 100644
--- a/html/RTIR/Incident/Edit.html
+++ b/html/RTIR/Incident/Edit.html
@@ -48,8 +48,15 @@
<table>
<tr>
- <td class="label"><&|/l&>State</&>:</td>
- <td class="value"><& /RTIR/Elements/ShowRTIRField, Name => 'State', Ticket => $Ticket &></td>
+ <td class="label"><&|/l&>Status</&>:</td>
+ <td>
+ <& /Elements/SelectStatus,
+ Name => 'Status',
+ QueueObj => $Ticket->QueueObj,
+ DefaultValue => 0,
+ Default => $Ticket->Status,
+ &>
+ </td>
</tr>
<tr>
<td class="label"><&|/l&>Owner</&>:</td>
@@ -141,7 +148,6 @@ if ( $constituency_cf && $constituency_propagation eq 'reject' ) {
my @results;
if ( $SaveChanges && !$OnlySearchForPeople ) {
my $checks_failure = 0;
- my $oldstate = $Ticket->FirstCustomFieldValue('State');
push @results, ProcessTicketWatchers( TicketObj => $Ticket, ARGSRef => \%ARGS);
push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
@@ -163,10 +169,6 @@ if ( $SaveChanges && !$OnlySearchForPeople ) {
$ARGS{UpdateAttachments} = $session{'Attachments'};
push @results, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef=>\%ARGS );
- my $newstate = $Ticket->FirstCustomFieldValue('State');
- if ($newstate ne $oldstate) {
- push (@results, loc("State changed from [_1] to [_2]", $oldstate, $newstate));
- }
if ( !$checks_failure && RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
$m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
diff --git a/html/RTIR/Incident/Reply.html b/html/RTIR/Incident/Reply.html
index 5f38d13..1f6ad36 100644
--- a/html/RTIR/Incident/Reply.html
+++ b/html/RTIR/Incident/Reply.html
@@ -125,7 +125,7 @@ if ($DefaultStatus eq 'resolved') {
$title = loc("Resolve Incident #[_1] (including children)", $id);
$SubmitCaption = loc("Resolve Incident");
$SubmitLabel = loc("Resolve");
-} elsif ($DefaultStatus eq 'rejected') {
+} elsif ($DefaultStatus eq 'abandoned') {
$title = loc("Abandon Incident #[_1] (including children)", $id);
$SubmitCaption = loc("Abandon Incident");
$SubmitLabel = loc("Abandon");
@@ -143,7 +143,7 @@ my @queues = ('Incident Reports', 'Investigations');
push @queues, 'Blocks' unless RT->Config->Get('RTIR_DisableBlocksQueue');
my $ActiveStatesQuery =
- join ' OR ', map "CF.{State} = '$_'",
+ join ' OR ', map "Status = '$_'",
RT::IR::States( Queue => \@queues );
$Query ||= "( $ActiveStatesQuery )";
@@ -190,8 +190,6 @@ if ( $SubmitTicket && !$checks_failure ) {
}
$id = $Ticket->id;
- my $oldstate = RT::IR::Ticket::FirstCustomFieldValue( $Ticket, 'State' );
-
my @tempresults;
$ARGS{'UpdateAttachments'} = delete $session{'Attachments'};
push @tempresults, ProcessUpdateMessage( TicketObj => $Ticket, ARGSRef => \%ARGS );
@@ -199,20 +197,15 @@ if ( $SubmitTicket && !$checks_failure ) {
unless ( RT::IR::Ticket::IsLinkedToActiveIncidents( $Ticket, $IncidentObj ) ) {
# XXX: we push into results directly cuz ProcessTicketBasics returns results
# with leading 'Ticket XX:' string
- push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS );
- }
-
- my $newstate = RT::IR::Ticket::FirstCustomFieldValue( $Ticket, 'State' );
-
- if ($newstate ne $oldstate) {
- push (@tempresults, loc("State changed from [_1] to [_2]", $oldstate, $newstate));
+ push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef
+=> { %ARGS, $ARGS{Status} eq 'abandoned' ? ( Status => 'rejected' ) : () } );
}
push @results, map { loc("Ticket [_1]: [_2]", $id, $_) } @tempresults;
}
my $update_incident_state = 1;
- if ( $DefaultStatus =~ /^(rejected|resolved)$/) {
+ if ( $DefaultStatus =~ /^(abandoned|resolved)$/) {
# if we are going to resolve/reject incident then do it only when we've
# rejected all children that are not linked to another active incident(s)
my $children = RT::Tickets->new( $session{'CurrentUser'} );
@@ -225,16 +218,10 @@ if ( $SubmitTicket && !$checks_failure ) {
}
if ( $update_incident_state ) {
- my $oldstate = RT::IR::Ticket::FirstCustomFieldValue( $IncidentObj, 'State' );
push @results, ProcessObjectCustomFieldUpdates( Object => $IncidentObj, ARGSRef => \%ARGS);
push @results, ProcessTicketBasics( TicketObj => $IncidentObj, ARGSRef => \%ARGS );
- my $newstate = RT::IR::Ticket::FirstCustomFieldValue( $IncidentObj, 'State' );
-
- if ($newstate ne $oldstate) {
- push @results, loc("State changed from [_1] to [_2]", $oldstate, $newstate);
- }
} else {
- push @results, loc("State of the Incident left unchanged; not all children were updated");
+ push @results, loc("Status of the Incident left unchanged; not all children were updated");
}
my $pass = {};
diff --git a/html/RTIR/Investigation/Elements/Create b/html/RTIR/Investigation/Elements/Create
index 3af49af..1717258 100644
--- a/html/RTIR/Investigation/Elements/Create
+++ b/html/RTIR/Investigation/Elements/Create
@@ -117,7 +117,7 @@ $QueueObj => undef,
</%ARGS>
<%INIT>
my %DEFAULTS = (
- Status => 'new',
+ Status => 'open',
);
my $value_cb = sub {
my $name = shift;
diff --git a/html/RTIR/Report/BulkReject.html b/html/RTIR/Report/BulkReject.html
index 707a421..e24bee3 100644
--- a/html/RTIR/Report/BulkReject.html
+++ b/html/RTIR/Report/BulkReject.html
@@ -105,15 +105,14 @@ if ( $BulkReject ) {
}
# warn if this IR has any incidents
- my $query = "Queue = 'Incidents' AND HasMember = " . $t->Id . " AND CF.{State} != 'rejected'";
+ my $query = "Queue = 'Incidents' AND HasMember = " . $t->Id . " AND
+ Status != 'rejected'";
my $incidents = new RT::Tickets($session{'CurrentUser'});
$incidents->FromSQL($query);
if ($incidents->Count > 0) {
push( @tempresults, [ $id, loc("Warning: already has incident") ] );
}
- my $oldstate = RT::IR::Ticket::FirstCustomFieldValue( $t, 'State' ) ||'';
-
if ( $t->Owner != $session{'CurrentUser'}->id &&
$t->Owner == $RT::Nobody->id )
{
@@ -126,12 +125,6 @@ if ( $BulkReject ) {
}
push @tempresults, ProcessTicketBasics( ARGSRef => \%ARGS, TicketObj => $t );
-
- my $newstate = RT::IR::Ticket::FirstCustomFieldValue( $t, 'State' ) ||'';
- if ( $newstate ne $oldstate ) {
- push @tempresults,
- [ $id, loc("State changed from [_1] to [_2]", $oldstate, $newstate ) ];
- }
}
push @results, map { ref($_)? loc( "Ticket [_1]: [_2]", $_->[0], $_->[1] ): $_ }
@tempresults;
diff --git a/html/RTIR/Search/Reporting.html b/html/RTIR/Search/Reporting.html
index 9e55c4e..6298faf 100644
--- a/html/RTIR/Search/Reporting.html
+++ b/html/RTIR/Search/Reporting.html
@@ -47,7 +47,7 @@ my $current_tab = "$BaseURL&$QueryString";
</%INIT>
<%ARGS>
-$PrimaryGroupBy => 'CF.{State}'
+$PrimaryGroupBy => 'Status'
$ChartStyle => 'bar'
$ShowChart => 0
diff --git a/html/RTIR/Update.html b/html/RTIR/Update.html
index 284796f..5d069aa 100644
--- a/html/RTIR/Update.html
+++ b/html/RTIR/Update.html
@@ -64,8 +64,8 @@
<table border="0">
-<tr><td align="right"><&|/l&>State</&>:</td>
-<td><& /RTIR/Elements/ShowRTIRField, Ticket => $Ticket, Name => 'State' &></td></tr>
+<tr><td align="right"><&|/l&>Status</&>:</td>
+<td><% $Ticket->Status %></td></tr>
<tr><td align="right"><&|/l&>Update Type</&>:</td>
<td><select name="UpdateType">
% if ($CanComment) {
diff --git a/lib/RT/Action/RTIR_SetBlockState.pm b/lib/RT/Action/RTIR_SetBlockState.pm
index c297edf..2b07b3e 100644
--- a/lib/RT/Action/RTIR_SetBlockState.pm
+++ b/lib/RT/Action/RTIR_SetBlockState.pm
@@ -57,44 +57,11 @@ Returns state of the C<Block>.
sub GetState {
my $self = shift;
- my %state = (
- new => 'pending activation',
-# open => 'active',
- stalled => 'pending removal',
- resolved => 'removed',
- rejected => 'removed',
- );
my $t = $self->TicketObj;
my $txn = $self->TransactionObj;
- my $status = $t->Status;
- my $old_state = $t->FirstCustomFieldValue('State');
+ my $old_status = $t->Status;
- if ( $status eq 'new' && $txn->Type eq 'Correspond' && $txn->IsInbound && $old_state eq 'pending activation' ) {
- if ( my $re = RT->Config->Get('RTIR_BlockAproveActionRegexp') ) {
- my $content = $txn->Content;
- return '' if !$content || $content !~ /$re/;
- }
- my ($val, $msg) = $t->SetStatus( 'open' );
- $RT::Logger->error("Couldn't change status: $msg") unless $val;
- return 'active';
- }
-
- return $state{ $status } if $state{ $status };
- # all code below is related to open status
-
- # if block was removed (resolved/rejected) we reactivate it
- return 'active' if $old_state eq 'removed';
-
- if ( $txn->Creator != $RT::SystemUser->id ) {
- # if a duty team member changes Status directly then we want to activate
- if ( ($txn->Type eq 'Status' || ($txn->Type eq 'Set' && $txn->Field eq 'Status')) &&
- $self->CreatorCurrentUser->PrincipalObj->HasRight(
- Right => 'ModifyTicket', Object => $t
- )
- ) {
- return 'active';
- }
- }
+ return 'active' if $old_status eq 'removed';
# next code related to requestor's correspondents
return '' unless $txn->Type eq 'Correspond';
@@ -105,15 +72,11 @@ sub GetState {
return '' if !$content || $content !~ /$re/;
}
- if ( $old_state eq 'pending activation' ) {
+ if ( $old_status eq 'pending activation' ) {
# switch to active state if it is reply from requestor(s)
return 'active';
- } elsif ( $old_state eq 'pending removal' ) {
- # switch to removed state when requestor(s) replies
- # but do it via changing status!
- my ($val, $msg) = $t->SetStatus( 'resolved' );
- $RT::Logger->error("Couldn't change status: $msg") unless $val;
- return '';
+ } elsif ( $old_status eq 'pending removal' ) {
+ return 'removed';
}
return '';
diff --git a/lib/RT/Action/RTIR_SetIncidentState.pm b/lib/RT/Action/RTIR_SetIncidentState.pm
index fc623cc..cc21aa8 100644
--- a/lib/RT/Action/RTIR_SetIncidentState.pm
+++ b/lib/RT/Action/RTIR_SetIncidentState.pm
@@ -57,6 +57,7 @@ Returns state of the C<Incident>.
sub GetState {
my $self = shift;
+ return '';
my %state = (
new => 'open',
open => 'open',
diff --git a/lib/RT/Action/RTIR_SetInvestigationState.pm b/lib/RT/Action/RTIR_SetInvestigationState.pm
index e5a1181..ef84e16 100644
--- a/lib/RT/Action/RTIR_SetInvestigationState.pm
+++ b/lib/RT/Action/RTIR_SetInvestigationState.pm
@@ -59,6 +59,7 @@ Returns state of the C<Investigation>.
sub GetState {
my $self = shift;
+ return '';
my %state = (
new => 'open',
open => 'open',
diff --git a/lib/RT/Action/RTIR_SetState.pm b/lib/RT/Action/RTIR_SetState.pm
index 8802394..8bc3ec4 100644
--- a/lib/RT/Action/RTIR_SetState.pm
+++ b/lib/RT/Action/RTIR_SetState.pm
@@ -23,23 +23,16 @@ sub Commit {
my $self = shift;
my $t = $self->TicketObj;
- my $cf = RT::CustomField->new( $self->TransactionObj->CurrentUser );
- $cf->LoadByNameAndQueue( Queue => $t->QueueObj->Id, Name => 'State' );
- unless ( $cf->Id ) {
- $RT::Logger->warning("Couldn't load 'State' CF for queue ". $t->QueueObj->Name );
- return 1;
- }
- if ($self->TransactionObj->Type eq 'CustomField' and $self->TransactionObj->Field == $cf->id) {
- return 1;
+ if ( $self->TransactionObj->Field eq 'Status' ) {
+ return 1;
}
my $state = $self->GetState;
return 1 unless $state;
- my ($res, $msg) = $t->AddCustomFieldValue(Field => $cf->id, Value => $state);
-
- $RT::Logger->warning("Couldn't add custom field value: $msg") unless $res;
+ my ( $res, $msg ) = $t->SetStatus( $state ) unless $t->Status eq $state;
+ $RT::Logger->warning("Couldn't set status to $state: $msg") unless $res;
return 1;
}
diff --git a/lib/RT/Condition/RTIR_BlockActivation.pm b/lib/RT/Condition/RTIR_BlockActivation.pm
index a3269f0..957cfe6 100644
--- a/lib/RT/Condition/RTIR_BlockActivation.pm
+++ b/lib/RT/Condition/RTIR_BlockActivation.pm
@@ -19,21 +19,7 @@ sub IsApplicable {
my $txn = $self->TransactionObj;
my $type = $txn->Type;
- return 1 if $type eq 'Create'
- && ($self->TicketObj->FirstCustomFieldValue('State')||'') eq 'active';
-
- if ( $type eq 'CustomField' ) {
- my $cf = $self->TicketObj->QueueObj->CustomField('State');
- unless ( $cf->id ) {
- $RT::Logger->error("Couldn't load the 'State' field");
- return 0;
- }
-
- return 0 unless $cf->id == $txn->Field;
- return 0 unless ($txn->OldValue||'') eq 'pending activation';
- return 0 unless ($txn->NewValue||'') eq 'active';
- return 1;
- }
+ return 1 if $type eq 'Create' && $self->TicketObj->Status eq 'active';
return 0;
}
diff --git a/lib/RT/Condition/RTIR_RequireStateChange.pm b/lib/RT/Condition/RTIR_RequireStateChange.pm
index 78b41bb..ab1e46b 100644
--- a/lib/RT/Condition/RTIR_RequireStateChange.pm
+++ b/lib/RT/Condition/RTIR_RequireStateChange.pm
@@ -65,7 +65,7 @@ sub IsApplicable {
my $self = shift;
my $type = $self->TransactionObj->Type;
- return 1 if $type eq "Create" or $type eq "CustomField";
+ return 1 if $type eq "Create";# or $type eq "CustomField";
return 1 if $self->IsStatusChange;
my $field = $self->TransactionObj->Field;
diff --git a/lib/RT/IR.pm b/lib/RT/IR.pm
index eb4c807..8b7776a 100644
--- a/lib/RT/IR.pm
+++ b/lib/RT/IR.pm
@@ -71,15 +71,6 @@ my %TYPE = (
'investigations' => 'Investigation',
'blocks' => 'Block',
);
-my %STATES = (
- 'incidents' => { Active => ['open'], Inactive => ['resolved', 'abandoned'] },
- 'incident reports' => { Active => ['new', 'open'], Inactive => ['resolved', 'rejected'] },
- 'investigations' => { Active => ['open'], Inactive => ['resolved'] },
- 'blocks' => {
- Active => ['pending activation', 'active', 'pending removal'],
- Inactive => ['removed'],
- },
-);
=head1 FUNCTIONS
@@ -207,9 +198,17 @@ sub States {
: ref $arg{'Queue'}? @{ $arg{'Queue'} } : ( $arg{'Queue'} );
my @states;
- foreach ( @queues ) {
- push @states, @{ $STATES{ lc $_ }->{'Active'} || [] } if $arg{'Active'};
- push @states, @{ $STATES{ lc $_ }->{'Inactive'} || [] } if $arg{'Inactive'};
+ foreach my $name (@queues) {
+ my $queue = RT::Queue->new($RT::SystemUser);
+ $queue->Load($name);
+ if ( $queue->id ) {
+ push @states, $queue->lifecycle->active if $arg{'Active'};
+ push @states, $queue->lifecycle->inactive if $arg{'Inactive'};
+ }
+ else {
+ $RT::Logger->error( "failed to load queue $name" );
+ }
+
}
my %seen = ();
@@ -397,6 +396,17 @@ require RT::Ticket;
};
}
+require RT::Action::AutoOpen;
+{
+ no warnings 'redefine';
+ my $prepare = RT::Action::AutoOpen->can('Prepare');
+ *RT::Action::AutoOpen::Prepare = sub {
+ my $self = shift;
+ return 1 if $self->TicketObj->QueueObj->Name eq 'Blocks';
+ $self->$prepare(@_);
+ };
+}
+
if ( RT::IR->HasConstituency ) {
# Queue {Comment,Correspond}Address for multiple constituencies
diff --git a/lib/RT/IR/Test/Web.pm b/lib/RT/IR/Test/Web.pm
index 1dd8780..839d827 100644
--- a/lib/RT/IR/Test/Web.pm
+++ b/lib/RT/IR/Test/Web.pm
@@ -182,24 +182,24 @@ sub display_ticket {
$self->get_ok("/RTIR/Display.html?id=$id", "Loaded Display page for Ticket #$id");
}
-sub ticket_state {
+sub ticket_status {
my $self = shift;
my $id = shift;
$self->display_ticket( $id);
- my ($got) = ($self->content =~ qr{State:\s*</td>\s*<td[^>]*?class="value"[^>]*?>\s*([\w ]+?)\s*</td>}ism);
+ my ($got) = ($self->content =~ qr{Status:\s*</td>\s*<td[^>]*?class="value"[^>]*?>\s*([\w ]+?)\s*</td>}ism);
unless ( $got ) {
- Test::More::diag("Error: couldn't find state value on the page, may be regexp problem");
+ Test::More::diag("Error: couldn't find status value on the page, may be regexp problem");
}
return $got;
}
-sub ticket_state_is {
+sub ticket_status_is {
my $self = shift;
my $id = shift;
- my $state = shift;
- my $desc = shift || "State of the ticket #$id is '$state'";
- return Test::More::is($self->ticket_state( $id), $state, $desc);
+ my $status = shift;
+ my $desc = shift || "Status of the ticket #$id is '$status'";
+ return Test::More::is($self->ticket_status( $id), $status, $desc);
}
sub ticket_is_linked_to_inc {
@@ -297,7 +297,7 @@ sub merge_ticket {
while($self->content() !~ m|<a href="/Ticket/Display.html\?id=$id_to_merge_to">$id_to_merge_to</a>|) {
my @ids = sort map s|<b>\s*<a href="/Ticket/Display.html?id=(\d+)">\1</a>\s*</b>|$1|, split /<td/, $self->content();
my $max = pop @ids;
- my $url = "Merge.html?id=$id&Order=ASC&Query=( 'CF.{State}' = 'new' OR 'CF.{State}' = 'open' AND 'id' > $max)";
+ my $url = "Merge.html?id=$id&Order=ASC&Query=( 'Status' = 'new' OR 'Status' = 'open' AND 'id' > $max)";
my $weburl = RT->Config->Get('WebURL');
Test::More::diag("IDs found: " . join ', ', @ids);
Test::More::diag("Max ID: " . $max);
@@ -405,7 +405,7 @@ sub resolve_rtir_ticket {
Test::More::is( $self->status, 200, "Attempting to resolve $type #$id" );
$self->content_like(
- qr/.*State changed from \w+ to resolved.*/,
+ qr/.*Status changed from \S*\w+\S* to \S*resolved.*/,
"Successfully resolved $type #$id"
);
}
@@ -447,7 +447,7 @@ sub bulk_abandon {
foreach my $id (@to_abandon) {
$self->ok_and_content_like(
- qr{<li>Ticket $id: State changed from \w+ to abandoned</li>}i,
+ qr{<li>Ticket $id: Status changed from \S*\w+\S* to \S*abandoned\S*</li>}i,
"Incident $id abandoned" );
}
diff --git a/t/002-test-reject.t b/t/002-test-reject.t
index 9bb35f4..519d0df 100644
--- a/t/002-test-reject.t
+++ b/t/002-test-reject.t
@@ -39,9 +39,8 @@ for my $id ($nobody_quick, $me_quick) {
$agent->display_ticket( $id);
$agent->follow_link_ok({text => "Quick Reject"}, "Followed 'Quick Reject' link");
- like($agent->content, qr/State changed from new to rejected/, "site says ticket got rejected");
+ like($agent->content, qr/Status changed from \S*new\S* to \S*rejected\S*/, "site says ticket got rejected");
}
-
for my $id ($nobody_slow, $me_slow) {
$agent->display_ticket( $id);
@@ -53,14 +52,13 @@ for my $id ($nobody_slow, $me_slow) {
is ($agent->status, 200, "attempt to reject succeeded");
- like($agent->content, qr/State changed from new to rejected/, "site says ticket got rejected");
+ like($agent->content, qr/Status changed from \S*new\S* to \S*rejected\S*/, "site says ticket got rejected");
}
# we need to flush the cache, or else later the status change will not be detected
use DBIx::SearchBuilder::Record::Cachable;
DBIx::SearchBuilder::Record::Cachable::FlushCache();
-
for my $id ($nobody_slow, $nobody_quick, $me_quick, $me_slow) {
my $ir_obj = RT::Ticket->new(RT::SystemUser());
$ir_obj->Load($id);
@@ -84,7 +82,7 @@ diag "test that after reject links to incidents are still there" if $ENV{'TEST_V
$agent->field(UpdateContent => "why you are rejected");
$agent->click("SubmitTicket");
is $agent->status, 200, "attempt to reject succeeded";
- $agent->ticket_state_is( $id, 'rejected' );
+ $agent->ticket_status_is( $id, 'rejected' );
{
my $tickets = RT::Tickets->new( $RT::SystemUser );
@@ -97,7 +95,7 @@ diag "test that after reject links to incidents are still there" if $ENV{'TEST_V
$agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
$agent->form_number(3);
$agent->tick( States => 'rejected' );
- $agent->click('RefineStates');
+ $agent->click('RefineStatus');
$agent->has_tag('a', "$id", 'we have link to ticket');
}
@@ -114,7 +112,7 @@ diag "test that after quick reject links to incidents are still there" if $ENV{'
$agent->display_ticket( $id);
$agent->follow_link_ok({text => "Quick Reject"}, "Followed 'Reject' link");
- $agent->ticket_state_is( $id, 'rejected' );
+ $agent->ticket_status_is( $id, 'rejected' );
{
my $tickets = RT::Tickets->new( $RT::SystemUser );
@@ -127,7 +125,7 @@ diag "test that after quick reject links to incidents are still there" if $ENV{'
$agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
$agent->form_number(3);
$agent->tick( States => 'rejected' );
- $agent->click('RefineStates');
+ $agent->click('RefineStatus');
$agent->has_tag('a', "$id", 'we have link to ticket');
}
@@ -153,7 +151,7 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
$agent->tick( SelectedTickets => $id );
$agent->click('BulkReject');
- $agent->ticket_state_is( $id, 'rejected' );
+ $agent->ticket_status_is( $id, 'rejected' );
{
my $tickets = RT::Tickets->new( $RT::SystemUser );
@@ -166,7 +164,7 @@ diag "test that after bulk reject links to incidents are still there" if $ENV{'T
$agent->follow_link_ok({text => "Incident Reports", n => 2}, "Followed 'Incident Reports' link");
$agent->form_number(3);
$agent->tick( States => 'rejected' );
- $agent->click('RefineStates');
+ $agent->click('RefineStatus');
$agent->has_tag('a', "$id", 'we have link to ticket');
}
diff --git a/t/003-resolve-IR-when-all-incidents-resolved.t b/t/003-resolve-IR-when-all-incidents-resolved.t
index 766a540..59e5195 100644
--- a/t/003-resolve-IR-when-all-incidents-resolved.t
+++ b/t/003-resolve-IR-when-all-incidents-resolved.t
@@ -25,13 +25,21 @@ ir_status('open');
$agent->display_ticket( $inc_1);
$agent->follow_link_ok({text => "Quick Resolve"}, "followed 'Quick Resolve' link for first incident");
-like($agent->content, qr/State changed from open to resolved/, "resolved the first incident");
+like(
+ $agent->content,
+ qr/Status changed from \S*open\S* to \S*resolved\S*/,
+ "resolved the first incident"
+);
ir_status('open');
$agent->display_ticket( $inc_2);
$agent->follow_link_ok({text => "Quick Resolve"}, "followed 'Quick Resolve' link for second incident");
-like($agent->content, qr/State changed from open to resolved/, "resolved the second incident");
+like(
+ $agent->content,
+ qr/Status changed from \S*open\S* to \S*resolved\S*/,
+ "resolved the second incident"
+);
ir_status('resolved');
diff --git a/t/005-resolve-investigations.t b/t/005-resolve-investigations.t
index 77d72e5..7a85725 100644
--- a/t/005-resolve-investigations.t
+++ b/t/005-resolve-investigations.t
@@ -13,7 +13,7 @@ my $inv_id = $agent->create_investigation( {Subject => "i want to quick-resolve
$agent->display_ticket( $inv_id);
$agent->follow_link_ok({text => "Quick Resolve"}, "followed 'RTFM' overview link");
-like($agent->content, qr/State changed from open to resolved/, "it got resolved");
+like($agent->content, qr/Status changed from \S*open\S* to \S*resolved\S*/, "it got resolved");
$inv_id = $agent->create_investigation( {Subject => "resolve me slower"});
@@ -27,7 +27,7 @@ $agent->click("SubmitTicket");
is ($agent->status, 200, "attempt to resolve inv succeeded");
-like($agent->content, qr/State changed from open to resolved/, "site says ticket got resolved");
+like($agent->content, qr/Status changed from \S*open\S* to \S*resolved\S*/, "site says ticket got resolved");
$agent->follow_link_ok({text => "Open"}, "Followed 'open' link");
-like($agent->content, qr/State changed from resolved to open/, "site says ticket got re-opened");
+like($agent->content, qr/Status changed from \S*resolved\S* to \S*open\S*/, "site says ticket got re-opened");
diff --git a/t/008-workflow-blocks.t b/t/008-workflow-blocks.t
index 245fe6e..7012a84 100644
--- a/t/008-workflow-blocks.t
+++ b/t/008-workflow-blocks.t
@@ -11,7 +11,7 @@ my $agent = default_agent();
my $inc_id = $agent->create_incident( {Subject => "incident with block"});
my $block_id = $agent->create_block( {Subject => "block", Incident => $inc_id});
-$agent->ticket_state_is( $block_id, 'pending activation');
+$agent->ticket_status_is( $block_id, 'pending activation');
# XXX: Comment this tests as we don't allow to create blocks without an incident
# XXX: we need test for this fact
@@ -22,26 +22,27 @@ $agent->ticket_state_is( $block_id, 'pending activation');
#$agent->ok_and_content_like( qr{$block_id.*block.*?pending activation}, 'have child link');
#
#$agent->follow_link_ok({ text => $block_id }, "Followed link back to block");
-#$agent->ticket_state_is( $block_id, 'pending activation');
+#$agent->ticket_status_is( $block_id, 'pending activation');
$agent->has_tag('a', 'Remove', 'we have Remove action');
$agent->has_tag('a', 'Quick Remove', 'we have Quick Remove action');
-my %state = (
- new => 'pending activation',
- open => 'active',
- stalled => 'pending removal',
- resolved => 'removed',
- rejected => 'removed',
-);
-
-foreach my $status( qw(open stalled resolved) ) {
+#my %state = (
+# new => 'pending activation',
+# open => 'active',
+# stalled => 'pending removal',
+# resolved => 'removed',
+# rejected => 'removed',
+#);
+#
+#foreach my $status( qw(open stalled resolved) ) {
+foreach my $status( 'pending activation', 'pending removal', 'removed' ) {
$agent->follow_link_ok({ text => "Edit" }, "Goto edit page");
$agent->form_number(3);
$agent->field(Status => $status);
$agent->click('SaveChanges');
- my $state = $state{ $status };
- $agent->ticket_state_is( $block_id, $state);
+ my $state = $status;
+ $agent->ticket_status_is( $block_id, $state);
}
diag "remove using edit";
@@ -49,14 +50,14 @@ diag "remove using edit";
$agent->follow_link_ok({ text => "Edit" }, "Goto edit page");
# Tests to make sure the unwanted option 'Use system default()' does not appear as an
- # option in the State field (a reported M3 bug)
+ # option in the Status field (a reported M3 bug)
$agent->content_unlike(qr{<option (?:value=.*)?>Use system default\(\)</option>}, "The option 'Use system default()' does not exist.");
$agent->form_number(3);
- $agent->field(Status => 'resolved');
+ $agent->field(Status => 'removed');
$agent->click('SaveChanges');
- $agent->ticket_state_is( $block_id, 'removed');
+ $agent->ticket_status_is( $block_id, 'removed');
}
diag "reactivate the block using the link";
@@ -67,7 +68,7 @@ diag "reactivate the block using the link";
$agent->form_number(3);
$agent->field( UpdateContent => 'activating block' );
$agent->click('SubmitTicket');
- $agent->ticket_state_is( $block_id, 'active');
+ $agent->ticket_status_is( $block_id, 'active');
}
diag "prepare for removing using the link";
@@ -76,20 +77,20 @@ diag "prepare for removing using the link";
$agent->follow_link_ok({ text => 'Pending Removal' }, "Prepare block for remove");
$agent->form_number(3);
$agent->click('SubmitTicket');
- $agent->ticket_state_is( $block_id, 'pending removal');
+ $agent->ticket_status_is( $block_id, 'pending removal');
}
diag "test activation after reply using 'Activate' link";
{
my $block_id = $agent->create_block( {Subject => "block", Incident => $inc_id});
- $agent->ticket_state_is( $block_id, 'pending activation');
+ $agent->ticket_status_is( $block_id, 'pending activation');
$agent->follow_link_ok({ text => 'Reply' }, "Go to reply page");
$agent->form_number(3);
$agent->field( UpdateContent => 'reply' );
$agent->click('SubmitTicket');
- $agent->ticket_state_is( $block_id, 'pending activation');
+ $agent->ticket_status_is( $block_id, 'pending activation');
$agent->follow_link_ok({ text => 'Activate' }, "activate it");
@@ -97,30 +98,29 @@ diag "test activation after reply using 'Activate' link";
$agent->field( UpdateContent => 'activating block' );
$agent->click('SubmitTicket');
- $agent->ticket_state_is( $block_id, 'active');
+ $agent->ticket_status_is( $block_id, 'active');
}
diag "test activation after reply using Edit page";
{
my $block_id = $agent->create_block( {Subject => "block", Incident => $inc_id});
- $agent->ticket_state_is( $block_id, 'pending activation');
+ $agent->ticket_status_is( $block_id, 'pending activation');
$agent->follow_link_ok({ text => 'Reply' }, "Go to reply page");
$agent->form_number(3);
$agent->field( UpdateContent => 'reply' );
$agent->click('SubmitTicket');
- $agent->ticket_state_is( $block_id, 'pending activation');
+ $agent->ticket_status_is( $block_id, 'pending activation');
$agent->follow_link_ok({ text => "Edit" }, "Goto edit page");
$agent->form_number(3);
- $agent->field(Status => 'open');
+ $agent->field(Status => 'active');
$agent->click('SaveChanges');
- $agent->ticket_state_is( $block_id, 'active');
+ $agent->ticket_status_is( $block_id, 'active');
}
-
my $re = RT->Config->Get('RTIR_BlockAproveActionRegexp');
SKIP: {
@@ -132,7 +132,7 @@ SKIP: {
Incident => $inc_id,
Requestors => 'rt-test at example.com',
} );
- $agent->ticket_state_is( $block_id, 'pending activation');
+ $agent->ticket_status_is( $block_id, 'pending activation');
{
my $text = <<EOF;
@@ -145,7 +145,7 @@ EOF
my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
is $status >> 8, 0, "The mail gateway exited ok";
is $id, $block_id, "replied to the ticket";
- $agent->ticket_state_is( $block_id, 'active');
+ $agent->ticket_status_is( $block_id, 'active');
}
{
@@ -154,7 +154,7 @@ EOF
$agent->form_number(3);
$agent->field( UpdateContent => 'going to remove' );
$agent->click('SubmitTicket');
- $agent->ticket_state_is( $block_id, 'pending removal');
+ $agent->ticket_status_is( $block_id, 'pending removal');
}
{
@@ -168,7 +168,7 @@ EOF
my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
is $status >> 8, 0, "The mail gateway exited ok";
is $id, $block_id, "replied to the ticket";
- $agent->ticket_state_is( $block_id, 'removed');
+ $agent->ticket_status_is( $block_id, 'removed');
}
}
@@ -181,7 +181,7 @@ SKIP: {
Incident => $inc_id,
Requestors => 'rt-test at example.com',
} );
- $agent->ticket_state_is( $block_id, 'pending activation');
+ $agent->ticket_status_is( $block_id, 'pending activation');
{
my $text = <<EOF;
@@ -194,7 +194,7 @@ EOF
my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
is $status >> 8, 0, "The mail gateway exited ok";
is $id, $block_id, "replied to the ticket";
- $agent->ticket_state_is( $block_id, 'pending activation');
+ $agent->ticket_status_is( $block_id, 'pending activation');
}
{
@@ -209,7 +209,7 @@ EOF
my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
is $status >> 8, 0, "The mail gateway exited ok";
is $id, $block_id, "replied to the ticket";
- $agent->ticket_state_is( $block_id, 'active');
+ $agent->ticket_status_is( $block_id, 'active');
}
{
@@ -218,7 +218,7 @@ EOF
$agent->form_number(3);
$agent->field( UpdateContent => 'going to remove' );
$agent->click('SubmitTicket');
- $agent->ticket_state_is( $block_id, 'pending removal');
+ $agent->ticket_status_is( $block_id, 'pending removal');
}
{
@@ -232,7 +232,7 @@ EOF
my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
is $status >> 8, 0, "The mail gateway exited ok";
is $id, $block_id, "replied to the ticket";
- $agent->ticket_state_is( $block_id, 'pending removal');
+ $agent->ticket_status_is( $block_id, 'pending removal');
}
{
@@ -247,7 +247,7 @@ EOF
my ($status, $id) = RT::Test->send_via_mailgate($text, queue => 'Blocks');
is $status >> 8, 0, "The mail gateway exited ok";
is $id, $block_id, "replied to the ticket";
- $agent->ticket_state_is( $block_id, 'removed');
+ $agent->ticket_status_is( $block_id, 'removed');
}
}
diff --git a/t/010-bulk-reject.t b/t/010-bulk-reject.t
index 5050a27..76c8d50 100644
--- a/t/010-bulk-reject.t
+++ b/t/010-bulk-reject.t
@@ -36,8 +36,8 @@ $agent->get_ok('/RTIR/index.html', 'open rtir at glance');
$agent->tick('SelectedTickets', $irs[0]);
$agent->tick('SelectedTickets', $irs[2]);
$agent->click('BulkReject');
- $agent->ok_and_content_like( qr{Ticket $irs[0]: State changed from \w+ to rejected}, 'reject notice');
- $agent->ok_and_content_like( qr{Ticket $irs[2]: State changed from \w+ to rejected}, 'reject notice');
+ $agent->ok_and_content_like( qr{Ticket $irs[0]: Status changed from \S*\w+\S* to \S*rejected\S*}, 'reject notice');
+ $agent->ok_and_content_like( qr{Ticket $irs[2]: Status changed from \S*\w+\S* to \S*rejected\S*}, 'reject notice');
$agent->form_number(3);
ok($agent->value('BulkReject'), 'still on reject page');
@@ -54,11 +54,11 @@ $agent->get_ok('/RTIR/index.html', 'open rtir at glance');
$agent->tick('SelectedTickets', $irs[1]);
$agent->tick('SelectedTickets', $irs[3]);
$agent->click('BulkRejectAndReturn');
- $agent->ok_and_content_like( qr{Ticket $irs[1]: State changed from new to rejected}, 'reject notice');
- $agent->ok_and_content_like( qr{Ticket $irs[3]: State changed from new to rejected}, 'reject notice');
+ $agent->ok_and_content_like( qr{Ticket $irs[1]: Status changed from \S*new\S* to \S*rejected\S*}, 'reject notice');
+ $agent->ok_and_content_like( qr{Ticket $irs[3]: Status changed from \S*new\S* to \S*rejected\S*}, 'reject notice');
$agent->ok_and_content_like( qr{New unlinked Incident Reports}, 'we are on the main page');
}
foreach( @irs ) {
- $agent->ticket_state_is( $_, 'rejected', "Ticket #$_ is rejected" );
+ $agent->ticket_status_is( $_, 'rejected', "Ticket #$_ is rejected" );
}
diff --git a/t/011-merge.t b/t/011-merge.t
index ba50b90..90489ce 100644
--- a/t/011-merge.t
+++ b/t/011-merge.t
@@ -36,7 +36,7 @@ diag "merge an IR into a linked IR, the product should have open state"
my $inc_id = $agent->create_incident( {Subject => "base inc for merging"});
my $ir1_id = $agent->create_ir( {Subject => "ir1 for merging", Incident => $inc_id});
$agent->ok_and_content_like( qr{Incident:.*$inc_id}ms, 'Created linked IR');
- $agent->ticket_state_is( $ir1_id, 'open' );
+ $agent->ticket_status_is( $ir1_id, 'open' );
my $ir2_id = $agent->create_ir( {Subject => "ir2 for merging"});
$agent->display_ticket( $ir2_id);
@@ -55,7 +55,7 @@ diag "merge an IR into a linked IR, the product should have open state"
$agent->display_ticket( $ir2_id);
$agent->ok_and_content_like( qr{Incident Report #$ir1_id:}, 'Second id points to the ticket we merged into');
- $agent->ticket_state_is( $ir2_id, 'open' );
+ $agent->ticket_status_is( $ir2_id, 'open' );
}
{ # as previouse but with reversed merge operation
@@ -64,7 +64,7 @@ diag "merge an IR into a linked IR, the product should have open state"
my $inc_id = $agent->create_incident( {Subject => "base inc for merging"});
my $ir2_id = $agent->create_ir( {Subject => "ir2 for merging", Incident => $inc_id});
$agent->ok_and_content_like( qr{Incident:.*$inc_id}ms, 'Created linked IR');
- $agent->ticket_state_is( $ir2_id, 'open' );
+ $agent->ticket_status_is( $ir2_id, 'open' );
$agent->display_ticket( $ir2_id);
@@ -81,7 +81,7 @@ diag "merge an IR into a linked IR, the product should have open state"
$agent->display_ticket( $ir1_id);
$agent->ok_and_content_like( qr{Incident Report #$ir1_id:}, 'Opened the merged ticket');
- $agent->ticket_state_is( $ir1_id, 'open' );
+ $agent->ticket_status_is( $ir1_id, 'open' );
}
{ # merge two IRs that are linked to different Incidents
diff --git a/t/016-date-started.t b/t/016-date-started.t
index 3ada8cd..6344a96 100644
--- a/t/016-date-started.t
+++ b/t/016-date-started.t
@@ -27,7 +27,7 @@ diag "started date of an IR" if $ENV{'TEST_VERBOSE'};
{
my $ir_id = $agent->create_ir( {Subject => "started date"});
$agent->display_ticket( $ir_id);
- sleep 5;
+ sleep 1;
my $inc_id = $agent->create_incident_for_ir( $ir_id, {Subject => "started date"} );
my $inc = RT::Ticket->new( $RT::SystemUser );
diff --git a/t/incident/abandon.t b/t/incident/abandon.t
index 7158c9b..ec63f58 100644
--- a/t/incident/abandon.t
+++ b/t/incident/abandon.t
@@ -15,7 +15,7 @@ diag "abandon unlinked incident" if $ENV{'TEST_VERBOSE'};
$agent->content_like(qr/Warning: no recipients!/mi, 'no recipients warning on the page');
$agent->form_number(3);
$agent->click('SubmitTicket');
- is $agent->ticket_state( $id), 'abandoned', 'abandoned incident';
+ is $agent->ticket_status( $id), 'abandoned', 'abandoned incident';
}
diag "abandon unlinked incident, but enter a message during abandoning" if $ENV{'TEST_VERBOSE'};
@@ -26,7 +26,7 @@ diag "abandon unlinked incident, but enter a message during abandoning" if $ENV{
$agent->form_number(3);
$agent->field( UpdateContent => 'abandoning' );
$agent->click('SubmitTicket');
- is $agent->ticket_state( $id), 'abandoned', 'abandoned incident';
+ is $agent->ticket_status( $id), 'abandoned', 'abandoned incident';
}
diag "simple abandon incident with IR" if $ENV{'TEST_VERBOSE'};
@@ -38,8 +38,8 @@ diag "simple abandon incident with IR" if $ENV{'TEST_VERBOSE'};
$agent->content_unlike(qr/Warning: no recipients!/mi, 'have no "no recipients" warning on the page');
$agent->form_number(3);
$agent->click('SubmitTicket');
- is $agent->ticket_state( $inc_id), 'abandoned', 'abandoned incident';
- is $agent->ticket_state( $ir_id), 'rejected', 'rejected ir';
+ is $agent->ticket_status( $inc_id), 'abandoned', 'abandoned incident';
+ is $agent->ticket_status( $ir_id), 'rejected', 'rejected ir';
}
diag "abandon incident with resolved IR" if $ENV{'TEST_VERBOSE'};
@@ -47,13 +47,13 @@ diag "abandon incident with resolved IR" if $ENV{'TEST_VERBOSE'};
my $inc_id = $agent->create_incident( { Subject => "test" } );
my $ir_id = $agent->create_ir( { Subject => "test", Incident => $inc_id } );
$agent->follow_link( text => 'Quick Resolve' );
- is $agent->ticket_state( $ir_id), 'resolved', 'resolved ir';
+ is $agent->ticket_status( $ir_id), 'resolved', 'resolved ir';
$agent->goto_ticket( $inc_id );
$agent->follow_link( text => 'Abandon' );
$agent->form_number(3);
$agent->click('SubmitTicket');
- is $agent->ticket_state( $inc_id), 'abandoned', 'abandoned incident';
- is $agent->ticket_state( $ir_id), 'resolved', 'resolved ir';
+ is $agent->ticket_status( $inc_id), 'abandoned', 'abandoned incident';
+ is $agent->ticket_status( $ir_id), 'resolved', 'resolved ir';
}
diff --git a/t/incident/bulk-abandon.t b/t/incident/bulk-abandon.t
index 90985ce..f05e93a 100644
--- a/t/incident/bulk-abandon.t
+++ b/t/incident/bulk-abandon.t
@@ -60,14 +60,14 @@ $agent->resolve_rtir_ticket( $invests[0], 'Investigation');
$agent->bulk_abandon( @incident_ids);
foreach my $id (@incident_ids) {
- $agent->ticket_state_is( $id, 'abandoned', "Incident $id is abandoned");
+ $agent->ticket_status_is( $id, 'abandoned', "Incident $id is abandoned");
}
foreach my $id (@ir_ids ) {
- diag("IR #$id state is " . $agent->ticket_state( $id)) if($ENV{'TEST_VERBOSE'});
+ diag("IR #$id state is " . $agent->ticket_status( $id)) if($ENV{'TEST_VERBOSE'});
}
foreach my $id (@invests) {
- diag("IR #$id state is " . $agent->ticket_state( $id)) if($ENV{'TEST_VERBOSE'});
+ diag("IR #$id state is " . $agent->ticket_status( $id)) if($ENV{'TEST_VERBOSE'});
}
commit 72e900feb972f8ed2335aeea9977fe259bcd1b38
Author: sunnavy <sunnavy at bestpractical.com>
Date: Thu Oct 7 14:16:07 2010 +0800
EditState componenct is not needed
diff --git a/html/RTIR/Block/Elements/EditState b/html/RTIR/Block/Elements/EditState
deleted file mode 100644
index 5055737..0000000
--- a/html/RTIR/Block/Elements/EditState
+++ /dev/null
@@ -1,21 +0,0 @@
-<& /Widgets/Form/Select,
- Name => 'Status',
- Default => 0,
- Values => [qw(new open stalled resolved)],
- ValuesLabel => {
- new => loc('pending activation'),
- open => loc('active'),
- stalled => loc('pending removal'),
- resolved => loc('removed'),
- },
- CurrentValue => $Default,
-&>
-<%ARGS>
-$TicketObj => undef
-$Default => undef
-</%ARGS>
-<%INIT>
-if ( $Default eq 'open' ) {
- $Default = 'new' unless $TicketObj->FirstCustomFieldValue('State') eq 'active';
-}
-</%INIT>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list