[Rt-commit] r9230 - rt/branches/3.7-RTIR-RELENG/lib/RT
ruz at bestpractical.com
ruz at bestpractical.com
Sun Oct 7 20:29:52 EDT 2007
Author: ruz
Date: Sun Oct 7 20:29:49 2007
New Revision: 9230
Modified:
rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm
Log:
* use a little bit more complex logic as we update two fields in one method
Modified: rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm
==============================================================================
--- rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm (original)
+++ rt/branches/3.7-RTIR-RELENG/lib/RT/CustomField_Overlay.pm Sun Oct 7 20:29:49 2007
@@ -709,9 +709,23 @@
sub SetTypeComposite {
my $self = shift;
my $composite = shift;
+
+ my $old = $self->TypeComposite;
+
my ($type, $max_values) = split(/-/, $composite, 2);
- $self->SetType($type);
- $self->SetMaxValues($max_values);
+ if ( $type ne $self->Type ) {
+ my ($status, $msg) = $self->SetType( $type );
+ return ($status, $msg) unless $status;
+ }
+ if ( ($max_values || 0) != ($self->MaxValues || 0) ) {
+ my ($status, $msg) = $self->SetMaxValues( $max_values );
+ return ($status, $msg) unless $status;
+ }
+ return 1, $self->loc(
+ "Type changed from '[_1]' to '[_2]'",
+ $self->FriendlyTypeComposite( $old ),
+ $self->FriendlyTypeComposite( $composite ),
+ );
}
=head2 SetLookupType
More information about the Rt-commit
mailing list