if status changed to ongoing, set percent to 10

This commit is contained in:
Ralf Becker 2012-03-22 08:50:49 +00:00
parent dfa60e9825
commit 84d5784376

View File

@ -46,7 +46,11 @@ function status_changed(changed_id, status_id, percent_id, datecompleted_id)
{
case status_id:
completed = status.value == 'done' || status.value == 'billed';
if (completed || status.value == 'not-started') percent.value = completed ? 100 : 0;
if (completed || status.value == 'not-started' ||
(status.value == 'ongoing') != (percent.value > 0 && percent.value < 100))
{
percent.value = completed ? 100 : (status.value == 'not-started' ? 0 : 10);
}
break;
case percent_id: