Fix time saving on bug creating

parent be95dde1
......@@ -733,6 +733,12 @@ sub create {
my $keywords = delete $params->{keywords};
my $creation_comment = delete $params->{comment};
my $see_also = delete $params->{see_also};
# fix work and productive time on bug creating
my $work_time = delete $params->{work_time};
my $productive_time = delete $params->{productive_time};
# We don't want the bug to appear in the system until it's correctly
# protected by groups.
......@@ -823,6 +829,11 @@ sub create {
# We now have a bug id so we can fill this out
$creation_comment->{'bug_id'} = $bug->id;
# fix work and productive time writing on bug creating
$creation_comment->{'work_time'} = $work_time;
$creation_comment->{'productive_time'} = $productive_time;
# Insert the comment. We always insert a comment on bug creation,
# but sometimes it's blank.
Bugzilla::Comment->insert_create_data($creation_comment);
......
......@@ -13,7 +13,7 @@ var protocol = window.location.protocol;
var changed_remain = 0;
//Создание баги
var etersoft_create = 0;
var etersoft_create = window.location.href.search('enter') !== -1 ? 1 : 0;
// Объект таймера, создается при инициализации
// Подробнее про таймер см. timer_common.js
......@@ -151,6 +151,7 @@ Array.from(workTimeBtns).map(btn => {
// check comment before submit
let comment = document.querySelector("#comment").value;
if (comment.length !== 0) {
if (comment.length < 9) {
alert("Слишком короткий комментарий");
......@@ -165,7 +166,8 @@ Array.from(workTimeBtns).map(btn => {
alert("Вы указали отработанное время более 8 часов. Нужно обязательно разбивать комментирование своей работы за день на отдельные части.");
}
else {
mainCommitBtn.click();
let bugForm = etersoft_create === 1 ? "#Create" : "#changeform";
document.querySelector(bugForm).submit();
timer.clear();
}
} else {
......
......@@ -109,6 +109,8 @@ push(
see_also
estimated_time
deadline
work_time
productive_time
)
);
my %bug_params;
......
......@@ -368,6 +368,7 @@ TUI_hide_default('attachment_text_field');
<td colspan="2">
<input name="estimated_time" size="6" maxlength="6" value="[% estimated_time FILTER html %]">
<input name="work_time" id="work_time" value="0" hidden>
<input name="productive_time" id="productive_time" value="0" hidden>
</td>
</tr>
<tr>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment