* Code for task #65278.

This commit is contained in:
sunguangming
2022-08-17 16:51:28 +08:00
parent 583055fee3
commit 7f69b62231
9 changed files with 68 additions and 50 deletions
+1 -1
View File
@@ -14,7 +14,7 @@
<?php include '../../common/view/kindeditor.html.php';?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<?php if(!empty($task->team) and (!isset($task->team[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
<?php if(!empty($task->members) and (!isset($task->members[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
<div class="alert with-icon">
<i class="icon-exclamation-sign"></i>
<div class="content">
+5 -2
View File
@@ -281,8 +281,11 @@ foreach(explode(',', $config->task->edit->requiredFields) as $field)
<?php foreach($task->team as $member):?>
<?php
$memberStatus = 'wait';
if($member->consumed > 0) $memberStatus = 'doing';
if(strpos($task->finishedList, ",{$member->account},") !== false) $memberStatus = 'done';
if($member->consumed > 0)
{
$memberStatus = 'doing';
if($member->left == 0) $memberStatus = 'done';
}
$memberDisabled = false;
$linearDisabled = false;
+28 -8
View File
@@ -21,7 +21,7 @@
<?php js::set('totalLeftError', sprintf($this->lang->task->error->leftEmptyAB, $this->lang->task->statusList[$task->status]));?>
<div id='mainContent' class='main-content'>
<div class='center-block' id='taskTeamEditor'>
<?php if(empty($task->team) and !isset($task->team[$app->user->account])):?>
<?php if(empty($task->members) and !isset($task->members[$app->user->account])):?>
<div class="alert with-icon">
<i class="icon-exclamation-sign"></i>
<div class="content">
@@ -56,27 +56,47 @@
</td>
</tr>
<?php foreach($task->team as $member):?>
<?php
$memberStatus = 'wait';
if($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;
?>
<tr>
<td class='w-250px'><?php echo html::select("team[]", $members, $member->account, "class='form-control chosen'")?></td>
<td class='w-250px'>
<?php echo html::select("team[]", $members, $member->account, "class='form-control chosen'" . ($memberDisabled ? ' disabled' : ''))?>
<?php echo html::hidden("source[]", $member->account);?>
<?php if($memberDisabled) echo html::hidden("team[]", $member->account);?>
</td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->task->estimate?></span>
<?php echo html::input("teamEstimate[]", (float)$member->estimate, "class='form-control text-center' placeholder='{$lang->task->hour}'")?>
<?php echo html::input("teamEstimate[]", (float)$member->estimate, "class='form-control text-center' placeholder='{$lang->task->hour}'" . ($memberDisabled ? ' readonly' : ''));?>
<span class='input-group-addon fix-border'><?php echo $lang->task->consumed?></span>
<?php echo html::input("teamConsumed[]", (float)$member->consumed, "class='form-control text-center' readonly placeholder='{$lang->task->hour}'")?>
<span class='input-group-addon fix-border'><?php echo $lang->task->left?></span>
<?php echo html::input("teamLeft[]", (float)$member->left, "class='form-control text-center' placeholder='{$lang->task->hour}'")?>
<?php echo html::input("teamLeft[]", (float)$member->left, "class='form-control text-center' placeholder='{$lang->task->hour}'" . ($memberDisabled ? ' readonly' : ''))?>
</div>
</td>
<td class='w-130px sort-handler'>
<button type="button" class="btn btn-link btn-sm btn-icon btn-add"><i class="icon icon-plus"></i></button>
<button type='button' class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
<button type="button" class="btn btn-link btn-sm btn-icon btn-delete"><i class="icon icon-close"></i></button>
<button type="button" <?php echo $linearDisabled ? 'disabled' : '';?> class="btn btn-link btn-sm btn-icon btn-add"><i class="icon icon-plus"></i></button>
<button type='button' <?php echo $linearDisabled ? 'disabled' : '';?> class='btn btn-link btn-sm btn-icon btn-move'><i class='icon-move'></i></button>
<button type="button" <?php echo $linearDisabled ? 'disabled' : '';?> class="btn btn-link btn-sm btn-icon btn-delete"><i class="icon icon-close"></i></button>
</td>
</tr>
<?php endforeach;?>
<tr class='template'>
<td class='w-250px'><?php echo html::select("team[]", $members, '', "class='form-control chosen'")?></td>
<td class='w-250px'>
<?php echo html::select("team[]", $members, '', "class='form-control chosen'")?>
<?php echo html::hidden("source[]", '');?>
</td>
<td>
<div class='input-group'>
<span class='input-group-addon'><?php echo $lang->task->estimate?></span>
+1 -1
View File
@@ -17,7 +17,7 @@
<?php js::set('consumedEmpty', $lang->task->error->consumedEmptyAB);?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<?php if(!empty($task->team) and (!isset($task->team[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
<?php if(!empty($task->members) and (!isset($task->members[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
<div class="alert with-icon">
<i class="icon-exclamation-sign"></i>
<div class="content">
+1 -1
View File
@@ -14,7 +14,7 @@
<?php include '../../common/view/kindeditor.html.php';?>
<div id='mainContent' class='main-content'>
<div class='center-block'>
<?php if(!empty($task->team) and (!isset($task->team[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
<?php if(!empty($task->members) and (!isset($task->members[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
<div class="alert with-icon">
<i class="icon-exclamation-sign"></i>
<div class="content">
+5 -5
View File
@@ -21,8 +21,8 @@
<?php endif;?>
#recordForm table .form-actions{padding:25px;}
</style>
<?php $team = array_keys($task->team);?>
<?php js::set('confirmRecord', (!empty($team) && $task->assignedTo != end($team)) ? $lang->task->confirmTransfer : $lang->task->confirmRecord);?>
<?php $members = $task->members;?>
<?php js::set('confirmRecord', (!empty($members) && $task->assignedTo != end($members)) ? $lang->task->confirmTransfer : $lang->task->confirmRecord);?>
<?php js::set('noticeSaveRecord', $lang->task->noticeSaveRecord);?>
<?php js::set('today', helper::today());?>
<div id='mainContent' class='main-content'>
@@ -45,7 +45,7 @@
<th class="thWidth"><?php echo $lang->task->consumed;?></th>
<th class="thWidth"><?php echo $lang->task->left;?></th>
<th><?php echo $lang->comment;?></th>
<th class='c-actions-2'><?php if(empty($task->team) or $task->assignedTo == $this->app->user->account or ($task->mode == 'multi' and isset($task->team[$app->user->account]))) echo $lang->actions;?></th>
<th class='c-actions-2'><?php if(empty($members) or $task->assignedTo == $this->app->user->account or ($task->mode == 'multi' and isset($members[$app->user->account]))) echo $lang->actions;?></th>
</tr>
</thead>
<tbody>
@@ -57,7 +57,7 @@
<td title="<?php echo $estimate->consumed . ' ' . $lang->execution->workHour;?>"><?php echo $estimate->consumed . ' ' . $lang->execution->workHourUnit;?></td>
<td title="<?php echo $estimate->left . ' ' . $lang->execution->workHour;?>"><?php echo $estimate->left . ' ' . $lang->execution->workHourUnit;?></td>
<td class="text-left" title="<?php echo $estimate->work;?>"><?php echo $estimate->work;?></td>
<?php if(empty($task->team) or $task->assignedTo == $this->app->user->account or ($task->mode == 'multi' and isset($task->team[$app->user->account]))):?>
<?php if(empty($members) or $task->assignedTo == $this->app->user->account or ($task->mode == 'multi' and isset($members[$app->user->account]))):?>
<td align='center' class='c-actions'>
<?php
if($this->app->user->account == $estimate->account)
@@ -71,7 +71,7 @@
<?php endif;?>
<?php endforeach;?>
<?php endif;?>
<?php if(!empty($task->team) and (!isset($task->team[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
<?php if(!empty($members) and (!isset($members[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):?>
</tbody>
</table>
</form>
+1 -1
View File
@@ -18,7 +18,7 @@
<div id='mainContent' class='main-content'>
<?php
/* IF it is multi-task, the suspened can only be restarted by the current user who it is assigned to. */
if(!empty($task->team) and (!isset($task->team[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):
if(!empty($task->members) and (!isset($task->members[$app->user->account]) or ($task->assignedTo != $app->user->account and $task->mode == 'linear'))):
?>
<div class="alert with-icon">
<i class="icon-exclamation-sign"></i>