* Finish task #75649.

This commit is contained in:
mayue
2022-11-11 17:02:17 +08:00
parent bf598b3f86
commit c92e9f119a
6 changed files with 47 additions and 25 deletions
+1 -1
View File
@@ -1347,7 +1347,7 @@ function createTaskMenu(options)
if(priv.canPauseTask && task.$col.type == 'developing') items.push({label: taskLang.pause, icon: 'pause', url: createLink('task', 'pause', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canRecordEstimateTask) items.push({label: executionLang.effort, icon: 'time', url: createLink('task', 'recordEstimate', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canActivateTask && (task.$col.type == 'developed' || task.$col.type == 'canceled' || task.$col.type == 'closed')) items.push({label: executionLang.activate, icon: 'magic', url: createLink('task', 'activate', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canCreateTask && !task.mode) items.push({label: taskLang.copy, icon: 'copy', url: createLink('task', 'create', 'executionID=' + executionID + '&storyID=' + '0' + '&moduleID=' + '0' + '&taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canCreateTask) items.push({label: taskLang.copy, icon: 'copy', url: createLink('task', 'create', 'executionID=' + executionID + '&storyID=' + '0' + '&moduleID=' + '0' + '&taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canCancelTask && (task.$col.type == 'wait' || task.$col.type == 'developing' || task.$col.type == 'pause')) items.push({label: taskLang.cancel, icon: 'cancel', url: createLink('task', 'cancel', 'taskID=' + task.id, '', 'true'), className: 'iframe', attrs: {'data-toggle': 'modal', 'data-width': '80%'}});
if(priv.canDeleteTask) items.push({label: taskLang.delete, icon: 'trash', onClick: function(){deleteCard('task', task.id, task.$lane.region)}});
return items;
+1
View File
@@ -62,6 +62,7 @@ class task extends control
$task = new stdClass();
$task->module = $moduleID;
$task->mode = '';
$task->assignedTo = '';
$task->name = '';
$task->story = $storyID;
+27 -17
View File
@@ -27,6 +27,32 @@ $(function()
loadStories(executionID);
})
/**
* Show team menu.
*
* @access public
* @return void
*/
function showTeamMenu()
{
if($('[name^=multiple]').prop('checked'))
{
$('#assignedTo, #assignedTo_chosen').addClass('hidden');
$('#assignedTo').next('.picker').addClass('hidden');
$('.team-group').removeClass('hidden');
$('.modeBox').removeClass('hidden');
$('#estimate').attr('readonly', true);
}
else
{
$('#assignedTo, #assignedTo_chosen').removeClass('hidden');
$('#assignedTo').next('.picker').removeClass('hidden');
$('.team-group').addClass('hidden');
$('.modeBox').addClass('hidden');
$('#estimate').attr('readonly', false);
}
$('#dataPlanGroup').fixInputGroup();
}
/**
* Load module, stories and members.
*
@@ -518,23 +544,7 @@ $(document).ready(function()
/* Show team menu. */
$('[name^=multiple]').change(function()
{
if($(this).prop('checked'))
{
$('#assignedTo, #assignedTo_chosen').addClass('hidden');
$('#assignedTo').next('.picker').addClass('hidden');
$('.team-group').removeClass('hidden');
$('.modeBox').removeClass('hidden');
$('#estimate').attr('readonly', true);
}
else
{
$('#assignedTo, #assignedTo_chosen').removeClass('hidden');
$('#assignedTo').next('.picker').removeClass('hidden');
$('.team-group').addClass('hidden');
$('.modeBox').addClass('hidden');
$('#estimate').attr('readonly', false);
}
$('#dataPlanGroup').fixInputGroup();
showTeamMenu();
});
$('#showAllModule').change(function()
+1 -1
View File
@@ -4132,7 +4132,7 @@ class taskModel extends model
$menu .= "<div class='divider'></div>";
$menu .= $this->buildMenu('task', 'edit', $params, $task, 'view', '', '', 'showinonlybody');
if(empty($task->team)) $menu .= $this->buildMenu('task', 'create', "projctID={$task->execution}&storyID=0&moduleID=0&taskID=$task->id", $task, 'view', 'copy');
$menu .= $this->buildMenu('task', 'create', "projctID={$task->execution}&storyID=0&moduleID=0&taskID=$task->id", $task, 'view', 'copy');
$menu .= $this->buildMenu('task', 'delete', "executionID=$task->execution&taskID=$task->id", $task, 'view', 'trash', 'hiddenwin', 'showinonlybody', true);
if($task->parent > 0) $menu .= $this->buildMenu('task', 'view', "taskID=$task->parent", $task, 'view', 'chevron-double-up', '', '', '', '', $this->lang->task->parent);
+1 -1
View File
@@ -86,7 +86,7 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
</tr>
<tr class='hidden modeBox'>
<th><?php echo $lang->task->mode;?></th>
<td><?php echo html::select('mode', $lang->task->modeList, '', "class='form-control chosen'");?></td>
<td><?php echo html::select('mode', $lang->task->modeList, $task->mode, "class='form-control chosen'");?></td>
</tr>
<?php if($execution->type == 'kanban'):?>
<tr>
+16 -5
View File
@@ -48,6 +48,12 @@ if($task->mode == 'multi' and $app->rawMethod == 'activate') $hourDisabled = fal
<?php if($memberDisabled) echo html::hidden("team[]", $member->account);?>
</td>
<td class='hourBox'>
<?php if($app->rawMethod == 'create'):?>
<div class='input-group estimateBox'>
<?php echo html::input("teamEstimate[]", (float)$member->estimate, "class='form-control text-center' placeholder='{$lang->task->estimateAB}'") ?>
<span class='input-group-addon'><?php echo 'h';?></span>
</div>
<?php else:?>
<div class='input-group'>
<div class="input-control has-icon-right">
<?php echo html::input("teamEstimate[]", (float)$member->estimate, "class='form-control text-center' placeholder='{$lang->task->estimate}'" . ($hourDisabled ? ' readonly' : ''))?>
@@ -62,11 +68,12 @@ if($task->mode == 'multi' and $app->rawMethod == 'activate') $hourDisabled = fal
<label class="input-control-icon-right">h</label>
</div>
</div>
<?php endif;?>
</td>
<td class='w-100px sort-handler'>
<button type="button" <?php echo $memberDisabled ? 'disabled' : '';?> class="btn btn-link btn-sm btn-icon btn-add"><i class="icon icon-plus"></i></button>
<button type="button" <?php echo $memberDisabled ? 'disabled' : '';?> class="btn btn-link btn-sm btn-icon btn-delete"><i class="icon icon-trash"></i></button>
<?php if(isset($task->mode) and $task->mode == 'linear'):?>
<?php if(!empty($task->mode) and $task->mode == 'linear'):?>
<button type="button" <?php echo $sortDisabled ? 'disabled' : '';?> class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
<?php endif;?>
</td>
@@ -84,7 +91,7 @@ if($task->mode == 'multi' and $app->rawMethod == 'activate') $hourDisabled = fal
<?php echo html::hidden("teamSource[]", '');?>
</td>
<td class='hourBox'>
<?php if(empty($task->team)):?>
<?php if(empty($task->team) or $app->rawMethod == 'create'):?>
<div class='input-group estimateBox'>
<?php echo html::input("teamEstimate[]", '', "class='form-control text-center' placeholder='{$lang->task->estimateAB}'") ?>
<span class='input-group-addon'><?php echo 'h';?></span>
@@ -117,7 +124,7 @@ if($task->mode == 'multi' and $app->rawMethod == 'activate') $hourDisabled = fal
<?php $newRowCount = (!empty($task->team) and count($task->team) < 6) ? 6 - count($task->team) : 1;?>
<?php if(isset($task->status) and $task->status != 'wait' and $task->status != 'doing') $newRowCount = 0;?>
<?php js::set('newRowCount', $newRowCount);?>
<?php if(isset($task->mode) and $task->mode == 'linear') js::set('sortSelector', 'tr.member-wait');?>
<?php if(!empty($task->mode) and $task->mode == 'linear') js::set('sortSelector', 'tr.member-wait');?>
<?php js::set('teamMemberError', $lang->task->error->teamMember);?>
<?php if(isset($task->status)):?>
<?php js::set('taskStatus', $task->status);?>
@@ -133,10 +140,14 @@ if($task->mode == 'multi' and $app->rawMethod == 'activate') $hourDisabled = fal
<script>
$(document).ready(function()
{
<?php if(!empty($task->mode) and $app->rawMethod == 'create'):?>
$('#multipleBox').attr('checked', 'checked');
showTeamMenu();
<?php endif;?>
$('tr.teamTemplate').closest('tbody.sortable').sortable('destroy');
<?php if(!isset($task->mode) or $task->mode != 'multi'):?>
<?php if(empty($task->mode) or $task->mode != 'multi'):?>
var canSort = false;
var options = {
trigger: '.icon-move',
@@ -176,7 +187,7 @@ $(document).ready(function()
var disableMembers = function()
{
var mode = $('#mode').length > 0 ? $('#mode').val() : '<?php echo (isset($task->mode) ? $task->mode : '')?>';
var mode = $('#mode').length > 0 ? $('#mode').val() : '<?php echo (!empty($task->mode) ? $task->mode : '')?>';
if(mode == 'multi')
{
var members = [];