[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
Mark Wells
mark at wavetail.420.am
Tue Aug 23 14:45:52 PDT 2011
Update of /home/cvs/cvsroot/freeside/rt/lib/RT
In directory wavetail.420.am:/tmp/cvs-serv19442/rt/lib/RT
Modified Files:
Ticket_Vendor.pm Tickets_Overlay.pm
Added Files:
Transaction_Vendor.pm
Log Message:
RT future ticket resolve, #13853
Index: Ticket_Vendor.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Ticket_Vendor.pm,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -w -d -r1.2 -r1.3
--- Ticket_Vendor.pm 31 May 2011 23:30:13 -0000 1.2
+++ Ticket_Vendor.pm 23 Aug 2011 21:45:50 -0000 1.3
@@ -33,4 +33,33 @@
return @results;
}
+# Declare the 'WillResolve' field
+sub _VendorAccessible {
+ {
+ WillResolve =>
+ {read => 1, write => 1, sql_type => 11, length => 0, is_blob => 0, is_numeric => 0, type => 'datetime', default => ''},
+ },
+};
+
+sub WillResolveObj {
+ my $self = shift;
+
+ my $time = new RT::Date( $self->CurrentUser );
+
+ if ( my $willresolve = $self->WillResolve ) {
+ $time->Set( Format => 'sql', Value => $willresolve );
+ }
+ else {
+ $time->Set( Format => 'unix', Value => -1 );
+ }
+
+ return $time;
+}
+
+sub WillResolveAsString {
+ my $self = shift;
+ return $self->WillResolveObj->AsString();
+}
+
+
1;
--- NEW FILE: Transaction_Vendor.pm ---
package RT::Transaction;
use strict;
use vars qw(%_BriefDescriptions);
$_BriefDescriptions{'Set'} = sub {
my $self = shift;
if ( $self->Field eq 'Password' ) {
return $self->loc('Password changed');
}
elsif ( $self->Field eq 'Queue' ) {
my $q1 = new RT::Queue( $self->CurrentUser );
$q1->Load( $self->OldValue );
my $q2 = new RT::Queue( $self->CurrentUser );
$q2->Load( $self->NewValue );
return $self->loc("[_1] changed from [_2] to [_3]",
$self->loc($self->Field) , $q1->Name , $q2->Name);
}
# Write the date/time change at local time:
elsif ($self->Field =~ /Due|Starts|Started|Told|WillResolve/) {
my $t1 = new RT::Date($self->CurrentUser);
$t1->Set(Format => 'ISO', Value => $self->NewValue);
my $t2 = new RT::Date($self->CurrentUser);
$t2->Set(Format => 'ISO', Value => $self->OldValue);
return $self->loc( "[_1] changed from [_2] to [_3]", $self->loc($self->Field), $t2->AsString, $t1->AsString );
}
else {
return $self->loc( "[_1] changed from [_2] to [_3]",
$self->loc($self->Field),
($self->OldValue? "'".$self->OldValue ."'" : $self->loc("(no value)")) , "'". $self->NewValue."'" );
}
};
1;
Index: Tickets_Overlay.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Tickets_Overlay.pm,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -w -d -r1.15 -r1.16
--- Tickets_Overlay.pm 20 Jul 2011 23:06:37 -0000 1.15
+++ Tickets_Overlay.pm 23 Aug 2011 21:45:50 -0000 1.16
@@ -145,9 +145,11 @@
WatcherGroup => [ 'MEMBERSHIPFIELD', ], #loc_left_pair
HasAttribute => [ 'HASATTRIBUTE', 1 ],
HasNoAttribute => [ 'HASATTRIBUTE', 0 ],
+ #freeside
Agentnum => [ 'FREESIDEFIELD', ],
Classnum => [ 'FREESIDEFIELD', ],
Tagnum => [ 'FREESIDEFIELD', 'cust_tag' ],
+ WillResolve => [ 'DATE' => 'WillResolve', ], #loc_left_pair
);
our %SEARCHABLE_SUBFIELDS = (
More information about the freeside-commits
mailing list