[Rt-devel] Backdating transactions

Todd Chapman todd at chaka.net
Thu Feb 12 23:58:23 EST 2009


Displaying Update.html prepares a transaction so it can tell you who would
be emailed, but the transaction isn't committed.

2009/2/12 Chris Adams <chris at improbable.org>

>
> On Feb 12, 2009, at 3:19 PM, Todd Chapman wrote:
>
>> It's no bug that RT doesn't let you change the past. I would hit the DB
>> directly.
>>
>
>
> Bug was definitely too strong - I guess I was just thinking that it seems
> like this ended up being surprisingly invasive. Here's what the final code
> ended up looking like - one curiosity which this exposed is that on my 3.8.2
> install simply displaying Update.html will create a transaction.
>
> Chris
>
> Interface/Web_Local.pm
>
> ProcessUpdateMessage: copied & added to the %message_args initialization:
>   if ($args{ARGSRef}->{'Created'}) {
>     $message_args{'Created'} = $args{ARGSRef}->{'Created'};
>   }
>
> RT/Ticket_Local.pm:
>
> _RecordNote: copied and added after _NewTransaction call:
>
>   if ( $args{'Created'} ) {
>     RT::Logger->warning("Updating transaction #" . $TransObj->id . ":
> setting created date to " . $args{'Created'} );
>     $TransObj->_Handle->UpdateRecordValue( Table => 'Transactions', Column
> => 'Created', Value => $args{'Created'}, PrimaryKeys => { id =>
> $TransObj->id } );
>   }
>
> Ticket/Update.html - forked to add the date select since there's not a
> callback for it and running the field through RT::Date:
> <table width="100%" border="0">
> +<tr><td class="label"><&|/l&>Date</&>:</td><td><& /Elements/SelectDate,
> Name => "Created", Default => undef &></td></tr>
>
> ...
>
> $m->callback( Ticket => $TicketObj, ARGSRef => \%ARGS, results =>
> \@results, CallbackName => 'Initial' );
>
> +if ( $ARGS{'Created'} ) {
> +       my $created_date = RT::Date->new( $TicketObj->CurrentUser );
> +       $created_date->Set( Format => 'Unknown', Value => $ARGS{'Created'},
> Timezone => "user" );
> +       $ARGS{'Created'} = $created_date->ISO;
> +}
> +
>
> _______________________________________________
> List info:
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.bestpractical.com/pipermail/rt-devel/attachments/20090212/dc92ec58/attachment.htm 


More information about the Rt-devel mailing list