[Rt-commit] [rtir] 10/24: Further conversion of ActiveQuery and friends to lifecycles
Jesse Vincent
jesse at bestpractical.com
Mon Feb 9 00:25:19 EST 2015
This is an automated email from the git hooks/post-receive script.
jesse pushed a commit to branch 3.4/remove_old_constituencies
in repository rtir.
commit 9023a35cb60a27ae8b492b8394fc9d868a4afc07
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Fri Feb 6 16:55:27 2015 -0800
Further conversion of ActiveQuery and friends to lifecycles
---
html/RTIR/Elements/DueIncidents | 8 ++++----
html/RTIR/Elements/NobodyDueIncidents | 2 +-
html/RTIR/Elements/UserDueIncidents | 2 +-
html/RTIR/Incident/BulkAbandon.html | 8 ++++----
html/RTIR/Link/FromIncident/index.html | 12 ++++++------
html/RTIR/Report/BulkReject.html | 10 +++++-----
html/RTIR/Search/Reporting.html | 8 ++++----
html/RTIR/Search/Results.html | 15 +++++++--------
8 files changed, 32 insertions(+), 33 deletions(-)
diff --git a/html/RTIR/Elements/DueIncidents b/html/RTIR/Elements/DueIncidents
index 1cf8aee..35d2884 100644
--- a/html/RTIR/Elements/DueIncidents
+++ b/html/RTIR/Elements/DueIncidents
@@ -49,12 +49,12 @@
Description => loc('Due Incidents')
</%ATTR>
<&| /Widgets/TitleBox,
- title_href => RT->Config->Get('WebPath') ."/RTIR/Search/Results.html?Queue=Incidents&$QueryString",
+ title_href => RT->Config->Get('WebPath') ."/RTIR/Search/Results.html?Lifecycle=incidents&$QueryString",
title => $Title,
&>
<& /RTIR/Search/Elements/ShowResults,
- Queue => 'Incidents',
+ Lifecycle => 'incidents',
BaseQuery => $BaseQuery,
Query => $Query,
Format => $Format,
@@ -86,8 +86,8 @@ my $QueryString = $m->comp('/Elements/QueryString',
</%INIT>
<%ARGS>
$Title => loc("Most due incidents")
-$BaseQuery => RT::IR->Query( Queue => 'Incidents' )
-$Query => RT::IR->ActiveQuery( Queue => 'Incidents' )
+$BaseQuery => RT::IR->Query( Lifecycle => 'incidents' )
+$Query => RT::IR->ActiveQuery( Lifecycle => 'incidents' )
$Format => RT->Config->Get('RTIRSearchResultFormats')->{'DueIncidents'}
$Rows => undef
$Page => 1
diff --git a/html/RTIR/Elements/NobodyDueIncidents b/html/RTIR/Elements/NobodyDueIncidents
index c48b239..b979e42 100644
--- a/html/RTIR/Elements/NobodyDueIncidents
+++ b/html/RTIR/Elements/NobodyDueIncidents
@@ -48,7 +48,7 @@
<& /RTIR/Elements/DueIncidents, %ARGS, Title => $Title, Query => $Query &>
<%INIT>
my $Title = loc( "Most due unowned incidents" );
-$Query ||= RT::IR->ActiveQuery( Queue => 'Incidents', And => 'Owner.id = '. $RT::Nobody->id );
+$Query ||= RT::IR->ActiveQuery( Lifecycle => 'incidents', And => 'Owner.id = '. $RT::Nobody->id );
$m->callback( CallbackName => 'ModifyQuery', Query => \$Query );
</%INIT>
<%ARGS>
diff --git a/html/RTIR/Elements/UserDueIncidents b/html/RTIR/Elements/UserDueIncidents
index 761cd02..f2acfca 100644
--- a/html/RTIR/Elements/UserDueIncidents
+++ b/html/RTIR/Elements/UserDueIncidents
@@ -48,7 +48,7 @@
<& /RTIR/Elements/DueIncidents, %ARGS, Title => $Title, Query => $Query &>
<%INIT>
my $Title = loc( "Most due incidents owned by [_1]", $Owner->Name );
-$Query ||= RT::IR->ActiveQuery( Queue => 'Incidents', And => 'Owner.id = '. $Owner->id );
+$Query ||= RT::IR->ActiveQuery( Lifecycle => 'incidents', And => 'Owner.id = '. $Owner->id );
$m->callback( CallbackName => 'ModifyQuery', Query => \$Query );
</%INIT>
<%ARGS>
diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index 960b0f3..ed087f4 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -58,9 +58,9 @@
<%PERL>
my $found = $m->comp('/RTIR/Search/Elements/ShowResults',
- Queue => 'Incidents',
+ Lifecycle => 'incidents',
BaseURL => 'RTIR/Incident/BulkAbandon.html',
- BaseQuery => RT::IR->ActiveQuery( Queue => 'Incidents' ),
+ BaseQuery => RT::IR->ActiveQuery( Lifecycle => 'incidents' ),
Query => $Query,
DisplayFormat => "__CheckBox__, $Format",
Format => $Format,
@@ -120,7 +120,7 @@ if ( $ARGS{'BulkAbandon'} ) {
}
$id = $t->id;
- unless( $t->QueueObj->Name eq 'Incidents' ) {
+ unless( $t->QueueObj->Lifecycle eq 'incidents' ) {
push @tempresults, [ $id, loc("Is not incident.") ];
next;
}
@@ -128,7 +128,7 @@ if ( $ARGS{'BulkAbandon'} ) {
# process replies
if ( @ReplyToAll ) {
my $children = RT::IR->IncidentChildren(
- $t, Queue => \@ReplyToAll, Initial => 1, Active => 1,
+ $t, Lifecycle => \@ReplyToAll, Initial => 1, Active => 1,
);
while ( my $child = $children->Next ) {
push @tempresults, ProcessUpdateMessage(
diff --git a/html/RTIR/Link/FromIncident/index.html b/html/RTIR/Link/FromIncident/index.html
index cf1a21f..810bc23 100644
--- a/html/RTIR/Link/FromIncident/index.html
+++ b/html/RTIR/Link/FromIncident/index.html
@@ -59,7 +59,7 @@
<input type="hidden" name="BulkLink" value="1" />
<& /RTIR/Search/Elements/ShowResults,
- Queue => $Queue,
+ Lifecycle => $Lifecycle,
BaseQuery => $BaseQuery,
Query => $Query,
DisplayFormat => "__CheckBox__, $Format",
@@ -77,9 +77,9 @@
<%ARGS>
$id => undef
-$Queue => undef
+$Lifecycle => undef
-$Query => RT::IR->ActiveQuery( Queue => $Queue )
+$Query => RT::IR->ActiveQuery( Lifecycle => $Lifecycle )
$Format => RT->Config->Get('RTIRSearchResultFormats')->{'LinkChildren'}
$Rows => 50
$Page => 1
@@ -91,15 +91,15 @@ $Order => RT->Config->Get('DefaultSearchResultOrder')
my $IncidentObj = LoadTicket($id);
$ARGS{'id'} = $id = $IncidentObj->id;
-my $Type = RT::IR::TicketType( Queue => $Queue );
+my $Type = RT::IR::TicketType( Lifecycle => $Lifecycle );
my $title = loc("Link selected [_1] to Incident #[_2]", $Type, $id);
my $BaseQuery = RT::IR->Query(
- Queue => $Queue,
+ Lifecycle => $Lifecycle,
NotMemberOf => $id,
);
my $base_url = 'RTIR/Link/FromIncident/?'
- . $m->comp( '/Elements/QueryString', id => $id, Queue => $Queue );
+ . $m->comp( '/Elements/QueryString', id => $id, Lifecycle => $Lifecycle );
</%INIT>
diff --git a/html/RTIR/Report/BulkReject.html b/html/RTIR/Report/BulkReject.html
index 9e6b6fb..991edf4 100644
--- a/html/RTIR/Report/BulkReject.html
+++ b/html/RTIR/Report/BulkReject.html
@@ -61,9 +61,9 @@
<%PERL>
my $found = $m->comp( '/RTIR/Search/Elements/ShowResults',
- Queue => $Queue,
+ Lifecycle => $Lifecycle,
BaseURL => $BaseURL,
- BaseQuery => RT::IR->ActiveQuery( Queue => $Queue ),
+ BaseQuery => RT::IR->ActiveQuery( Lifecycle => $Lifecycle ),
Query => $Query,
DisplayFormat => "__CheckBox__, $Format",
Format => $Format,
@@ -157,18 +157,18 @@ if ( $BulkReject ) {
Arguments => {
map { $_ => $ARGS{ $_ } }
grep defined $ARGS{ $_ } && length $ARGS{ $_ },
- qw(Status Queue Query Format Rows Page OrderBy Order)
+ qw(Status Lifecycle Query Format Rows Page OrderBy Order)
},
);
}
my $BaseURL = "RTIR/Report/BulkReject.html?"
- . $m->comp('/Elements/QueryString', Queue => $Queue);
+ . $m->comp('/Elements/QueryString', Lifecycle => $Lifecycle);
</%INIT>
<%ARGS>
$Status => 'rejected'
-$Queue => 'Incident Reports'
+$Lifecycle => 'incident_reports'
$Query => ''
$Format => RT->Config->Get('RTIRSearchResultFormats')->{'RejectReports'}
diff --git a/html/RTIR/Search/Reporting.html b/html/RTIR/Search/Reporting.html
index 23cbf90..744df9f 100644
--- a/html/RTIR/Search/Reporting.html
+++ b/html/RTIR/Search/Reporting.html
@@ -54,7 +54,7 @@
% }
<form method="get" action="<% RT->Config->Get('WebPath') %>/RTIR/Search/Reporting.html">
-% my %hiddens = (Queue => $Queue, Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order);
+% my %hiddens = (Lifecycle => $Lifecycle, Query => $Query, Format => $Format, Rows => $Rows, OrderBy => $OrderBy, Order => $Order);
% while ( my ($key, $val) = each %hiddens ) {
% next unless defined $val;
<input type="hidden" class="hidden" name="<% $key %>" value="<% $val %>" />
@@ -142,10 +142,10 @@ $Description => undef
$Width => undef
$Height => undef
-$Queue => ''
+$Lifecycle => ''
-$BaseQuery => RT::IR->Query( Queue => $Queue )
-$Query => RT::IR->ActiveQuery( Queue => $Queue )
+$BaseQuery => RT::IR->Query( Lifecycle => $Lifecycle )
+$Query => RT::IR->ActiveQuery( Lifecycle => $Lifecycle )
$Format => undef
$Rows => 50
$Page => 1
diff --git a/html/RTIR/Search/Results.html b/html/RTIR/Search/Results.html
index ced3290..faa62b0 100644
--- a/html/RTIR/Search/Results.html
+++ b/html/RTIR/Search/Results.html
@@ -51,7 +51,7 @@
<& Elements/ShowResults,
%ARGS,
- Queue => $Queue,
+ Lifecycle => $Lifecycle,
BaseURL => $BaseURL,
BaseQuery => $BaseQuery,
Query => $Query,
@@ -68,7 +68,7 @@
<%INIT>
my $title = loc("Results");
-my $Type = RT::IR::TicketType( Queue => $Queue ) || '';
+my $Type = RT::IR::TicketType( Lifecycle => $Lifecycle ) || '';
$Format ||= RT->Config->Get('RTIRSearchResultFormats')->{ $Type . 'Default' };
# Warn if old CFs are found
@@ -83,16 +83,16 @@ RT::IR::Config::CheckObsoleteCFSyntax($Query,$location);
if ( $Type ) {
if ( $Query ) {
- $BaseQuery ||= RT::IR->Query( Queue => $Queue );
+ $BaseQuery ||= RT::IR->Query( Lifecycle => $Lifecycle );
}
else {
- $Query = RT::IR->ActiveQuery( Queue => $Queue );
+ $Query = RT::IR->ActiveQuery( Lifecycle => $Lifecycle );
}
}
my $BaseURL = "RTIR/Search/Results.html";
-$BaseURL .= '?'. $m->comp( '/Elements/QueryString', Queue => $Queue )
- if $Queue;
+$BaseURL .= '?'. $m->comp( '/Elements/QueryString', Lifecycle => $Lifecycle )
+ if $Lifecycle;
# Read from user preferences
my $prefs = $session{'CurrentUser'}->UserObj->Preferences("SearchDisplay") || {};
@@ -114,8 +114,7 @@ if ( !defined($Rows) ) {
</%INIT>
<%ARGS>
-$Queue => ''
-
+$Lifecycle => ''
$BaseQuery => ''
$Query => undef
$Format => undef
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the rt-commit
mailing list