Merge branch 'zentaopms_9.8' of github.com:easysoft/zentaopms into zentaopms_9.8
This commit is contained in:
@@ -915,7 +915,7 @@ class project extends control
|
||||
$whitelist = '';
|
||||
$acl = 'open';
|
||||
$plan = new stdClass();
|
||||
$productPlan = new stdClass();
|
||||
$productPlan = array();
|
||||
|
||||
if($copyProjectID)
|
||||
{
|
||||
@@ -969,7 +969,7 @@ class project extends control
|
||||
$this->view->code = $code;
|
||||
$this->view->team = $team;
|
||||
$this->view->products = $products;
|
||||
$this->view->productPlan = $productPlan;
|
||||
$this->view->productPlan = array(0 => '') + $productPlan;
|
||||
$this->view->whitelist = $whitelist;
|
||||
$this->view->copyProjectID = $copyProjectID;
|
||||
$this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products));
|
||||
|
||||
@@ -908,6 +908,8 @@ class projectModel extends model
|
||||
if(($this->session->taskBrowseType) and ($this->session->taskBrowseType != 'bysearch')) $browseType = $this->session->taskBrowseType;
|
||||
}
|
||||
|
||||
$this->session->set('taskWithChildren', in_array($browseType, array('unclosed', 'byproject', 'all')) ? false : true);
|
||||
|
||||
/* Get tasks. */
|
||||
$tasks = array();
|
||||
if($browseType != "bysearch")
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<?php if($build) echo ' <span class="label label-danger">Build:' . $build->name . '</span>'; ?>
|
||||
</div>
|
||||
<div class='actions'>
|
||||
<?php common::printIcon('bug', 'export', "productID=$productID&orderBy=$orderBy", '', 'button', '', '', "export iframe");?>
|
||||
<?php common::printIcon('bug', 'export', "productID=$productID&orderBy=$orderBy", '', 'button', '', '', "export");?>
|
||||
<?php common::printIcon('bug', 'create', "productID=$productID&branch=$branchID&extra=projectID=$project->id");?>
|
||||
</div>
|
||||
<div id='querybox' class='show'></div>
|
||||
|
||||
@@ -121,7 +121,12 @@
|
||||
<?php echo html::select("plans[" . $plan->product . "]", $productPlan, $plan->id, "class='form-control'");?>
|
||||
<?php js::set('currentPlanID', $plan->id)?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php else:?>
|
||||
<div class="col-sm-3" id="plan0">
|
||||
<?php echo html::select("plans[]", $productPlan, '', "class='form-control'");?>
|
||||
<?php js::set('currentPlanID', '')?>
|
||||
</div>
|
||||
<?php endif?>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -97,7 +97,7 @@
|
||||
</button>
|
||||
<ul class='dropdown-menu' id='exportActionMenu'>
|
||||
<?php
|
||||
$misc = common::hasPriv('task', 'export') ? "class='export iframe'" : "class=disabled";
|
||||
$misc = common::hasPriv('task', 'export') ? "class='export'" : "class=disabled";
|
||||
$link = common::hasPriv('task', 'export') ? $this->createLink('task', 'export', "project=$projectID&orderBy=$orderBy&type=$browseType") : '#';
|
||||
echo "<li>" . html::a($link, $lang->task->export, '', $misc) . "</li>";
|
||||
?>
|
||||
|
||||
@@ -185,10 +185,13 @@
|
||||
<td><?php echo html::input('duplicateStory', $story->duplicateStory, "class='form-control' autocomplete='off'");?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<tr class='text-top'>
|
||||
<tr>
|
||||
<th class='w-70px'><?php echo $lang->story->linkStories;?></th>
|
||||
<td><?php echo html::a($this->createLink('story', 'linkStory', "storyID=$story->id&type=linkStories", '', true), $lang->story->linkStory, '', "data-toggle='modal' data-type='iframe' data-width='95%'");?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th></th>
|
||||
<td>
|
||||
<?php echo html::a($this->createLink('story', 'linkStory', "storyID=$story->id&type=linkStories", '', true), $lang->story->linkStory, '', "data-toggle='modal' data-type='iframe' data-width='95%'");?>
|
||||
<ul class='list-unstyled' id='linkStoriesBox'>
|
||||
<?php
|
||||
$linkStories = explode(',', $story->linkStories);
|
||||
|
||||
+31
-28
@@ -1272,42 +1272,45 @@ class task extends control
|
||||
$relatedFiles = $this->dao->select('id, objectID, pathname, title')->from(TABLE_FILE)->where('objectType')->eq('task')->andWhere('objectID')->in(@array_keys($tasks))->andWhere('extra')->ne('editor')->fetchGroup('objectID');
|
||||
$relatedModules = $this->loadModel('tree')->getTaskOptionMenu($projectID);
|
||||
|
||||
$children = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)
|
||||
->andWhere('parent')->in(array_keys($tasks))
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->cookie->checkedItem)->fi()
|
||||
->orderBy($sort)
|
||||
->fetchGroup('parent', 'id');
|
||||
if(!empty($children))
|
||||
if(!$this->session->taskWithChildren)
|
||||
{
|
||||
foreach($children as $parent => $childTasks)
|
||||
$children = $this->dao->select('*')->from(TABLE_TASK)->where('deleted')->eq(0)
|
||||
->andWhere('parent')->in(array_keys($tasks))
|
||||
->beginIF($this->post->exportType == 'selected')->andWhere('id')->in($this->cookie->checkedItem)->fi()
|
||||
->orderBy($sort)
|
||||
->fetchGroup('parent', 'id');
|
||||
if(!empty($children))
|
||||
{
|
||||
foreach($childTasks as $task)
|
||||
foreach($children as $parent => $childTasks)
|
||||
{
|
||||
/* Compute task progress. */
|
||||
if($task->consumed == 0 and $task->left == 0)
|
||||
foreach($childTasks as $task)
|
||||
{
|
||||
$task->progress = 0;
|
||||
/* Compute task progress. */
|
||||
if($task->consumed == 0 and $task->left == 0)
|
||||
{
|
||||
$task->progress = 0;
|
||||
}
|
||||
elseif($task->consumed != 0 and $task->left == 0)
|
||||
{
|
||||
$task->progress = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
$task->progress = round($task->consumed / ($task->consumed + $task->left), 2) * 100;
|
||||
}
|
||||
$task->progress .= '%';
|
||||
}
|
||||
elseif($task->consumed != 0 and $task->left == 0)
|
||||
{
|
||||
$task->progress = 100;
|
||||
}
|
||||
else
|
||||
{
|
||||
$task->progress = round($task->consumed / ($task->consumed + $task->left), 2) * 100;
|
||||
}
|
||||
$task->progress .= '%';
|
||||
}
|
||||
}
|
||||
|
||||
$position = 0;
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
$position ++;
|
||||
if(isset($children[$task->id]))
|
||||
$position = 0;
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
array_splice($tasks, $position, 0, $children[$task->id]);
|
||||
$position += count($children[$task->id]);
|
||||
$position ++;
|
||||
if(isset($children[$task->id]))
|
||||
{
|
||||
array_splice($tasks, $position, 0, $children[$task->id]);
|
||||
$position += count($children[$task->id]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -165,6 +165,7 @@ $lang->task->remindBug = "This Task is converted from a Bug. Do you
|
||||
$lang->task->confirmChangeProject = "If you change {$lang->projectCommon}, the related Module, Story and Assignor will be changed. Do you want to do it?";
|
||||
$lang->task->confirmFinish = '"Left Hour" is 0. Do you want to change the Status to "Done"?';
|
||||
$lang->task->confirmRecord = '"Left Hour" is 0. Do you want to set Task as "Done"?';
|
||||
$lang->task->confirmTransfer = '"Left Hour" is 0,Do you want to transfer task?';
|
||||
$lang->task->noticeLinkStory = "No story has been linked. You can %s for this project, then %s.";
|
||||
$lang->task->noticeSaveRecord = 'Your Hour is not saved. Please save it first.';
|
||||
$lang->task->commentActions = '%s. %s, commented by <strong>%s</strong>.';
|
||||
|
||||
@@ -165,6 +165,7 @@ $lang->task->remindBug = "该任务为Bug转化得到,是否更新
|
||||
$lang->task->confirmChangeProject = "修改{$lang->projectCommon}会导致相应的所属模块、相关需求和指派人发生变化,确定吗?";
|
||||
$lang->task->confirmFinish = '"预计剩余"为0,确认将任务状态改为"已完成"吗?';
|
||||
$lang->task->confirmRecord = '"剩余"为0,任务将标记为"已完成",您确定吗?';
|
||||
$lang->task->confirmTransfer = '"当前剩余"为0,任务将被转交,您确定吗?';
|
||||
$lang->task->noticeLinkStory = "没有可关联的相关需求,您可以为当前项目%s,然后%s";
|
||||
$lang->task->noticeSaveRecord = '您有尚未保存的工时记录,请先将其保存。';
|
||||
$lang->task->commentActions = '%s. %s, 由 <strong>%s</strong> 添加备注。';
|
||||
|
||||
+38
-15
@@ -445,6 +445,9 @@ class taskModel extends model
|
||||
$teams = array();
|
||||
if($this->post->multiple)
|
||||
{
|
||||
$consumed = 0;
|
||||
$estimate = 0;
|
||||
$left = 0;
|
||||
foreach($this->post->team as $row => $account)
|
||||
{
|
||||
if(empty($account) or isset($team[$account])) continue;
|
||||
@@ -457,15 +460,26 @@ class taskModel extends model
|
||||
$member->type = 'task';
|
||||
$member->estimate = $this->post->teamEstimate[$row] ? $this->post->teamEstimate[$row] : 0;
|
||||
$member->consumed = $this->post->teamConsumed[$row] ? $this->post->teamConsumed[$row] : 0;
|
||||
$member->left = $member->estimate - $member->consumed;
|
||||
$member->left = $this->post->teamLeft[$row] ? $this->post->teamLeft[$row] : ($member->estimate - $member->consumed);
|
||||
$member->order = $row;
|
||||
$teams[$account] = $member;
|
||||
}
|
||||
|
||||
if(!empty($teams) and !isset($task->assignedTo))
|
||||
$consumed += (float)$member->consumed;
|
||||
$estimate += (float)$member->estimate;
|
||||
$left += (float)$member->left;
|
||||
}
|
||||
|
||||
if(!empty($teams))
|
||||
{
|
||||
$firstMember = reset($teams);
|
||||
$task->assignedTo = $firstMember->account;
|
||||
$task->consumed = $consumed;
|
||||
$task->estimate = $estimate;
|
||||
$task->left = $left;
|
||||
|
||||
if(!isset($task->assignedTo))
|
||||
{
|
||||
$firstMember = reset($teams);
|
||||
$task->assignedTo = $firstMember->account;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -945,19 +959,28 @@ class taskModel extends model
|
||||
$data->consumed = $teamTime->consumed;
|
||||
$data->left = $teamTime->leftTime;
|
||||
|
||||
if($task->status == 'done')
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = $data->left;
|
||||
$newTask->consumed = $data->consumed;
|
||||
|
||||
if($left != 0 || $task->assignedTo != $teams[count($teams) - 1])
|
||||
{
|
||||
$newTask = new stdClass();
|
||||
$newTask->left = $data->left;
|
||||
$newTask->consumed = $data->consumed;
|
||||
$newTask->assignedTo = $this->getNextUser($teams, $task->assignedTo);
|
||||
$newTask->assignedDate = $now;
|
||||
$newTask->status = 'doing';
|
||||
if($task->assignedTo != $teams[count($teams) - 1] && $left == 0)
|
||||
{
|
||||
$newTask->assignedTo = $this->getNextUser($teams, $task->assignedTo);
|
||||
$newTask->assignedDate = $now;
|
||||
}
|
||||
|
||||
$task->status = $oldStatus;
|
||||
$this->dao->update(TABLE_TASK)->data($newTask)->where('id')->eq((int)$taskID)->exec();
|
||||
|
||||
if($task->assignedTo != $teams[count($teams) - 1]) return common::createChanges($task, $newTask);
|
||||
|
||||
$data->assignedTo = $task->openedBy; // Fix bug#1345
|
||||
$changes = common::createChanges($task, $newTask);
|
||||
if(!empty($actionID)) $this->action->logHistory($actionID, $changes);
|
||||
return $changes;
|
||||
}
|
||||
|
||||
$data->assignedTo = $task->openedBy;
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_TASK)->data($data)->where('id')->eq($taskID)->exec();
|
||||
@@ -1343,7 +1366,7 @@ class taskModel extends model
|
||||
->page($pager, 't1.id')
|
||||
->fetchAll('id');
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task', ($productID or in_array($type, array('assignedtome', 'myinvolved', 'needconfirm'))) ? false : true);
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'task', ($productID or in_array($type, array('myinvolved', 'needconfirm'))) ? false : true);
|
||||
|
||||
if(empty($tasks)) return array();
|
||||
|
||||
|
||||
@@ -12,7 +12,8 @@
|
||||
?>
|
||||
<?php include '../../common/view/header.lite.html.php';?>
|
||||
<?php include '../../common/view/datepicker.html.php';?>
|
||||
<?php js::set('confirmRecord', $lang->task->confirmRecord);?>
|
||||
<?php $team = array_keys($task->team);?>
|
||||
<?php js::set('confirmRecord', (!empty($team) && $task->assignedTo != end($team)) ? $lang->task->confirmTransfer : $lang->task->confirmRecord);?>
|
||||
<?php js::set('noticeSaveRecord', $lang->task->noticeSaveRecord);?>
|
||||
<div id='titlebar'>
|
||||
<div class='heading'>
|
||||
|
||||
Reference in New Issue
Block a user