Merge branch 'master' into zenops_46_tanghucheng

This commit is contained in:
tanghucheng
2022-12-15 15:27:59 +08:00
230 changed files with 11052 additions and 2442 deletions
+31 -5
View File
@@ -7,6 +7,33 @@ $(function()
{
$('#consumedSpan').parent().find('button').attr('disabled','disabled')
}
$('#mode').change(function()
{
var mode = $(this).val();
if(mode != 'single')
{
if(mode != 'multi')
{
$('#assignedTo').attr('disabled', 'disabled').trigger('chosen:updated')
}
else
{
$('#assignedTo').removeAttr('disabled').trigger('chosen:updated')
}
$('.team-group').removeClass('hidden');
$('#estimate').attr('readonly', 'readonly');
$('#left').attr('readonly', 'readonly');
}
else
{
$('#assignedTo').removeAttr('disabled').trigger('chosen:updated')
$('.team-group').addClass('hidden');
$('#estimate').removeAttr('readonly');
$('#left').removeAttr('readonly');
}
})
})
/**
@@ -118,7 +145,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 +192,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 +228,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');
}
+6 -2
View File
@@ -213,8 +213,12 @@ $lang->task->reasonList[''] = '';
$lang->task->reasonList['done'] = 'Erledigt';
$lang->task->reasonList['cancel'] = 'Abgebrochen';
$lang->task->modeList['linear'] = 'Serial';
$lang->task->modeList['multi'] = 'Parallel';
$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';
+6 -2
View File
@@ -213,8 +213,12 @@ $lang->task->reasonList[''] = '';
$lang->task->reasonList['done'] = 'Done';
$lang->task->reasonList['cancel'] = 'Cancelled';
$lang->task->modeList['linear'] = 'Serial';
$lang->task->modeList['multi'] = 'Parallel';
$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';
+6 -2
View File
@@ -213,8 +213,12 @@ $lang->task->reasonList[''] = '';
$lang->task->reasonList['done'] = 'Fait';
$lang->task->reasonList['cancel'] = 'Annulé';
$lang->task->modeList['linear'] = 'Serial';
$lang->task->modeList['multi'] = 'Parallel';
$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'] = ' Continuer Ajouter Tâches';
$lang->task->afterChoices['toTaskList'] = 'Aller à la liste des Tâches';
+6 -2
View File
@@ -213,8 +213,12 @@ $lang->task->reasonList[''] = '';
$lang->task->reasonList['done'] = '已完成';
$lang->task->reasonList['cancel'] = '已取消';
$lang->task->modeList['linear'] = '串行';
$lang->task->modeList['multi'] = '并行';
$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'] = '返回任务列表';
+51 -4
View File
@@ -153,7 +153,12 @@ class taskModel extends model
$requiredFields = trim($requiredFields, ',');
/* Fix Bug #2466 */
if($this->post->multiple) $task->assignedTo = '';
if($this->post->multiple) $task->assignedTo = '';
if($task->mode == 'multi')
{
$task->assignedTo = isset($_POST['team'][0]) ? $_POST['team'][0] : '';
$task->assignedDate = helper::now();
}
if(!$this->post->multiple or count(array_filter($this->post->team)) < 1) $task->mode = '';
$this->dao->insert(TABLE_TASK)->data($task, $skip = 'gitlab,gitlabProject')
->autoCheck()
@@ -940,9 +945,10 @@ class taskModel extends model
/* Insert or update team. */
if($mode == 'multi' and isset($teams[$account]))
{
$this->dao->update(TABLE_TASKTEAM)->set("estimate= estimate + {$member->estimate}")
->set("`left` = `left` + {$member->left}")
->set("`consumed` = `consumed` + {$member->consumed}")
$this->dao->update(TABLE_TASKTEAM)
->beginIF($member->estimate)->set("estimate= estimate + {$member->estimate}")->fi()
->beginIF($member->left)->set("`left` = `left` + {$member->left}")->fi()
->beginIF($member->consumed)->set("`consumed` = `consumed` + {$member->consumed}")->fi()
->where('task')->eq($member->task)
->andWhere('account')->eq($member->account)
->exec();
@@ -1066,6 +1072,7 @@ class taskModel extends model
/* If a multiple task is assigned to a team member who is not the task, assign to the team member instead. */
if(!$this->post->assignedTo and !empty($oldTask->team) and !empty($_POST['team'])) $_POST['assignedTo'] = $this->getAssignedTo4Multi($_POST['team'], $oldTask);
if(!$oldTask->mode and !$this->post->assignedTo and !empty($_POST['team'])) $_POST['assignedTo'] = $_POST['team'][0];
/* When the selected parent task is a common task and has consumption, select other parent tasks. */
if($this->post->parent > 0)
@@ -1094,6 +1101,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 +1201,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)
{
@@ -4366,6 +4379,40 @@ class taskModel extends model
}
}
/**
* Get task list by conditions.
*
* @param object $conds
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getListByConds($conds, $orderBy = 'id_desc', $pager = null)
{
foreach(array('priList' => array(), 'assignedToList' => array(), 'statusList' => array(), 'idList' => array(), 'taskName' => '') as $condKey => $defaultValue)
{
if(!isset($conds->$condKey))
{
$conds->$condKey = $defaultValue;
continue;
}
if(strripos($condKey, 'list') === strlen($condKey) - 4 && !is_array($conds->$condKey)) $conds->$condKey = array_filter(explode(',', $conds->$condKey));
}
return $this->dao->select('*')->from(TABLE_TASK)
->where('deleted')->eq(0)
->beginIF(!empty($conds->priList))->andWhere('pri')->in($conds->priList)->fi()
->beginIF(!empty($conds->assignedToList))->andWhere('assignedTo')->in($conds->assignedToList)->fi()
->beginIF(!empty($conds->statusList))->andWhere('status')->in($conds->statusList)->fi()
->beginIF(!empty($conds->idList))->andWhere('id')->in($conds->idList)->fi()
->beginIF(!empty($conds->taskName))->andWhere('name')->like("%{$conds->taskName}%")
->beginIF(!$this->app->user->admin)->andWhere('execution')->in($this->app->user->view->sprints)->fi()
->orderBy($orderBy)
->page($pager)
->fetchAll('id');
}
/**
* Get teamTask members.
*
+3 -6
View File
@@ -79,16 +79,13 @@ foreach(explode(',', $config->task->create->requiredFields) as $field)
</div>
</td>
<td>
<div class="checkbox-primary c-multipleTask affair">
<div class="checkbox-primary c-multipleTask affair" style='display: inline-block'>
<input type="checkbox" name="multiple" value="1" id="multipleBox" /><label for="multipleBox" class="no-margin"><?php echo $lang->task->multiple;?></label>
</div>
<button id='selectAllUser' type="button" class="btn btn-link<?php if($task->type !== 'affair') echo ' hidden';?>"><?php echo $lang->task->selectAllUser;?></button>
<div class='hidden modeBox' style='display: inline-block'><?php echo html::radio('mode', $lang->task->modeList, !empty($task->mode) ? $task->mode: 'linear');?></div>
<button id='selectAllUser' type="button" class="btn btn-link<?php if($task->type !== 'affair') echo ' hidden';?>"><?php echo $lang->task->selectAllUser;?></button>
</td>
</tr>
<tr class='hidden modeBox'>
<th><?php echo $lang->task->mode;?></th>
<td><?php echo html::select('mode', $lang->task->modeList, $task->mode, "class='form-control chosen'");?></td>
</tr>
<?php if($execution->type == 'kanban'):?>
<tr>
<th><?php echo $lang->kanbancard->region;?></th>
+38 -28
View File
@@ -22,8 +22,8 @@
<?php js::set('currentUser', $app->user->account);?>
<?php js::set('team', $task->members);?>
<?php js::set('members', $members);?>
<?php js::set('page', 'edit');?>
<?php js::set('confirmChangeExecution', $lang->task->confirmChangeExecution);?>
<?php js::set('teamMemberError', $lang->task->error->teamMember);?>
<?php js::set('totalLeftError', sprintf($this->lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?>
<?php js::set('estimateNotEmpty', sprintf($lang->error->gt, $lang->task->estimate, '0'))?>
@@ -52,25 +52,15 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field)
<div class='detail-title'><?php echo $lang->task->name;?></div>
<div class='detail-content'>
<div class='form-group'>
<div class='<?php if(empty($task->children) and empty($task->parent) and $task->type != 'affair') echo 'input-group';?>'>
<div class="input-control has-icon-right">
<div class="colorpicker">
<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown" title="<?php echo $lang->task->colorTag ?>"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
<ul class="dropdown-menu clearfix">
<li class="heading"><?php echo $lang->task->colorTag;?><i class="icon icon-close"></i></li>
</ul>
<input type="hidden" class="colorpicker" id="color" name="color" value="<?php echo $task->color ?>" data-icon="color" data-wrapper="input-control-icon-right" data-update-color=".task-name" data-provide="colorpicker">
</div>
<?php echo html::input('name', $task->name, 'class="form-control task-name" placeholder="' . $lang->task->name . '"');?>
<div class="input-control has-icon-right">
<div class="colorpicker">
<button type="button" class="btn btn-link dropdown-toggle" data-toggle="dropdown" title="<?php echo $lang->task->colorTag ?>"><span class="cp-title"></span><span class="color-bar"></span><i class="ic"></i></button>
<ul class="dropdown-menu clearfix">
<li class="heading"><?php echo $lang->task->colorTag;?><i class="icon icon-close"></i></li>
</ul>
<input type="hidden" class="colorpicker" id="color" name="color" value="<?php echo $task->color ?>" data-icon="color" data-wrapper="input-control-icon-right" data-update-color=".task-name" data-provide="colorpicker">
</div>
<?php if(empty($task->children) and empty($task->parent) and $task->type != 'affair'):?>
<span class='input-group-addon'>
<div class='checkbox-primary'>
<input type='checkBox' name='multiple' id='multiple' value='1' disabled <?php echo empty($task->team) ? '' : 'checked';?> />
<label for='multiple'><?php echo $lang->task->multipleAB;?></label>
</div>
</span>
<?php endif;?>
<?php echo html::input('name', $task->name, 'class="form-control task-name" placeholder="' . $lang->task->name . '"');?>
</div>
</div>
</div>
@@ -140,6 +130,28 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field)
<td><?php echo html::select('parent', $tasks, $task->parent, "class='form-control chosen'");?></td>
</tr>
<?php endif;?>
<tr class="modeBox">
<th><?php echo $lang->task->mode;?></th>
<td>
<?php
if($task->status == 'wait')
{
echo html::select('mode', $lang->task->editModeList, $task->mode, "class='form-control chosen'");
}
else
{
if($task->mode == '')
{
echo $lang->task->editModeList['single'];
}
else
{
echo zget($lang->task->editModeList, $task->mode);
}
}
?>
</td>
</tr>
<tr>
<th><?php echo $lang->task->assignedTo;?></th>
<?php $disableAssignedTo = (!empty($task->team) and $task->mode == 'linear') ? "disabled='disabled'" : '';?>
@@ -159,15 +171,13 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field)
$taskMembers = $members;
}
?>
<td><span id="assignedToIdBox"><?php echo html::select('assignedTo', $taskMembers, $task->assignedTo, "class='form-control chosen' {$disableAssignedTo}");?></span></td>
</tr>
<tr class="modeBox <?php echo $task->mode ? '' : 'hidden';?>">
<th><?php echo $lang->task->mode;?></th>
<td><?php echo zget($lang->task->modeList, $task->mode) . html::hidden('mode', $task->mode);?></td>
</tr>
<tr class='<?php echo empty($task->team) ? 'hidden' : ''?>' id='teamTr'>
<th><?php echo $lang->task->team;?></th>
<td><?php echo html::a('#modalTeam', $lang->task->team, '', "class='form-control btn' data-toggle='modal'");?></td>
<td>
<div class='input-group' id='assignedToIdBox'>
<?php $hiddenTeam = $task->mode != '' ? '' : 'hidden';?>
<?php echo html::select('assignedTo', $taskMembers, $task->assignedTo, "class='form-control chosen' {$disableAssignedTo}");?>
<span class="input-group-btn team-group <?php echo $hiddenTeam;?>"><a class="btn br-0" href="#modalTeam" data-toggle="modal"><?php echo $lang->task->team;?></a></span>
</div>
</td>
</tr>
<tr>
<th><?php echo $lang->task->type;?></th>
+5 -8
View File
@@ -8,7 +8,6 @@
<?php if($app->rawMethod != 'create'):?>
<style>
#modalTeam .modal-dialog {width: 855px;}
#taskTeamEditor .hourBox {padding-bottom: 1px;}
</style>
<?php endif;?>
<?php if($app->rawMethod == 'assignto'):?>
@@ -145,19 +144,17 @@ $(document).ready(function()
showTeamMenu();
<?php endif;?>
<?php if(isset($task->mode) and $task->mode == 'multi'):?>
$('tr.teamTemplate').closest('tbody.sortable').sortable('destroy');
<?php if(empty($task->mode) or $task->mode != 'multi'):?>
var canSort = false;
<?php else:?>
var options = {
trigger: '.icon-move',
selector: 'tr.teamTemplate',
selector: '.icon-move',
dragCssClass: 'drag-row',
reverse: true,
finish: setLineNumber
}
$('#taskTeamEditor > .sortable').sortable(options);
$('#taskTeamEditor tbody.sortable').sortable(options);
<?php endif;?>
/* Init task team manage dialog */
@@ -341,7 +338,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();
})
});
+4 -4
View File
@@ -24,7 +24,7 @@
<div class="page-title">
<span class="label label-id"><?php echo $task->id?></span>
<span class="text" title='<?php echo $task->name;?>' style='color: <?php echo $task->color; ?>'>
<?php if(!empty($task->team)) echo '<span class="label label-badge label-primary no-margin">' . $lang->task->multipleAB . (common::checkNotCN() ? ' ' : '') . $lang->task->modeList[$task->mode] . '</span>';?>
<?php if(!empty($task->team)) echo '<span class="label label-badge label-primary no-margin">' . (common::checkNotCN() ? ' ' : '') . $lang->task->modeList[$task->mode] . '</span>';?>
<?php if($task->parent > 0) echo '<span class="label label-badge label-primary no-margin">' . $lang->task->childrenAB . '</span>';?>
<?php if($task->parent > 0) echo isset($task->parentName) ? html::a(inlink('view', "taskID={$task->parent}"), $task->parentName) . ' / ' : '';?><?php echo $task->name;?>
</span>
@@ -339,9 +339,9 @@
<thead>
<tr>
<th><?php echo $lang->task->team?></th>
<th class='text-center c-hours'><?php echo $lang->task->estimate?></th>
<th class='text-center c-hours'><?php echo $lang->task->consumed?></th>
<th class='text-center c-hours'><?php echo $lang->task->left?></th>
<th class='text-center c-hours'><?php echo $lang->task->estimateAB?></th>
<th class='text-center c-hours'><?php echo $lang->task->consumedAB?></th>
<th class='text-center c-hours'><?php echo $lang->task->leftAB?></th>
<th class='text-center'><?php echo $lang->statusAB;?></th>
</tr>
</thead>