[Bps-public-commit] RT-Extension-SLA branch, master, updated. 0.05-15-g43da0c8

Thomas Sibley trs at bestpractical.com
Wed Jun 27 18:25:49 EDT 2012


The branch, master has been updated
       via  43da0c8cacfd189f6f768351ff37d9e1fbfb1eba (commit)
      from  5402c010c7c7c24f41aa9703800162d06662c223 (commit)

Summary of changes:
 lib/RT/Extension/SLA.pm |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit 43da0c8cacfd189f6f768351ff37d9e1fbfb1eba
Author: Thomas Sibley <trs at bestpractical.com>
Date:   Wed Jun 27 15:21:58 2012 -0700

    CalculateTime: Optionally accept a provided Agreement
    
    This lets third-party code call CalculateTime directly with arbitrary
    agreement definitions instead of being limited to the ones assembled
    from the SLA config.  The provided agreement is expected to be similar
    in all ways to the assembled ones returned by the Agreement method.

diff --git a/lib/RT/Extension/SLA.pm b/lib/RT/Extension/SLA.pm
index 4cd3a92..ca97c93 100644
--- a/lib/RT/Extension/SLA.pm
+++ b/lib/RT/Extension/SLA.pm
@@ -403,8 +403,8 @@ sub Starts {
 sub CalculateTime {
     my $self = shift;
     my %args = (@_);
-    my $agreement = $self->Agreement( @_ );
-    return undef unless $agreement;
+    my $agreement = $args{'Agreement'} || $self->Agreement( @_ );
+    return undef unless $agreement and ref $agreement eq 'HASH';
 
     my $res = $args{'Time'};
 

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



More information about the Bps-public-commit mailing list