Displaying Update.html prepares a transaction so it can tell you who would be emailed, but the transaction isn't committed.<br><br><div class="gmail_quote">2009/2/12 Chris Adams <span dir="ltr"><<a href="mailto:chris@improbable.org">chris@improbable.org</a>></span><br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div class="Ih2E3d"><br>
On Feb 12, 2009, at 3:19 PM, Todd Chapman wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
It's no bug that RT doesn't let you change the past. I would hit the DB directly.<br>
</blockquote>
<br>
<br></div>
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.<br>
<br>
Chris<br>
<br>
Interface/Web_Local.pm<br>
<br>
ProcessUpdateMessage: copied & added to the %message_args initialization:<br>
if ($args{ARGSRef}->{'Created'}) {<br>
$message_args{'Created'} = $args{ARGSRef}->{'Created'};<br>
}<br>
<br>
RT/Ticket_Local.pm:<br>
<br>
_RecordNote: copied and added after _NewTransaction call:<br>
<br>
if ( $args{'Created'} ) {<br>
RT::Logger->warning("Updating transaction #" . $TransObj->id . ": setting created date to " . $args{'Created'} );<br>
$TransObj->_Handle->UpdateRecordValue( Table => 'Transactions', Column => 'Created', Value => $args{'Created'}, PrimaryKeys => { id => $TransObj->id } );<br>
}<br>
<br>
Ticket/Update.html - forked to add the date select since there's not a callback for it and running the field through RT::Date:<br>
<table width="100%" border="0"><br>
+<tr><td class="label"><&|/l&>Date</&>:</td><td><& /Elements/SelectDate, Name => "Created", Default => undef &></td></tr><br>
<br>
...<br>
<br>
$m->callback( Ticket => $TicketObj, ARGSRef => \%ARGS, results => \@results, CallbackName => 'Initial' );<br>
<br>
+if ( $ARGS{'Created'} ) {<br>
+ my $created_date = RT::Date->new( $TicketObj->CurrentUser );<br>
+ $created_date->Set( Format => 'Unknown', Value => $ARGS{'Created'}, Timezone => "user" );<br>
+ $ARGS{'Created'} = $created_date->ISO;<br>
+}<br>
+<br>
<br>_______________________________________________<br>
List info: <a href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel" target="_blank">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-devel</a><br>
<br></blockquote></div><br>