[Bps-public-commit] RT-Extension-SLA branch, master, updated. 0.07-2-g4d8b2bc
? sunnavy
sunnavy at bestpractical.com
Thu Oct 3 13:01:06 EDT 2013
The branch, master has been updated
via 4d8b2bc42e6e4a30c53af6e892c93370f4119ad4 (commit)
via 8bff61d93941e22345e17306a7e6229174d31392 (commit)
from 92a840a6fd15e39ab7ca0138c77bf5d8b3ec058a (commit)
Summary of changes:
lib/RT/Action/SLA.pm | 1 +
lib/RT/Extension/SLA.pm | 2 +-
t/ignore-on-statuses.t | 6 ++++--
3 files changed, 6 insertions(+), 3 deletions(-)
- Log -----------------------------------------------------------------
commit 8bff61d93941e22345e17306a7e6229174d31392
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 4 00:55:03 2013 +0800
no need to Set date if it's already the value
this is mainly to avoid the warning of "That is already the current value",
which fails tests on 4.0
diff --git a/lib/RT/Action/SLA.pm b/lib/RT/Action/SLA.pm
index fa12211..65b5849 100644
--- a/lib/RT/Action/SLA.pm
+++ b/lib/RT/Action/SLA.pm
@@ -41,6 +41,7 @@ sub SetDateField {
$date->Set( Format => 'unix', Value => $value );
$method = 'Set'. $type;
+ return 1 if $ticket->$type eq $date->ISO;
my ($status, $msg) = $ticket->$method( $date->ISO );
unless ( $status ) {
$RT::Logger->error("Couldn't set $type date: $msg");
commit 4d8b2bc42e6e4a30c53af6e892c93370f4119ad4
Author: sunnavy <sunnavy at bestpractical.com>
Date: Fri Oct 4 00:58:33 2013 +0800
make it compatible with 4.2
2 changes:
* make CF names case insensitive
* stalled tickets won't be auto-opened by correspondances now, we need to open it manually.
diff --git a/lib/RT/Extension/SLA.pm b/lib/RT/Extension/SLA.pm
index 9322f82..d947213 100644
--- a/lib/RT/Extension/SLA.pm
+++ b/lib/RT/Extension/SLA.pm
@@ -494,7 +494,7 @@ sub GetCustomField {
return RT::CustomField->new( $RT::SystemUser );
}
my $cfs = $args{'Ticket'}->QueueObj->TicketCustomFields;
- $cfs->Limit( FIELD => 'Name', VALUE => $args{'CustomField'} );
+ $cfs->Limit( FIELD => 'Name', VALUE => $args{'CustomField'}, CASESENSITIVE => 0 );
return $cfs->First || RT::CustomField->new( $RT::SystemUser );
}
diff --git a/t/ignore-on-statuses.t b/t/ignore-on-statuses.t
index 68855d3..df32da8 100644
--- a/t/ignore-on-statuses.t
+++ b/t/ignore-on-statuses.t
@@ -72,12 +72,13 @@ note 'check that reply to requestors dont unset due date with KeepInLoop';
$ticket->Load( $id );
ok $ticket->id, "loaded ticket #$id";
$ticket->Correspond( Content => 'we are still working on this.' );
+ $ticket->SetStatus('open');
$ticket = RT::Ticket->new( $root );
$ticket->Load( $id );
ok $ticket->id, "loaded ticket #$id";
- is $ticket->Status, 'open', 'ticket was auto-opened';
+ is $ticket->Status, 'open', 'ticket was opened';
my $tmp = $ticket->DueObj->Unix;
ok $tmp > 0, 'Due date is set';
@@ -139,12 +140,13 @@ note 'Check that failing to reply to the requestors is not ignored';
$ticket->Load( $id );
ok $ticket->id, "loaded ticket #$id";
$ticket->Correspond( Content => 'we are still working on this.' );
+ $ticket->SetStatus('open');
$ticket = RT::Ticket->new( $root );
$ticket->Load( $id );
ok $ticket->id, "loaded ticket #$id";
- is $ticket->Status, 'open', 'ticket was auto-opened';
+ is $ticket->Status, 'open', 'ticket was opened';
my $tmp = $ticket->DueObj->Unix;
ok $tmp > 0, 'Due date is set';
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list