diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 277c580271..3112a0dd8b 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -9,9 +9,16 @@ $(function() var $source = $(this).siblings('[name^=source]'); if($source.val() == '') return; + var $tr = $(this).closest('tr'); var consumed = 0; - if($(this).val() == $source.val()) consumed = $(this).closest('tr').attr('data-consumed'); - $(this).closest('tr').find('[name^=teamConsumed]').val(consumed); + var estimate = $tr.attr('data-left');; + if($(this).val() == $source.val()) + { + consumed = $tr.attr('data-consumed'); + estimate = $tr.attr('data-estimate'); + } + $tr.find('[name^=teamConsumed]').val(consumed); + $tr.find('[name^=teamEstimate]').val(estimate); }); $('#modalTeam select:enabled').change() }) diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index 6cc41feb18..f22d509a1d 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -277,19 +277,12 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field) team as $member):?> consumed > 0) - { - $memberStatus = 'doing'; - if($member->left == 0) $memberStatus = 'done'; - } - $memberDisabled = false; $linearDisabled = false; - if($memberStatus == 'done') $memberDisabled = true; - if($memberStatus != 'wait' and $task->mode == 'linear') $linearDisabled = true; + if($member->status == 'done') $memberDisabled = true; + if($member->status != 'wait' and $task->mode == 'linear') $linearDisabled = true; ?> - + account, "class='form-control chosen'" . ($memberDisabled ? ' disabled' : ''))?> account);?> diff --git a/module/task/view/editteam.html.php b/module/task/view/editteam.html.php index 6069841af6..b5771db9c5 100755 --- a/module/task/view/editteam.html.php +++ b/module/task/view/editteam.html.php @@ -57,19 +57,12 @@ team as $member):?> consumed > 0) - { - $memberStatus = 'doing'; - if($member->left == 0) $memberStatus = 'done'; - } - $memberDisabled = false; $linearDisabled = false; - if($memberStatus == 'done') $memberDisabled = true; - if($memberDisabled and $task->mode == 'linear') $linearDisabled = true; + if($member->status == 'done') $memberDisabled = true; + if($member->status != 'wait' and $task->mode == 'linear') $linearDisabled = true; ?> - + account, "class='form-control chosen'" . ($memberDisabled ? ' disabled' : ''))?> account);?>