Fix cf_extbug setting on bug clone

master
Vitaliy Filippov 2014-05-19 13:33:45 +04:00
parent 8ff95acae2
commit 1cc0fa1590
4 changed files with 14 additions and 10 deletions

View File

@ -573,7 +573,7 @@ if ($cloned_bug_id)
$vars->{commentprivacy} = $isprivate;
}
Bugzilla::Hook::process('enter_bug_cloned_bug', { vars => $vars, product => $product, cloned_bug => $cloned_bug });
Bugzilla::Hook::process('enter_bug_cloned_bug', { vars => $vars, default => \%default, product => $product, cloned_bug => $cloned_bug });
} # end of cloned bug entry form
else
{

View File

@ -124,12 +124,12 @@ sub enter_bug_cloned_bug
my ($args) = @_;
if (($args->{product}->extproduct || 0) == $args->{cloned_bug}->product_id)
{
$args->{vars}->{cf_extbug} = $args->{cloned_bug}->id;
$args->{default}->{cf_extbug} = $args->{cloned_bug}->id;
}
elsif (($args->{cloned_bug}->product_obj->extproduct || 0) == $args->{product}->id)
{
$args->{vars}->{dependson} = $args->{cloned_bug}->id;
$args->{vars}->{blocked} = '';
$args->{default}->{dependson} = $args->{cloned_bug}->id;
$args->{default}->{blocked} = '';
}
return 1;
}

View File

@ -326,7 +326,8 @@ var noTimeTracking = [% product.notimetracking ? 'true' : 'false' %];
[% INCLUDE bug/field.html.tmpl
bug = default
field = field
value_name = default.${field.name}
value_name = field.is_select ? default.${field.name} : ''
value = field.is_select ? '' : default.${field.name}
editable = 1
value_span = 3
%]

View File

@ -90,12 +90,14 @@
Calendar.set('[% field.name | js %]')
</script>
[% CASE constants.FIELD_TYPE_BUG_ID %]
<span id="[% field.name | html %]_input_area">
<input name="[% field.name | html %]" id="[% field.name | html %]"
[% IF tabindex %] tabindex="[% tabindex | html %]"[% END %]
value="[% value | html %]" size="7" />
</span>
<span id="[% field.name | html %]_input_area">
<input name="[% field.name | html %]" id="[% field.name | html %]"
[% IF tabindex %] tabindex="[% tabindex | html %]"[% END %]
value="[% value | html %]" size="7" />
</span>
[%# Do not hide input on bug creation form %]
[% IF bug.id %]
[% IF bug.${field.name} %]
[% bug.${field.name} | bug_link(bug.${field.name}) | none %]
[% END %]
@ -111,6 +113,7 @@
"[% bug.${field.name} | js %]"
);
</script>
[% END %]
[% CASE constants.FIELD_TYPE_EXTURL %]
<span id="[% field.name | html %]_input_area">
<input name="[% field.name | html %]" id="[% field.name | html %]"