projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1fbe9c8
)
avoid cloning TimeWorked and related fields on linked tickets, #20543
author
Mark Wells
<mark@freeside.biz>
Sat, 19 Jan 2013 01:42:01 +0000
(17:42 -0800)
committer
Mark Wells
<mark@freeside.biz>
Sat, 19 Jan 2013 01:42:01 +0000
(17:42 -0800)
rt/FREESIDE_MODIFIED
patch
|
blob
|
history
rt/lib/RT/CustomField.pm
patch
|
blob
|
history
rt/share/html/Admin/CustomFields/Modify.html
patch
|
blob
|
history
rt/share/html/Ticket/Create.html
patch
|
blob
|
history
diff --git
a/rt/FREESIDE_MODIFIED
b/rt/FREESIDE_MODIFIED
index
315d6b2
..
ace0d49
100644
(file)
--- a/
rt/FREESIDE_MODIFIED
+++ b/
rt/FREESIDE_MODIFIED
@@
-160,3
+160,8
@@
share/html/Ticket/Elements/ShowDates
share/html/Elements/CustomerFields
share/html/Search/Elements/ConditionRow # bugfix for select options list
share/html/Search/Elements/PickBasics
share/html/Elements/CustomerFields
share/html/Search/Elements/ConditionRow # bugfix for select options list
share/html/Search/Elements/PickBasics
+
+#avoid cloning TimeWorked and related fields
+lib/RT/CustomField.pm
+share/html/Admin/CustomFields/Modify.html
+share/html/Ticket/Create.html
diff --git
a/rt/lib/RT/CustomField.pm
b/rt/lib/RT/CustomField.pm
index
7ba24b8
..
8d16c1f
100644
(file)
--- a/
rt/lib/RT/CustomField.pm
+++ b/
rt/lib/RT/CustomField.pm
@@
-410,6
+410,10
@@
sub Create {
$self->SetUILocation( $args{'UILocation'} );
}
$self->SetUILocation( $args{'UILocation'} );
}
+ if ( exists $args{'NoClone'} ) {
+ $self->SetNoClone( $args{'NoClone'} );
+ }
+
return ($rv, $msg) unless exists $args{'Queue'};
# Compat code -- create a new ObjectCustomField mapping
return ($rv, $msg) unless exists $args{'Queue'};
# Compat code -- create a new ObjectCustomField mapping
@@
-1822,9
+1826,20
@@
sub SetUILocation {
}
}
}
}
+sub NoClone {
+ my $self = shift;
+ $self->FirstAttribute('NoClone') ? 1 : '';
+}
-
-
+sub SetNoClone {
+ my $self = shift;
+ my $value = shift;
+ if ( $value ) {
+ return $self->SetAttribute( Name => 'NoClone', Content => 1 );
+ } else {
+ return $self->DeleteAttribute('NoClone');
+ }
+}
=head2 id
=head2 id
diff --git
a/rt/share/html/Admin/CustomFields/Modify.html
b/rt/share/html/Admin/CustomFields/Modify.html
index
4ed86b6
..
358dcfd
100644
(file)
--- a/
rt/share/html/Admin/CustomFields/Modify.html
+++ b/
rt/share/html/Admin/CustomFields/Modify.html
@@
-144,6
+144,11
@@
</td></tr>
<tr><td class="label"> </td><td>
</td></tr>
<tr><td class="label"> </td><td>
+<input type="checkbox" class="checkbox" name="YesClone" value="1" <% $YesCloneChecked |n%> />
+<&|/l&>Copy this field to new tickets</&>
+</td></tr>
+
+<tr><td class="label"> </td><td>
<input type="hidden" class="hidden" name="SetEnabled" value="1" />
<input type="checkbox" class="checkbox" name="Enabled" value="1" <% $EnabledChecked |n%> />
<&|/l&>Enabled (Unchecking this box disables this custom field)</&>
<input type="hidden" class="hidden" name="SetEnabled" value="1" />
<input type="checkbox" class="checkbox" name="Enabled" value="1" <% $EnabledChecked |n%> />
<&|/l&>Enabled (Unchecking this box disables this custom field)</&>
@@
-187,6
+192,7
@@
else {
IncludeContentForValue => $IncludeContentForValue,
BasedOn => $BasedOn,
Disabled => !$Enabled,
IncludeContentForValue => $IncludeContentForValue,
BasedOn => $BasedOn,
Disabled => !$Enabled,
+ NoClone => !$YesClone,
);
if (!$val) {
push @results, loc("Could not create CustomField: [_1]", $msg);
);
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;
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;
$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,
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 $RequiredChecked = '';
$RequiredChecked = qq[checked="checked"] if $CustomFieldObj->Required;
+my $YesCloneChecked = qq[checked="checked"];
+$YesCloneChecked = '' if $CustomFieldObj->NoClone;
+
+
my @CFvalidations = (
'(?#Mandatory).',
'(?#Digits)^[\d.]+$',
my @CFvalidations = (
'(?#Mandatory).',
'(?#Digits)^[\d.]+$',
@@
-339,4
+351,5
@@
$LinkValueTo => undef
$IncludeContentForValue => undef
$BasedOn => undef
$UILocation => undef
$IncludeContentForValue => undef
$BasedOn => undef
$UILocation => undef
+$YesClone => undef
</%ARGS>
</%ARGS>
diff --git
a/rt/share/html/Ticket/Create.html
b/rt/share/html/Ticket/Create.html
index
0419126
..
8c6a58a
100755
(executable)
--- a/
rt/share/html/Ticket/Create.html
+++ b/
rt/share/html/Ticket/Create.html
@@
-293,8
+293,8
@@
if ($CloneTicket) {
};
$clone->{$_} = $CloneTicketObj->$_()
};
$clone->{$_} = $CloneTicketObj->$_()
- for qw/Owner Subject FinalPriority
TimeEstimated TimeWorked
- Status TimeLeft/;
+ for qw/Owner Subject FinalPriority
Status/;
+ # not TimeWorked, TimeEstimated, or TimeLeft
$clone->{$_} = $CloneTicketObj->$_->AsString
for grep { $CloneTicketObj->$_->Unix }
$clone->{$_} = $CloneTicketObj->$_->AsString
for grep { $CloneTicketObj->$_->Unix }
@@
-330,6
+330,7
@@
if ($CloneTicket) {
my $cfs = $CloneTicketObj->QueueObj->TicketCustomFields();
while ( my $cf = $cfs->Next ) {
my $cfs = $CloneTicketObj->QueueObj->TicketCustomFields();
while ( my $cf = $cfs->Next ) {
+ next if $cf->FirstAttribute('NoClone');
my $cf_id = $cf->id;
my $cf_values = $CloneTicketObj->CustomFieldValues( $cf->id );
my @cf_values;
my $cf_id = $cf->id;
my $cf_values = $CloneTicketObj->CustomFieldValues( $cf->id );
my @cf_values;