X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FCustomField_Overlay.pm;h=5e868d1c588133e112464f23abc7b8fbb81f82da;hp=e2342e946b8e6d1ec382216550735beaf96c4439;hb=90edd8a914fd484e649fb0aa051dce7927bd6881;hpb=01352af8e44b7eb70b2b587ca43ab7ca946f038d diff --git a/rt/lib/RT/CustomField_Overlay.pm b/rt/lib/RT/CustomField_Overlay.pm index e2342e946..5e868d1c5 100644 --- a/rt/lib/RT/CustomField_Overlay.pm +++ b/rt/lib/RT/CustomField_Overlay.pm @@ -102,6 +102,11 @@ our %FieldTypes = ( 'Select date', # loc 'Select up to [_1] dates', # loc ], + TimeValue => [ + 'Enter multiple time values (UNSUPPORTED)', + 'Enter a time value', + 'Enter [_1] time values (UNSUPPORTED)', + ], ); @@ -261,6 +266,10 @@ sub Create { $self->SetBasedOn( $args{'BasedOn'} ); } + if ( exists $args{'UILocation'} ) { + $self->SetUILocation( $args{'UILocation'} ); + } + return ($rv, $msg) unless exists $args{'Queue'}; # Compat code -- create a new ObjectCustomField mapping @@ -835,7 +844,7 @@ Returns an array of all possible composite values for custom fields. sub TypeComposites { my $self = shift; - return grep !/(?:[Tt]ext|Combobox|Date)-0/, map { ("$_-1", "$_-0") } $self->Types; + return grep !/(?:[Tt]ext|Combobox|Date|TimeValue)-0/, map { ("$_-1", "$_-0") } $self->Types; } =head2 SetLookupType @@ -1447,4 +1456,21 @@ sub BasedOnObj { return $obj; } +sub UILocation { + my $self = shift; + my $tag = $self->FirstAttribute( 'UILocation' ); + return $tag ? $tag->Content : ''; +} + +sub SetUILocation { + my $self = shift; + my $tag = shift; + if ( $tag ) { + return $self->SetAttribute( Name => 'UILocation', Content => $tag ); + } + else { + return $self->DeleteAttribute('UILocation'); + } +} + 1;