Bug 222834 - Warn when trying to post worktime without comment

beta
Vitaliy Filippov 2017-10-04 18:24:28 +03:00
parent 155e56dfcb
commit 669b67215b
1 changed files with 15 additions and 0 deletions

View File

@ -257,7 +257,9 @@ function updateRemainingTime()
function changeform_onsubmit()
{
if (check_new_keywords(document.changeform) == false)
{
return false;
}
var wtInput = document.changeform.work_time;
if (!wtInput)
@ -280,6 +282,19 @@ function changeform_onsubmit()
return false;
}
}
if (awt)
{
var txt = document.getElementById('comment_textarea').value.trim();
if (txt === '')
{
var wtonly = document.getElementById('cmt_worktime').checked;
if (!wtonly)
{
alert('You have to specify a comment on this change');
return false;
}
}
}
wtInput.value = awt;
adjustRemainingTime();