Pass work_time to create attachment form

i18n
Vitaliy Filippov 2016-07-27 15:14:55 +03:00
parent 76be373f40
commit ad5c5b6814
3 changed files with 16 additions and 5 deletions

View File

@ -515,6 +515,7 @@ sub enter
my $comment = $ARGS->{comment};
$comment = '' unless defined $comment;
$vars->{commenttext} = $comment;
$vars->{work_time} = $ARGS->{work_time};
# Generate and return the UI (HTML page) from the appropriate template.
Bugzilla->template->process("attachment/create.html.tmpl", $vars)

View File

@ -493,10 +493,20 @@ function to_attachment_page(link)
var form = document.createElement('form');
form.action = link.href;
form.method = 'post';
var textarea = document.createElement('textarea');
textarea.name = "comment";
textarea.value = document.getElementById('comment_textarea').value;
form.appendChild(textarea);
var e = document.createElement('input');
e.type = 'hidden';
e.name = 'comment';
e.value = document.getElementById('comment_textarea').value;
form.appendChild(e);
var w = document.getElementById('work_time');
if (w)
{
e = document.createElement('input');
e.type = 'hidden';
e.name = 'work_time';
e.value = w.value;
form.appendChild(e);
}
document.body.appendChild(form);
form.submit();
return false;

View File

@ -145,7 +145,7 @@
<tr>
<th><label for="work_time">Hours Worked:</label></th>
<td><input type="text" size="10" value="0.0" name="work_time" id="work_time" /></td>
<td><input type="text" size="10" value="[% work_time || '0.0' %]" name="work_time" id="work_time" /></td>
</tr>
<tr>
<th><label for="comment">Comment:</label></th>