[Rt-commit] rt branch, 3.9-trunk, updated. rt-3.9.4-3-gbeaebf1
? sunnavy
sunnavy at bestpractical.com
Wed Sep 29 02:30:07 EDT 2010
The branch, 3.9-trunk has been updated
via beaebf19c94c527a05f91a3176dbd536b4076135 (commit)
from 4bdabf0208bb7aa30a4f0cb940a359f227328a2a (commit)
Summary of changes:
lib/RT/Lifecycle.pm | 15 ++++++++++-----
1 files changed, 10 insertions(+), 5 deletions(-)
- Log -----------------------------------------------------------------
commit beaebf19c94c527a05f91a3176dbd536b4076135
Author: sunnavy <sunnavy at bestpractical.com>
Date: Wed Sep 29 14:22:23 2010 +0800
use 1 as true, 0 as false
diff --git a/lib/RT/Lifecycle.pm b/lib/RT/Lifecycle.pm
index 52be418..68f4386 100644
--- a/lib/RT/Lifecycle.pm
+++ b/lib/RT/Lifecycle.pm
@@ -214,7 +214,8 @@ See also </valid>.
sub is_valid {
my $self = shift;
my $value = lc shift;
- return scalar grep lc($_) eq $value, $self->valid( @_ );
+ return 1 if grep lc($_) eq $value, $self->valid( @_ );
+ return 0;
}
=head3 initial
@@ -238,7 +239,8 @@ Otherwise, returns false.
sub is_initial {
my $self = shift;
my $value = lc shift;
- return scalar grep lc($_) eq $value, $self->valid('initial');
+ return 1 if grep lc($_) eq $value, $self->valid('initial');
+ return 0;
}
@@ -275,7 +277,8 @@ Otherwise, returns false.
sub is_active {
my $self = shift;
my $value = lc shift;
- return scalar grep lc($_) eq $value, $self->valid('active');
+ return 1 if grep lc($_) eq $value, $self->valid('active');
+ return 0;
}
=head3 inactive
@@ -299,7 +302,8 @@ Otherwise, returns false.
sub is_inactive {
my $self = shift;
my $value = lc shift;
- return scalar grep lc($_) eq $value, $self->valid('inactive');
+ return 1 if grep lc($_) eq $value, $self->valid('inactive');
+ return 0;
}
=head2 Transitions, rights, labels and actions.
@@ -337,7 +341,8 @@ sub is_transition {
my $self = shift;
my $from = shift or return 0;
my $to = shift or return 0;
- return scalar grep lc($_) eq lc($to), $self->transitions($from);
+ return 1 if grep lc($_) eq lc($to), $self->transitions($from);
+ return 0;
}
=head3 check_right
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list