[Rt-commit] r9243 - in rt/branches/3.7-EXPERIMENTAL: .
ruz at bestpractical.com
ruz at bestpractical.com
Mon Oct 8 12:30:53 EDT 2007
Author: ruz
Date: Mon Oct 8 12:30:52 2007
New Revision: 9243
Modified:
rt/branches/3.7-EXPERIMENTAL/ (props changed)
rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm
Log:
r9231 at cubic-pc (orig r9230): ruz | 2007-10-08 04:29:49 +0400
* use a little bit more complex logic as we update two fields in one method
Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm (original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/CustomField_Overlay.pm Mon Oct 8 12:30:52 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