diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index 0f1bca679b..58c6ed239a 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -546,7 +546,7 @@ $lang->resource->story->batchChangeModule = 'batchChangeModule'; $lang->resource->story->batchToTask = 'batchToTask'; $lang->resource->story->processStoryChange = 'processStoryChange'; $lang->resource->story->linkStories = 'linkStoriesAB'; -$lang->resource->story->relieved = 'relievedSiblings'; +$lang->resource->story->relieved = 'relievedTwins'; $lang->story->methodOrder[5] = 'create'; $lang->story->methodOrder[10] = 'batchCreate'; diff --git a/module/task/js/edit.js b/module/task/js/edit.js index 940b5f3ae3..6d8da19d61 100644 --- a/module/task/js/edit.js +++ b/module/task/js/edit.js @@ -7,6 +7,25 @@ $(function() { $('#consumedSpan').parent().find('button').attr('disabled','disabled') } + + $('#mode').change(function() + { + var mode = $(this).val(); + if(mode != 'single') + { + $('#assignedTo').attr('disabled', 'disabled').trigger('chosen:updated') + $('.team-group').removeClass('hidden'); + $('#estimate').attr('disabled', 'disabled') + $('#left').attr('disabled', 'disabled') + } + else + { + $('#assignedTo').removeAttr('disabled').trigger('chosen:updated') + $('.team-group').addClass('hidden'); + $('#estimate').attr('disabled', false) + $('#left').attr('disabled', false) + } + }) }) /** @@ -118,7 +137,7 @@ $('#confirmButton').click(function() var $left = $tr.find('[name^=teamLeft]'); var left = parseFloat($left.val()); if(!isNaN(left)) totalLeft += left; - if(!$left.prop('readonly') && (isNaN(left) || left <= 0)) + if(!$left.prop('readonly') && (isNaN(left) || left <= 0) && team.length > 0) { bootbox.alert(account + ' ' + leftNotEmpty); error = true; @@ -165,12 +184,11 @@ $('#confirmButton').click(function() function updateAssignedTo() { var html = ''; - var multiple = $('#multiple').prop('checked'); + var mode = $('#mode').val(); var assignedTo = $('#assignedTo').val(); - if(multiple) + if(mode != 'single') { var isTeamMember = false; - var mode = $('#mode').val(); $('select[name^=team]').each(function() { if($(this).find('option:selected').text() == '') return; @@ -202,6 +220,6 @@ function updateAssignedTo() } $('#assignedTo').html(html); - if(multiple && mode == 'linear' && $('#modalTeam tr.member-doing').length == 0 && $('#modalTeam tr.member-wait').length >= 1) $('[name=assignedTo]').val($('#modalTeam tr.member-wait:first').find('select[name^=team]:first').val()); + if(mode != 'single' && mode == 'linear' && $('#modalTeam tr.member-doing').length == 0 && $('#modalTeam tr.member-wait').length >= 1) $('[name=assignedTo]').val($('#modalTeam tr.member-wait:first').find('select[name^=team]:first').val()); $('#assignedTo').trigger('chosen:updated'); } diff --git a/module/task/lang/de.php b/module/task/lang/de.php index 2aa3ae522e..b90beece49 100644 --- a/module/task/lang/de.php +++ b/module/task/lang/de.php @@ -215,6 +215,10 @@ $lang->task->reasonList['cancel'] = 'Abgebrochen'; $lang->task->modeList['linear'] = 'Multiple Person Serial'; $lang->task->modeList['multi'] = 'Multiple Person Parallel'; +$lang->task->editModeList['single'] = 'Single'; +$lang->task->editModeList['linear'] = 'Serial'; +$lang->task->editModeList['multi'] = 'Parallel'; + $lang->task->afterChoices['continueAdding'] = ' Weitere Aufgaben erfassen'; $lang->task->afterChoices['toTaskList'] = 'Zurück zur Aufgabenliste'; $lang->task->afterChoices['toStoryList'] = 'Zurück zur Storyliste'; diff --git a/module/task/lang/en.php b/module/task/lang/en.php index 9abac62024..37b9b265b2 100755 --- a/module/task/lang/en.php +++ b/module/task/lang/en.php @@ -215,6 +215,10 @@ $lang->task->reasonList['cancel'] = 'Cancelled'; $lang->task->modeList['linear'] = 'Multiple Person Serial'; $lang->task->modeList['multi'] = 'Multiple Person Parallel'; +$lang->task->editModeList['single'] = 'Single'; +$lang->task->editModeList['linear'] = 'Serial'; +$lang->task->editModeList['multi'] = 'Parallel'; + $lang->task->afterChoices['continueAdding'] = ' Continue Adding Tasks'; $lang->task->afterChoices['toTaskList'] = 'Go to Task List'; $lang->task->afterChoices['toStoryList'] = 'Go to Story List'; diff --git a/module/task/lang/zh-cn.php b/module/task/lang/zh-cn.php index 9e7904633c..22aaeae7b2 100755 --- a/module/task/lang/zh-cn.php +++ b/module/task/lang/zh-cn.php @@ -215,6 +215,10 @@ $lang->task->reasonList['cancel'] = '已取消'; $lang->task->modeList['linear'] = '多人串行'; $lang->task->modeList['multi'] = '多人并行'; +$lang->task->editModeList['single'] = '单人任务'; +$lang->task->editModeList['linear'] = '多人串行'; +$lang->task->editModeList['multi'] = '多人并行'; + $lang->task->afterChoices['continueAdding'] = "继续为该{$lang->SRCommon}添加任务"; $lang->task->afterChoices['toTaskList'] = '返回任务列表'; $lang->task->afterChoices['toStoryList'] = "返回{$lang->SRCommon}列表"; diff --git a/module/task/model.php b/module/task/model.php index beca5c1bb5..7879e5689f 100755 --- a/module/task/model.php +++ b/module/task/model.php @@ -1094,6 +1094,7 @@ class taskModel extends model ->setIF(strpos($this->config->task->edit->requiredFields, 'story') !== false, 'story', $this->post->story) ->setIF($this->post->story != false and $this->post->story != $oldTask->story, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story)) + ->setIF($this->post->mode == 'single', 'mode', '') ->setIF($this->post->status == 'done', 'left', 0) ->setIF($this->post->status == 'done' and !$this->post->finishedBy, 'finishedBy', $this->app->user->account) ->setIF($this->post->status == 'done' and !$this->post->finishedDate, 'finishedDate', $now) @@ -1193,6 +1194,11 @@ class taskModel extends model $this->dao->update(TABLE_TASK)->set('designVersion')->eq($design->version)->where('id')->eq($taskID)->exec(); } + if($_POST['mode'] == 'single') + { + $this->dao->delete()->from(TABLE_TASKTEAM)->where('task')->eq($taskID)->exec(); + } + /* Record task version. */ if(isset($task->version) and $task->version > $oldTask->version) { diff --git a/module/task/view/edit.html.php b/module/task/view/edit.html.php index be0c12c53d..111d1e2a6c 100644 --- a/module/task/view/edit.html.php +++ b/module/task/view/edit.html.php @@ -22,8 +22,8 @@ user->account);?> members);?> + task->confirmChangeExecution);?> - task->error->teamMember);?> lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?> error->gt, $lang->task->estimate, '0'))?> @@ -52,25 +52,15 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field)
task->name;?>
-
'> -
-
- - - -
- name, 'class="form-control task-name" placeholder="' . $lang->task->name . '"');?> +
+
+ + +
- children) and empty($task->parent) and $task->type != 'affair'):?> - -
- team) ? '' : 'checked';?> /> - -
-
- + name, 'class="form-control task-name" placeholder="' . $lang->task->name . '"');?>
@@ -140,6 +130,10 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field) parent, "class='form-control chosen'");?> + + task->mode;?> + status == 'wait' ? html::select('mode', $lang->task->editModeList, $task->mode, "class='form-control chosen'") : zget($lang->task->editModeList, $task->mode);?> + task->assignedTo;?> team) and $task->mode == 'linear') ? "disabled='disabled'" : '';?> @@ -159,15 +153,13 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field) $taskMembers = $members; } ?> - assignedTo, "class='form-control chosen' {$disableAssignedTo}");?> - - - task->mode;?> - task->modeList, $task->mode) . html::hidden('mode', $task->mode);?> - - ' id='teamTr'> - task->team;?> - task->team, '', "class='form-control btn' data-toggle='modal'");?> + +
+ mode != '' ? '' : 'hidden';?> + assignedTo, "class='form-control chosen' {$disableAssignedTo}");?> + task->team;?> +
+ task->type;?> diff --git a/module/task/view/taskteam.html.php b/module/task/view/taskteam.html.php index 9a12387608..febf882d29 100644 --- a/module/task/view/taskteam.html.php +++ b/module/task/view/taskteam.html.php @@ -87,7 +87,7 @@ if($task->mode == 'multi' and $app->rawMethod == 'activate') $hourDisabled = fal - task->assignedTo}'")?> + assignedTo) ? $task->assignedTo : '', "class='form-control chosen' data-placeholder='{$lang->task->assignedTo}'")?> @@ -341,7 +341,7 @@ $(document).ready(function() $(this).find('option:disabled').removeAttr('disabled').trigger("chosen:updated"); }) } - if($('#teamMember').val() != '') $taskTeamEditor.find('tfoot .btn').click(); + if($('#teamMember').val() != '' && page != 'edit') $taskTeamEditor.find('tfoot .btn').click(); }) }); diff --git a/module/task/view/view.html.php b/module/task/view/view.html.php index ef1ae75c0c..c032457253 100644 --- a/module/task/view/view.html.php +++ b/module/task/view/view.html.php @@ -339,9 +339,9 @@ task->team?> - task->estimate?> - task->consumed?> - task->left?> + task->estimateAB?> + task->consumedAB?> + task->leftAB?> statusAB;?>