[Rt-commit] rt branch, 3.9-maybe_redirect, updated. rt-3.9.7-924-gc04d9e9
Ruslan Zakirov
ruz at bestpractical.com
Fri Dec 17 16:50:38 EST 2010
The branch, 3.9-maybe_redirect has been updated
via c04d9e903b0a8bb8b7f8f15a19de00ad2ca79cb4 (commit)
via b651c7177fc841e1a3dd7ee6f4c06924ac8561be (commit)
from b4044e8b15e8ea8830bbf7240c4b005c836e82b7 (commit)
Summary of changes:
share/html/Admin/Articles/Classes/Modify.html | 6 +--
share/html/Admin/CustomFields/Modify.html | 8 +--
share/html/Admin/Groups/Modify.html | 6 +--
share/html/Admin/Queues/Modify.html | 10 ++--
share/html/Admin/Users/Modify.html | 10 ++--
share/html/Articles/Article/Edit.html | 10 ++--
share/html/Dashboards/Modify.html | 10 ++--
share/html/Elements/MaybeRedirectForResults | 67 -------------------------
share/html/Ticket/Display.html | 11 ++--
share/html/index.html | 9 ++--
10 files changed, 31 insertions(+), 116 deletions(-)
delete mode 100644 share/html/Elements/MaybeRedirectForResults
- Log -----------------------------------------------------------------
commit b651c7177fc841e1a3dd7ee6f4c06924ac8561be
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Dec 18 00:49:37 2010 +0300
delete MaybeRedirectForResults component
diff --git a/share/html/Elements/MaybeRedirectForResults b/share/html/Elements/MaybeRedirectForResults
deleted file mode 100644
index f0afb34..0000000
--- a/share/html/Elements/MaybeRedirectForResults
+++ /dev/null
@@ -1,67 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%#
-%# COPYRIGHT:
-%#
-%# This software is Copyright (c) 1996-2010 Best Practical Solutions, LLC
-%# <jesse at bestpractical.com>
-%#
-%# (Except where explicitly superseded by other copyright notices)
-%#
-%#
-%# LICENSE:
-%#
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%#
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-%# General Public License for more details.
-%#
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%#
-%#
-%# CONTRIBUTION SUBMISSION POLICY:
-%#
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%#
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%#
-%# END BPS TAGGED BLOCK }}}
-<%args>
-$Actions => []
-$ARGSRef => {}
-$Path
-$id
-</%args>
-<%init>
-if ( grep {defined} @$Actions ) {
- # 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} ||= [] }, @$Actions;
- $session{'i'}++;
- $Path =~ s!^/+!!;
- my $url = RT->Config->Get('WebURL') . "$Path?id=" . $id . "&results=" . $key;
- $url .= '#' . $ARGSRef->{Anchor} if $ARGSRef->{Anchor};
- RT::Interface::Web::Redirect($url);
-}
-</%init>
commit c04d9e903b0a8bb8b7f8f15a19de00ad2ca79cb4
Author: Ruslan Zakirov <ruz at bestpractical.com>
Date: Sat Dec 18 00:50:20 2010 +0300
switch to MaybeRedirectForResults function
diff --git a/share/html/Admin/Articles/Classes/Modify.html b/share/html/Admin/Articles/Classes/Modify.html
index 0d0716d..fa460b4 100644
--- a/share/html/Admin/Articles/Classes/Modify.html
+++ b/share/html/Admin/Articles/Classes/Modify.html
@@ -122,12 +122,10 @@ if ($ClassObj->Id()) {
}
# This code does automatic redirection if any updates happen.
-$m->comp(
- '/Elements/MaybeRedirectForResults',
+MaybeRedirectForResults(
Actions => \@results,
Path => '/Admin/Articles/Classes/Modify.html',
- id => $ClassObj->Id,
- ARGSRef => \%ARGS
+ Arguments => { id => $ClassObj->Id },
);
#we're asking about enabled on the web page but really care about disabled.
diff --git a/share/html/Admin/CustomFields/Modify.html b/share/html/Admin/CustomFields/Modify.html
index 5f85456..80ce81c 100644
--- a/share/html/Admin/CustomFields/Modify.html
+++ b/share/html/Admin/CustomFields/Modify.html
@@ -270,16 +270,12 @@ $id = $CustomFieldObj->id if $CustomFieldObj->id;
# This code does automatic redirection if any updates happen.
-$m->comp(
- '/Elements/MaybeRedirectForResults',
+MaybeRedirectForResults(
Actions => \@results,
Path => '/Admin/CustomFields/Modify.html',
- id => $id,
- ARGSRef => \%ARGS
+ Arguments => { id => $id },
);
-
-
my $EnabledChecked = qq[checked="checked"];
$EnabledChecked = '' if $CustomFieldObj->Disabled;
diff --git a/share/html/Admin/Groups/Modify.html b/share/html/Admin/Groups/Modify.html
index 2d16cd5..e210609 100755
--- a/share/html/Admin/Groups/Modify.html
+++ b/share/html/Admin/Groups/Modify.html
@@ -154,12 +154,10 @@ if ( ($SetEnabled) and ( $Disabled != $Group->Disabled) ) {
}
# This code does automatic redirection if any updates happen.
-$m->comp(
- '/Elements/MaybeRedirectForResults',
+MaybeRedirectForResults(
Actions => \@results,
Path => '/Admin/Groups/Modify.html',
- id => $Group->Id,
- ARGSRef => \%ARGS
+ Arguments => { id => $Group->id },
);
push @results, @warnings;
diff --git a/share/html/Admin/Queues/Modify.html b/share/html/Admin/Queues/Modify.html
index 65b1dc0..4fc64b7 100755
--- a/share/html/Admin/Queues/Modify.html
+++ b/share/html/Admin/Queues/Modify.html
@@ -226,12 +226,10 @@ if ( $QueueObj->Id ) {
}
# This code does automatic redirection if any updates happen.
-$m->comp(
- '/Elements/MaybeRedirectForResults',
- Actions => \@results,
- Path => '/Admin/Queues/Modify.html',
- id => $QueueObj->Id,
- ARGSRef => \%ARGS
+MaybeRedirectForResults(
+ Actions => \@results,
+ Path => '/Admin/Queues/Modify.html',
+ Arguments => { id => $QueueObj->Id },
);
push @results, @no_redirect_results;
diff --git a/share/html/Admin/Users/Modify.html b/share/html/Admin/Users/Modify.html
index 194633a..3b6b27e 100755
--- a/share/html/Admin/Users/Modify.html
+++ b/share/html/Admin/Users/Modify.html
@@ -368,12 +368,10 @@ if (!$Create && $UserObj->Privileged()) {
}
# This code does automatic redirection if any updates happen.
-$m->comp(
- '/Elements/MaybeRedirectForResults',
- Actions => \@results,
- Path => '/Admin/Users/Modify.html',
- id => $UserObj->Id,
- ARGSRef => \%ARGS
+MaybeRedirectForResults(
+ Actions => \@results,
+ Path => '/Admin/Users/Modify.html',
+ Arguments => { id => $UserObj->Id },
);
</%INIT>
diff --git a/share/html/Articles/Article/Edit.html b/share/html/Articles/Article/Edit.html
index b1e5691..a105a5a 100644
--- a/share/html/Articles/Article/Edit.html
+++ b/share/html/Articles/Article/Edit.html
@@ -212,12 +212,10 @@ elsif ( $id eq 'new' ) {
$m->redirect($ARGS{next});
}
else {
- $m->comp(
- '/Elements/MaybeRedirectForResults',
- Actions => \@results,
- Path => 'Articles/Article/Edit.html',
- id => $ArticleObj->id,
- ARGSRef => \%ARGS
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => '/Articles/Article/Edit.html',
+ Arguments => { id => $ArticleObj->id },
);
}
}
diff --git a/share/html/Dashboards/Modify.html b/share/html/Dashboards/Modify.html
index 1a21a42..fb875c0 100644
--- a/share/html/Dashboards/Modify.html
+++ b/share/html/Dashboards/Modify.html
@@ -159,12 +159,10 @@ if (!$Create && !$tried_create && $id && $ARGS{'Delete'}) {
}
# This code does automatic redirection if any updates happen.
-$m->comp(
- '/Elements/MaybeRedirectForResults',
- Actions => \@results,
- Path => $redirect_to,
- id => $id,
- ARGSRef => \%ARGS
+MaybeRedirectForResults(
+ Actions => \@results,
+ Path => $redirect_to,
+ Arguments => { id => $id },
);
</%INIT>
diff --git a/share/html/Ticket/Display.html b/share/html/Ticket/Display.html
index 5365776..e254d0e 100755
--- a/share/html/Ticket/Display.html
+++ b/share/html/Ticket/Display.html
@@ -194,12 +194,11 @@ $m->callback(
);
# This code does automatic redirection if any updates happen.
-$m->comp(
- '/Elements/MaybeRedirectForResults',
- Actions => \@Actions,
- Path => 'Ticket/Display.html',
- id => $TicketObj->id,
- ARGSRef => \%ARGS
+MaybeRedirectForResults(
+ Actions => \@Actions,
+ Path => 'Ticket/Display.html',
+ Anchor => $ARGS{'Anchor'},
+ Arguments => { id => $TicketObj->id },
);
# Get the transactoins before the attachments, for great ACL justice
diff --git a/share/html/index.html b/share/html/index.html
index 24cc9da..79832ae 100755
--- a/share/html/index.html
+++ b/share/html/index.html
@@ -117,11 +117,10 @@ if ( $ARGS{'QuickCreate'} ) {
push @results, $msg;
if ( $t && $t->Id && RT->Config->Get('DisplayTicketAfterQuickCreate', $session{'CurrentUser'}) ) {
- $m->comp(
- '/Elements/MaybeRedirectForResults',
- 'Actions' => \@results,
- 'Path' => 'Ticket/Display.html',
- 'id' => $t->Id,
+ MaybeRedirectForResults(
+ Actions => \@results,
+ Path => 'Ticket/Display.html',
+ Arguments => { id => $t->Id },
);
}
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list