[Rt-commit] r9007 - rt/branches/3.7-EXPERIMENTAL/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Tue Sep 11 22:36:59 EDT 2007
Author: ruz
Date: Tue Sep 11 22:36:59 2007
New Revision: 9007
Modified:
rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
Log:
* first step towards DryRun on create
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Ticket_Overlay.pm Tue Sep 11 22:36:59 2007
@@ -286,6 +286,7 @@
Resolved => undef,
MIMEObj => undef,
_RecordTransaction => 1,
+ DryRun => 0,
@_
);
@@ -660,9 +661,10 @@
# {{{ Add a transaction for the create
my ( $Trans, $Msg, $TransObj ) = $self->_NewTransaction(
- Type => "Create",
- TimeTaken => $args{'TimeWorked'},
- MIMEObj => $args{'MIMEObj'},
+ Type => "Create",
+ TimeTaken => $args{'TimeWorked'},
+ MIMEObj => $args{'MIMEObj'},
+ CommitScrips => !$args{'DryRun'},
);
if ( $self->Id && $Trans ) {
@@ -681,6 +683,10 @@
return ( 0, 0, $self->loc( "Ticket could not be created due to an internal error"));
}
+ if ( $args{'DryRun'} ) {
+ $RT::Handle->Rollback();
+ return ($self->id, $TransObj, $ErrStr);
+ }
$RT::Handle->Commit();
return ( $self->Id, $TransObj->Id, $ErrStr );
More information about the Rt-commit
mailing list