[Rt-commit] rt branch, 4.2/apply-scrips-to-multiple-queues, updated. rt-4.0.8-463-g32f2e67
Thomas Sibley
trs at bestpractical.com
Wed Nov 14 18:36:32 EST 2012
The branch, 4.2/apply-scrips-to-multiple-queues has been updated
via 32f2e67ecf1c68518a1b74badba3ca6e7b893ded (commit)
from e6aee7ac22664e8924c49dece146c3951a024875 (commit)
Summary of changes:
share/html/Admin/Scrips/Objects.html | 17 +++++------------
1 file changed, 5 insertions(+), 12 deletions(-)
- Log -----------------------------------------------------------------
commit 32f2e67ecf1c68518a1b74badba3ca6e7b893ded
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Wed Nov 14 15:33:51 2012 -0800
IsGlobal returns the ObjectScrip record, conveniently
This makes the code a bit cleaner.
diff --git a/share/html/Admin/Scrips/Objects.html b/share/html/Admin/Scrips/Objects.html
index 9dc5622..e37a319 100644
--- a/share/html/Admin/Scrips/Objects.html
+++ b/share/html/Admin/Scrips/Objects.html
@@ -52,7 +52,7 @@
<form action="Objects.html" method="post" name="AddRemoveScrip">
<input type="hidden" class="hidden" name="id" value="<% $id %>" />
-% if ( $is_global ) {
+% if ( $global ) {
<h2><&|/l&>Applies to all objects</&></h2>
<label>
<input type="checkbox" name="RemoveScrip-<% $id %>" value="0" />
@@ -60,7 +60,7 @@
</label>
<& /Admin/Elements/SelectStageForAdded,
- Default => $Stage || ($global_os ? $global_os->Stage : undef),
+ Default => $Stage || $global->Stage,
Label => loc("Select global scrip stage:")
&>
% } else {
@@ -120,14 +120,7 @@ my $scrip = RT::Scrip->new( $session{'CurrentUser'} );
$scrip->Load($id) or Abort(loc("Could not load scrip #[_1]", $id));
$id = $scrip->id;
-my $is_global = $scrip->IsGlobal;
-my $global_os;
-
-if ( $is_global ) {
- $global_os = RT::ObjectScrip->new( $session{CurrentUser} );
- $global_os->LoadByCols( Scrip => $scrip->id, ObjectId => 0 );
- undef $global_os unless $global_os->id;
-}
+my $global = $scrip->IsGlobal;
if ( $Update ) {
my (@results);
@@ -143,8 +136,8 @@ if ( $Update ) {
push @results, $msg;
}
}
- if ($is_global and $global_os and $global_os->Stage ne $Stage) {
- my ($status, $msg) = $global_os->SetStage($Stage);
+ if ($global and $global->Stage ne $Stage) {
+ my ($status, $msg) = $global->SetStage($Stage);
push @results, $msg;
}
MaybeRedirectForResults(
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list