#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
=cut
-# {{{ sub CurrentUser
=head2 CurrentUser
if ref $self->{'user'} && $self->{'user'} == $self;
}
- unless ( ref $self->{'user'} && $self->{'user'}->isa('RT::CurrentUser') ) {
- my $msg = "$self was created without a CurrentUser."
- ." Any RT object which is subclass of RT::Base must be created"
- ." with a RT::CurrentUser or a RT::User object as the first argument.";
- $msg .= "\n". Carp::longmess() if @_;
-
- $RT::Logger->error( $msg );
- return $self->{'user'} = undef;
- }
-
return ( $self->{'user'} );
}
-# }}}
sub OriginalUser {
my $self = shift;
you call it like this:
- $self->loc("I have [quant,_1,concrete mixer].", 6);
+ $self->loc("I have [quant,_1,concrete mixer,concrete mixers].", 6);
In english, this would return:
I have 6 concrete mixers.
my $class = shift;
my ($package,undef,undef) = caller();
$package =~ s|::|/|g;
- for (qw(Overlay Vendor Local)) {
- my $filename = $package."_".$_.".pm";
+ for my $type (qw(Overlay Vendor Local)) {
+ my $filename = $package."_".$type.".pm";
eval { require $filename };
- die $@ if ($@ && $@ !~ qr{^Can't locate $filename});
+ die $@ if ($@ && $@ !~ m{^Can't locate $filename});
}
}