[Rt-commit] rtir branch, 2.9-trunk, updated. 2.6.1rc1-394-g97ee90a
Ruslan Zakirov
ruz at bestpractical.com
Sun Sep 25 06:23:34 EDT 2011
The branch, 2.9-trunk has been updated
via 97ee90aa635f18933115914c54d581642a740143 (commit)
via 74f3debf85263e958b2c490b40189fdf7866fe13 (commit)
via 459e710133f753eea2b8d9664aea496427e64fa4 (commit)
via 4d21de79ca3a29a210331f9265de3390b20df55a (commit)
from 7131a78befe173de596288e7ed3824c9dab76296 (commit)
Summary of changes:
TODO.porting_over_RT4 | 19 +++++++++++++++++++
html/RTIR/Advanced.html | 18 ++++++++++++------
html/RTIR/Edit.html | 18 +++++++++++++-----
html/RTIR/Forward.html | 5 +++++
html/RTIR/Incident/BulkAbandon.html | 12 ++++++++----
html/RTIR/Incident/Create.html | 11 ++++-------
html/RTIR/Incident/Reply/index.html | 8 +++++---
html/RTIR/Link/FromIncident/index.html | 2 +-
html/RTIR/Merge/index.html | 10 ++++------
html/RTIR/Prefs/Home.html | 1 +
html/RTIR/Report/BulkReject.html | 18 +++++++++++++-----
html/RTIR/Tools/ScriptedAction.html | 10 +++++++++-
12 files changed, 94 insertions(+), 38 deletions(-)
- Log -----------------------------------------------------------------
commit 4d21de79ca3a29a210331f9265de3390b20df55a
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Sep 24 02:39:05 2011 +0400
send form to proper place, use POST
we moved page and forgot to update action
diff --git a/html/RTIR/Link/FromIncident/index.html b/html/RTIR/Link/FromIncident/index.html
index 0cd09f3..c756a5c 100644
--- a/html/RTIR/Link/FromIncident/index.html
+++ b/html/RTIR/Link/FromIncident/index.html
@@ -25,7 +25,7 @@
<& /RTIR/Elements/Header, Title => $title &>
<& /Elements/Tabs &>
-<form action="Display.html" method="get">
+<form action="<% RT->Config->Get('WebPath') %>/RTIR/Incident/Display.html" method="post">
<input type="hidden" name="id" value="<% $id %>" />
<input type="hidden" name="BulkLink" value="1" />
commit 459e710133f753eea2b8d9664aea496427e64fa4
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Sep 24 02:41:10 2011 +0400
update TODO
diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index e751c6c..f632a0c 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -25,3 +25,7 @@
* stop abusing $session{'tickets'} so we can get working
First, Prev, Next and Last links in RTIR.
+
+=== TESTS
+
+There is no single test for .../Link/FromIncident/index.html
commit 74f3debf85263e958b2c490b40189fdf7866fe13
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Sep 24 13:47:43 2011 +0400
update TODO
diff --git a/TODO.porting_over_RT4 b/TODO.porting_over_RT4
index f632a0c..05f28e7 100644
--- a/TODO.porting_over_RT4
+++ b/TODO.porting_over_RT4
@@ -18,6 +18,16 @@
page comes first to mind
* scan code for hardcoded statuses
+** html/RTIR/Tools/ScriptedAction.html uses open, probably it should
+ be deleted, we create new investigations and incidents with First
+ available status
+
+=== FIX
+
+* html/RTIR/Search/Reporting.html still uses old tabs
+
+* html/RTIR/Search/Results.html has results argument
+ that is passed into ListActions, get rid of it
=== CLEANUP && REFACTORING
@@ -26,6 +36,11 @@
* stop abusing $session{'tickets'} so we can get working
First, Prev, Next and Last links in RTIR.
+* code for getting default whois server is repeated
+
=== TESTS
-There is no single test for .../Link/FromIncident/index.html
+There is no single test for:
+ .../Link/FromIncident/index.html
+ .../Search/Reporting.html
+
commit 97ee90aa635f18933115914c54d581642a740143
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Sep 24 14:43:57 2011 +0400
Use MaybeRedirect for most actions
diff --git a/html/RTIR/Advanced.html b/html/RTIR/Advanced.html
index 0251bba..5211979 100644
--- a/html/RTIR/Advanced.html
+++ b/html/RTIR/Advanced.html
@@ -70,13 +70,19 @@ if ( $ARGS{'SaveChanges'} ) {
push @results, ProcessTicketBasics( TicketObj => $Ticket, ARGSRef => \%ARGS);
push @results, ProcessTicketLinks( TicketObj => $Ticket, ARGSRef => \%ARGS);
- if ( RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
- push @{ $session{"Actions"}{''} ||= [] }, @results;
- $session{'i'}++;
+ $m->callback(
+ CallbackName => 'AfterProcessing',
+ ARGSRef => \%ARGS, Ticket => $Ticket, results => \@results,
+ );
- $m->comp("/RTIR/Display.html", %ARGS);
- return;;
- }
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'})
+ ? "/RTIR/Display.html"
+ : "/RTIR/Advanced.html"
+ ,
+ Arguments => { id => $Ticket->id },
+ );
}
unless ($Ticket->CurrentUserHasRight('ShowTicket')) {
diff --git a/html/RTIR/Edit.html b/html/RTIR/Edit.html
index 82c5beb..d8fb170 100644
--- a/html/RTIR/Edit.html
+++ b/html/RTIR/Edit.html
@@ -198,11 +198,19 @@ if ( $SaveChanges && !$checks_failure && !$OnlySearchForPeople ) {
push @results, ProcessTicketCustomFieldUpdates( ARGSRef => \%ARGS );
- if ( RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'}) ) {
- $m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Ticket => $Ticket);
- push @{ $session{'Actions'}{''} ||= [] }, @results;
- return $m->comp("/RTIR/Display.html", %ARGS, id => $id);
- }
+ $m->callback(
+ CallbackName => 'AfterProcessing',
+ ARGSRef => \%ARGS, Ticket => $Ticket, results => \@results,
+ );
+
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => RT->Config->Get('DisplayAfterEdit', $session{'CurrentUser'})
+ ? "/RTIR/Display.html"
+ : "/RTIR/Edit.html"
+ ,
+ Arguments => { id => $id },
+ );
}
my $name;
diff --git a/html/RTIR/Forward.html b/html/RTIR/Forward.html
index b47fb64..390de22 100644
--- a/html/RTIR/Forward.html
+++ b/html/RTIR/Forward.html
@@ -46,6 +46,11 @@ if ( $ARGS{'Forward'} ) {
require RT::Interface::Email;
my ($status, $msg) = RT::Interface::Email::ForwardTransaction( $txn, %ARGS );
push @results, $msg;
+
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Arguments => { id => $Ticket->id, QuoteTransaction => $QuoteTransaction },
+ );
}
my $Title = loc('Forward message');
diff --git a/html/RTIR/Incident/BulkAbandon.html b/html/RTIR/Incident/BulkAbandon.html
index 79ffc1d..3f1a7b2 100644
--- a/html/RTIR/Incident/BulkAbandon.html
+++ b/html/RTIR/Incident/BulkAbandon.html
@@ -93,8 +93,6 @@ if ( $ARGS{'BulkAbandon'} ) {
my @tempresults;
foreach my $id ( @SelectedTickets ) {
- $m->out('<!-- Processing <% $t->id %> -->'); $m->flush_buffer;
-
my $t = RT::Ticket->new( $session{'CurrentUser'} );
$t->Load( $id );
unless( $t->id ) {
@@ -151,8 +149,14 @@ if ( $ARGS{'BulkAbandon'} ) {
map { ref($_)? loc( "Ticket [_1]: [_2]", $_->[0], $_->[1] ): $_ }
@tempresults;
- # force redo search if we changed tickets
- $session{'tickets'}->RedoSearch if $session{'tickets'};
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Arguments => {
+ map { $_ => $ARGS{ $_ } }
+ grep defined $ARGS{ $_ } && length $ARGS{ $_ },
+ qw(Query Format Rows Page OrderBy Order)
+ },
+ );
}
</%INIT>
diff --git a/html/RTIR/Incident/Create.html b/html/RTIR/Incident/Create.html
index 12331b8..a8f8155 100644
--- a/html/RTIR/Incident/Create.html
+++ b/html/RTIR/Incident/Create.html
@@ -416,13 +416,10 @@ if ( !$checks_failure && $CreateIncident ) {
if( $inc_obj ) {
$m->callback(CallbackName => 'BeforeDisplay', ARGSRef => \%ARGS, Child => $ChildObj);
- my $key = Digest::MD5::md5_hex( rand(1024) );
- push @{ $session{"Actions"}{ $key } ||= [] }, @results;
- $session{'i'}++;
- RT::Interface::Web::Redirect(
- RT->Config->Get('WebURL')
- ."RTIR/Incident/Display.html?id=". $inc_obj->id
- ."&results=$key"
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => "/RTIR/Incident/Display.html",
+ Arguments => { id => $inc_obj->id },
);
}
}
diff --git a/html/RTIR/Incident/Reply/index.html b/html/RTIR/Incident/Reply/index.html
index b1c78b6..50e03df 100644
--- a/html/RTIR/Incident/Reply/index.html
+++ b/html/RTIR/Incident/Reply/index.html
@@ -181,9 +181,11 @@ if ( $SubmitTicket && !$checks_failure ) {
PassArguments => $pass,
Ticket => $IncidentObj
);
- push @{ $session{'Actions'}{''} ||= [] }, @results;
- # NOTE: don't pass %ARGS further as we've done everything we need here
- return $m->comp("../Display.html", %$pass, id => $id);
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => "/RTIR/Incident/Display.html",
+ Arguments => { %$pass, id => $id },
+ );
}
# XXX, BLOODY-DIRTY-EVIL HACK: when we load the page first time we should
diff --git a/html/RTIR/Merge/index.html b/html/RTIR/Merge/index.html
index 08b64a0..0323932 100644
--- a/html/RTIR/Merge/index.html
+++ b/html/RTIR/Merge/index.html
@@ -107,12 +107,10 @@ if ( $MergeTicket && !$checks_failure ) {
$Ticket = LoadTicket($id);
- 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=". $Ticket->id
- ."&results=$key"
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => "/RTIR/Display.html",
+ Arguments => { id => $Ticket->id },
);
}
diff --git a/html/RTIR/Prefs/Home.html b/html/RTIR/Prefs/Home.html
index bf13a2e..18122b2 100644
--- a/html/RTIR/Prefs/Home.html
+++ b/html/RTIR/Prefs/Home.html
@@ -87,4 +87,5 @@ foreach my $pane ( sort keys %$portlets ) {
$m->comp ('/Widgets/SelectionBox:process', %ARGS, self => $_, nojs => 1) for @boxes;
+MaybeRedirectForResults( Actions => \@results );
</%INIT>
diff --git a/html/RTIR/Report/BulkReject.html b/html/RTIR/Report/BulkReject.html
index 270ae73..b43ebec 100644
--- a/html/RTIR/Report/BulkReject.html
+++ b/html/RTIR/Report/BulkReject.html
@@ -122,13 +122,21 @@ if ( $BulkReject ) {
$session{'tickets'}->RedoSearch if $session{'tickets'};
if ( $BulkRejectAndReturn ) {
- my $key = Digest::MD5::md5_hex( rand(1024) );
- push @{ $session{"Actions"}{ $key } ||= [] }, @results;
- $session{'i'}++;
- return RT::Interface::Web::Redirect(
- RT->Config->Get('WebURL') ."/RTIR/index.html?results=".$key
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => '/RTIR/',
+ Force => 1,
);
}
+
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Arguments => {
+ map { $_ => $ARGS{ $_ } }
+ grep defined $ARGS{ $_ } && length $ARGS{ $_ },
+ qw(Status Queue Query Format Rows Page OrderBy Order)
+ },
+ );
}
my $BaseURL = "RTIR/Report/BulkReject.html?"
diff --git a/html/RTIR/Tools/ScriptedAction.html b/html/RTIR/Tools/ScriptedAction.html
index 7ae1fc7..32a0fa0 100644
--- a/html/RTIR/Tools/ScriptedAction.html
+++ b/html/RTIR/Tools/ScriptedAction.html
@@ -414,6 +414,15 @@ if ( $ARGS{'SubmitAction'} ) {
# restore back arguments
$ARGS{'Subject'} = $original_subject;
$ARGS{'Content'} = $original_content;
+
+ MaybeRedirectForResults(
+ Actions => \@finalresults,
+ Arguments => {
+ map { $_ => $ARGS{ $_ } }
+ grep defined $ARGS{ $_ } && length $ARGS{ $_ },
+ qw(incidentid loop server)
+ },
+ );
}
sub parse_csv {
@@ -435,7 +444,6 @@ sub parse_csv {
<%ARGS>
$incidentid => undef
-$Requestors => undef
$server => undef
$loop => 'address'
</%ARGS>
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list