From 576d11eecd4aac143ac5d103b056060e2baaf4ed Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Fri, 18 Jan 2013 17:42:01 -0800 Subject: avoid cloning TimeWorked and related fields on linked tickets, #20543 --- rt/share/html/Admin/CustomFields/Modify.html | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'rt/share/html/Admin/CustomFields/Modify.html') diff --git a/rt/share/html/Admin/CustomFields/Modify.html b/rt/share/html/Admin/CustomFields/Modify.html index 4ed86b60b..358dcfd70 100644 --- a/rt/share/html/Admin/CustomFields/Modify.html +++ b/rt/share/html/Admin/CustomFields/Modify.html @@ -143,6 +143,11 @@ <&|/l&>Required for ticket resolution +  + /> +<&|/l&>Copy this field to new tickets + +   /> @@ -187,6 +192,7 @@ else { IncludeContentForValue => $IncludeContentForValue, BasedOn => $BasedOn, Disabled => !$Enabled, + NoClone => !$YesClone, ); if (!$val) { push @results, loc("Could not create CustomField: [_1]", $msg); @@ -207,10 +213,12 @@ else { if ( $ARGS{'Update'} && $id ne 'new' ) { #we're asking about enabled on the web page but really care about disabled. $ARGS{'Disabled'} = $Enabled? 0 : 1; + # likewise + $ARGS{'NoClone'} = $YesClone ? 0 : 1; $ARGS{'Required'} ||= 0; - my @attribs = qw(Disabled Required Pattern Name TypeComposite LookupType Description LinkValueTo IncludeContentForValue); + my @attribs = qw(Disabled Required Pattern Name TypeComposite LookupType Description LinkValueTo IncludeContentForValue NoClone); push @results, UpdateRecordObject( AttributesRef => \@attribs, Object => $CustomFieldObj, @@ -313,6 +321,10 @@ $EnabledChecked = '' if $CustomFieldObj->Disabled; my $RequiredChecked = ''; $RequiredChecked = qq[checked="checked"] if $CustomFieldObj->Required; +my $YesCloneChecked = qq[checked="checked"]; +$YesCloneChecked = '' if $CustomFieldObj->NoClone; + + my @CFvalidations = ( '(?#Mandatory).', '(?#Digits)^[\d.]+$', @@ -339,4 +351,5 @@ $LinkValueTo => undef $IncludeContentForValue => undef $BasedOn => undef $UILocation => undef +$YesClone => undef -- cgit v1.2.1 From 7588a4ac90a9b07c08a3107cd1107d773be1c991 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Tue, 4 Jun 2013 00:16:28 -0700 Subject: RT 4.0.13 --- rt/share/html/Admin/CustomFields/Modify.html | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'rt/share/html/Admin/CustomFields/Modify.html') diff --git a/rt/share/html/Admin/CustomFields/Modify.html b/rt/share/html/Admin/CustomFields/Modify.html index 358dcfd70..8628cd383 100644 --- a/rt/share/html/Admin/CustomFields/Modify.html +++ b/rt/share/html/Admin/CustomFields/Modify.html @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -224,7 +224,15 @@ if ( $ARGS{'Update'} && $id ne 'new' ) { Object => $CustomFieldObj, ARGSRef => \%ARGS ); - $CustomFieldObj->SetValuesClass( $ValuesClass ); + if ( ($ValuesClass||'RT::CustomFieldValues') ne $CustomFieldObj->ValuesClass ) { + my $original = $CustomFieldObj->ValuesClass; + my ($good, $msg) = $CustomFieldObj->SetValuesClass( $ValuesClass ); + if ( $good ) { + $msg = loc("[_1] changed from '[_2]' to '[_3]'", + loc("Field values source"), $original, $ValuesClass ); + } + push @results, $msg; + } # Set the render type if we have it, but unset it if the new type doesn't # support render types @@ -258,7 +266,7 @@ if ( $ARGS{'Update'} && $id ne 'new' ) { my $paramtag = "CustomField-". $CustomFieldObj->Id ."-Value"; # Delete any fields that want to be deleted foreach my $key ( keys %ARGS ) { - next unless $key =~ /^Delete-$paramtag-(\d+)$/o; + next unless $key =~ /^Delete-$paramtag-(\d+)$/; my ($val, $msg) = $CustomFieldObj->DeleteValue( $1 ); push (@results, $msg); } -- cgit v1.2.1