[Rt-commit] r16110 - in rt/branches/3.999-DANGEROUS: lib/RT/Action
sunnavy at bestpractical.com
sunnavy at bestpractical.com
Sat Sep 27 11:39:03 EDT 2008
Author: sunnavy
Date: Sat Sep 27 11:39:03 2008
New Revision: 16110
Modified:
rt/branches/3.999-DANGEROUS/ (props changed)
rt/branches/3.999-DANGEROUS/lib/RT/Action/TicketUpdateDates.pm
Log:
r16895 at sunnavys-mb: sunnavy | 2008-09-27 23:23:18 +0800
set TicketUpdateDates' success messages in content so we can render multiple messages later: one message for one field
Modified: rt/branches/3.999-DANGEROUS/lib/RT/Action/TicketUpdateDates.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Action/TicketUpdateDates.pm (original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Action/TicketUpdateDates.pm Sat Sep 27 11:39:03 2008
@@ -35,20 +35,35 @@
my $obj = $field . '_obj';
if ( $fake_utc_date->unix != $self->record->$obj()->unix() ) {
- Jifty->log->error( $date->iso, ' ', $self->record->$obj->iso
- );
+ my $old = $self->record->$obj;
my $set = "set_$field";
my ( $status, $msg ) = $self->record->$set( $date->iso );
- unless ($status) {
+ if ($status) {
+ $self->result->content(
+ $field,
+ _(
+ "%1 changed from %2 to %3",
+ $field,
+ $old->unix
+ ? $old->iso
+ : _('Not Set'),
+ $fake_utc_date->unix ? $fake_utc_date->iso
+ : _('Not Set')
+ )
+ );
+ }
+ else {
$self->result->failure(
- _( 'Update [_1] failed: [_2]', $field, $msg ) );
+ _( 'Update %1 failed: %2', $field, $msg ) );
last;
}
}
}
}
- $self->report_success unless $self->result->failure;
+ unless ( $self->result->failure ) {
+ $self->report_success;
+ }
return 1;
}
More information about the Rt-commit
mailing list