[rt-users] UntouchedInHours module

Matt Hampton rt-users at codersnetwork.co.uk
Mon Feb 28 11:32:19 EST 2005


I have spent some time today trying to get the module UntouchedInHours 
to work.

Couldn't get the example from the Wiki working so I have written my own.

It is as simple as I can make it:

---------------------------------------

package RT::Condition::UntouchedInHours;
require RT::Condition::Generic;

use RT::Date;

@ISA = qw(RT::Condition::Generic);

use strict;
use vars qw/@ISA/;

sub IsApplicable {
         my $self = shift;
         if ((time()-$self->TicketObj->LastUpdatedObj->Unix)/3600 >= 
$self->Argument) {
                 return 1
         }
         else {
                 return 0;
         }
}


eval "require RT::Condition::UntouchedInHours_Vendor";
die $@ if ($@ && $@ !~ qr{^Can't locate 
RT/Condition/UntouchedInHours_Vendor.pm});
eval "require RT::Condition::UntouchedInHours_Local";
die $@ if ($@ && $@ !~ qr{^Can't locate 
RT/Condition/UntouchedInHours_Local.pm});

-------------------------------

matt



More information about the rt-users mailing list