[freeside-commits] freeside/rt/lib/RT/Action ScheduledResolve.pm, NONE, 1.1 SetWillResolve.pm, NONE, 1.1
Mark Wells
mark at wavetail.420.am
Tue Aug 23 14:45:52 PDT 2011
- Previous message: [freeside-commits] freeside/rt/etc initialdata, 1.2, 1.3 schema.Pg, 1.6, 1.7 schema.mysql-4.1, 1.2, 1.3
- Next message: [freeside-commits] freeside/rt/lib/RT Ticket_Vendor.pm, 1.2, 1.3 Tickets_Overlay.pm, 1.15, 1.16 Transaction_Vendor.pm, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/rt/lib/RT/Action
In directory wavetail.420.am:/tmp/cvs-serv19442/rt/lib/RT/Action
Added Files:
ScheduledResolve.pm SetWillResolve.pm
Log Message:
RT future ticket resolve, #13853
--- NEW FILE: SetWillResolve.pm ---
package RT::Action::SetWillResolve;
use base 'RT::Action';
use strict;
sub Describe {
my $self = shift;
return (ref $self ." will set a ticket's future resolve date to the argument.");
}
sub Prepare {
return 1;
}
sub Commit {
my $self = shift;
my $DateObj = RT::Date->new( $self->CurrentUser );
$DateObj->Set(
Format => 'unknown',
Value => $self->Argument,
);
$self->TicketObj->SetWillResolve( $DateObj->ISO );
}
RT::Base->_ImportOverlays();
1;
--- NEW FILE: ScheduledResolve.pm ---
package RT::Action::ScheduledResolve;
use strict;
use warnings;
use base qw(RT::Action);
=head1 DESCRIPTION
If the ticket's WillResolve date is in the past, set its status to resolved.
=cut
sub Prepare {
my $self = shift;
return undef if grep { $self->TicketObj->Status eq $_ } (
'resolved',
'rejected',
'deleted'
); # don't resolve from any of these states.
my $time = $self->TicketObj->WillResolveObj->Unix;
return ( $time > 0 and $time < time() );
}
sub Commit {
my $self = shift;
my $never = RT::Date->new($self->CurrentUser);
$never->Unix(-1);
$self->TicketObj->SetWillResolve($never->ISO);
$self->TicketObj->SetStatus('resolved');
}
RT::Base->_ImportOverlays();
1;
- Previous message: [freeside-commits] freeside/rt/etc initialdata, 1.2, 1.3 schema.Pg, 1.6, 1.7 schema.mysql-4.1, 1.2, 1.3
- Next message: [freeside-commits] freeside/rt/lib/RT Ticket_Vendor.pm, 1.2, 1.3 Tickets_Overlay.pm, 1.15, 1.16 Transaction_Vendor.pm, NONE, 1.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list