Bug 131574 - Add all statuses in attachment page + save all statuses + resolutions

git-svn-id: svn://svn.office.custis.ru/3rdparty/bugzilla.org/trunk@1821 6955db30-a419-402b-8a0d-67ecbb4d7f56
custis
akrasilnikov 2013-09-30 11:39:15 +00:00
parent 6fa04949fb
commit ebf1a1967f
2 changed files with 68 additions and 9 deletions

View File

@ -559,13 +559,24 @@ sub insert
extra_data => $attachment->id });
# When changing the bug status, we have to follow the workflow.
my $bug_status = $cgi->param('bug_status');
($bug_status) = grep { $_->name eq $bug_status } @{$bug->status->can_change_to};
if ($bug_status && $bug_status->is_open
&& ($bug_status->name ne 'UNCONFIRMED' || $bug->product_obj->allows_unconfirmed))
{
$bug->set_status($bug_status->name);
$bug->clear_resolution();
# Custis Bug 131574 - Update bug status, bug resolution, bug duplicate
if (defined $cgi->param('bug_status')) {
my $bug_status = $cgi->param('bug_status');
($bug_status) = grep { $_->name eq $bug_status } @{$bug->status->can_change_to};
if ($bug_status->comment_required_on_change_from($bug->status) && !$comment)
{
ThrowUserError('comment_required', { old => $bug->status,
new => $bug_status });
}
$bug->set_status(
scalar $cgi->param('bug_status'),
{
resolution => scalar $cgi->param('resolution'),
dupe_of => scalar $cgi->param('dup_id')
}
);
}
# Assign the bug to the user, if they are allowed to take it

View File

@ -32,7 +32,7 @@
header = header
subheader = subheader
style_urls = [ 'skins/standard/create_attachment.css' ]
javascript_urls = [ "js/attachment.js" ]
javascript_urls = [ "js/attachment.js", "js/field.js" ]
doc_section = "attachments.html"
%]
@ -81,7 +81,7 @@
[% bug_statuses = [] %]
[% FOREACH bug_status = bug.status.can_change_to %]
[% NEXT IF bug_status.name == "UNCONFIRMED" && !bug.product_obj.allows_unconfirmed %]
[% bug_statuses.push(bug_status) IF bug_status.is_open %]
[% bug_statuses.push(bug_status) %]
[% END %]
[% IF bug_statuses.size %]
<tr>
@ -94,6 +94,54 @@
<option value="[% bug_status.name FILTER html %]">[% bug_status.name FILTER html %]</option>
[% END %]
</select>
[% IF bug.resolution OR bug.check_can_change_field('resolution', bug.resolution, 1) %]
<noscript><br>resolved&nbsp;as&nbsp;</noscript>
[% END %]
<span id="resolution_settings">
[% PROCESS bug/field.html.tmpl
no_tds = 1
field = bug_fields.resolution
value = bug.resolution
override_legal_values = bug.choices.resolution
editable = bug.check_can_change_field('resolution', bug.resolution, 1)
%]
</span>
<script type="text/javascript">
var close_status_array = [
[% FOREACH status = bug.choices.bug_status %]
[% NEXT IF status.is_open %]
'[% status.name FILTER js %]'[% ',' UNLESS loop.last %]
[% END %]
];
function onchange_bug_status()
{
showHideStatusItems('[% "is_duplicate" IF bug.dup_id %]', '[% bug.bug_status | js %]');
}
addListener('bug_status', 'change', onchange_bug_status);
addListener('resolution', 'change', showDuplicateItem);
addListener(window, 'load', function() {
showHideStatusItems('[% "is_duplicate" IF bug.dup_id %]', '[% bug.bug_status | js %]');
});
</script>
[% IF bug.check_can_change_field('dup_id', 0, 1) %]
<noscript><br> duplicate</noscript>
<span id="duplicate_settings">of
<span id="dup_id_container" class="bz_default_hidden">
[% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %]
(<a href="#" id="dup_id_edit_action">edit</a>)
</span>
<input id="dup_id" name="dup_id" size="6" value="[% bug.dup_id FILTER html %]">
</span>
[% IF bug.dup_id %]
<noscript>[% bug.dup_id FILTER bug_link(bug.dup_id) FILTER none %]</noscript>
[% END %]
[% ELSIF bug.dup_id %]
<noscript><br> duplicate</noscript>
<span id="duplicate_display">of
[% "${terms.bug} ${bug.dup_id}" FILTER bug_link(bug.dup_id) FILTER none %]</span>
[% END %]
</td>
</tr>
[% END %]