* Finish task#8760.
This commit is contained in:
@@ -255,6 +255,7 @@ $lang->resource->issue->create = 'create';
|
||||
$lang->resource->issue->batchCreate = 'batchCreate';
|
||||
$lang->resource->issue->delete = 'delete';
|
||||
$lang->resource->issue->edit = 'edit';
|
||||
$lang->resource->issue->confirm = 'confirm';
|
||||
$lang->resource->issue->assignTo = 'assignTo';
|
||||
$lang->resource->issue->close = 'close';
|
||||
$lang->resource->issue->cancel = 'cancel';
|
||||
@@ -267,11 +268,12 @@ $lang->issue->methodOrder[10] = 'create';
|
||||
$lang->issue->methodOrder[15] = 'batchCreate';
|
||||
$lang->issue->methodOrder[20] = 'delete';
|
||||
$lang->issue->methodOrder[25] = 'edit';
|
||||
$lang->issue->methodOrder[30] = 'assignTo';
|
||||
$lang->issue->methodOrder[35] = 'close';
|
||||
$lang->issue->methodOrder[40] = 'cancel';
|
||||
$lang->issue->methodOrder[45] = 'activate';
|
||||
$lang->issue->methodOrder[50] = 'resolve';
|
||||
$lang->issue->methodOrder[30] = 'confirm';
|
||||
$lang->issue->methodOrder[35] = 'assignTo';
|
||||
$lang->issue->methodOrder[40] = 'close';
|
||||
$lang->issue->methodOrder[45] = 'cancel';
|
||||
$lang->issue->methodOrder[50] = 'activate';
|
||||
$lang->issue->methodOrder[55] = 'resolve';
|
||||
$lang->issue->methodOrder[60] = 'view';
|
||||
|
||||
/* Risk . */
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
$lang->index->common = 'Home';
|
||||
$lang->index->index = 'Home';
|
||||
$lang->index->search = 'Please input';
|
||||
|
||||
$lang->index->tab = new stdClass();
|
||||
$lang->index->tab->open = 'Open';
|
||||
|
||||
@@ -9,6 +9,7 @@ $config->issue->editor = new stdclass();
|
||||
$config->issue->editor->view = array('id' => 'comment,lastComment', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->create = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->confirm = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->cancel = array('id' => 'desc', 'tools' => 'simpleTools');
|
||||
$config->issue->editor->resolve = array('id' => 'spec,verify,steps,desc,resolutionComment', 'tools' => 'simpleTools');
|
||||
|
||||
|
||||
@@ -201,7 +201,30 @@ class issue extends control
|
||||
}
|
||||
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Confirm the issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function confirm($issueID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$changes = $this->issue->confirm($issueID);
|
||||
|
||||
if(dao::isError()) die(js::error(dao::getError()));
|
||||
$actionID = $this->loadModel('action')->create('issue', $issueID, 'Confirmed');
|
||||
|
||||
$this->action->logHistory($actionID, $changes);
|
||||
die(js::closeModal('parent.parent', 'this'));
|
||||
}
|
||||
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
$this->display();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,6 +39,7 @@ $lang->issue->assignedBy = 'AssignedBy';
|
||||
$lang->issue->assignedDate = 'AssignedDate';
|
||||
$lang->issue->resolve = 'Resolved';
|
||||
$lang->issue->id = 'ID';
|
||||
$lang->issue->confirm = 'Confirm';
|
||||
|
||||
$lang->issue->view = 'Issue Details';
|
||||
$lang->issue->close = 'Closed';
|
||||
@@ -90,12 +91,10 @@ $lang->issue->resolutionList['totask'] = 'To Task';
|
||||
|
||||
$lang->issue->statusList['unconfirmed'] = 'Unconfirmed';
|
||||
$lang->issue->statusList['confirmed'] = 'Confirmed';
|
||||
$lang->issue->statusList['unresolved'] = 'Unresolved';
|
||||
$lang->issue->statusList['resolved'] = 'Resolved';
|
||||
$lang->issue->statusList['canceled'] = 'Canceled';
|
||||
$lang->issue->statusList['closed'] = 'Closed';
|
||||
$lang->issue->statusList['active'] = 'Active';
|
||||
$lang->issue->statusList['suspended'] = 'Suspended';
|
||||
|
||||
$lang->issue->resolveMethods = array();
|
||||
$lang->issue->resolveMethods['resolved'] = 'Resolved';
|
||||
|
||||
@@ -39,6 +39,7 @@ $lang->issue->assignedBy = 'AssignedBy';
|
||||
$lang->issue->assignedDate = 'AssignedDate';
|
||||
$lang->issue->resolve = 'Resolved';
|
||||
$lang->issue->id = 'ID';
|
||||
$lang->issue->confirm = 'Confirm';
|
||||
|
||||
$lang->issue->view = 'Issue Details';
|
||||
$lang->issue->close = 'Closed';
|
||||
@@ -90,12 +91,10 @@ $lang->issue->resolutionList['totask'] = 'To Task';
|
||||
|
||||
$lang->issue->statusList['unconfirmed'] = 'Unconfirmed';
|
||||
$lang->issue->statusList['confirmed'] = 'Confirmed';
|
||||
$lang->issue->statusList['unresolved'] = 'Unresolved';
|
||||
$lang->issue->statusList['resolved'] = 'Resolved';
|
||||
$lang->issue->statusList['canceled'] = 'Canceled';
|
||||
$lang->issue->statusList['closed'] = 'Closed';
|
||||
$lang->issue->statusList['active'] = 'Active';
|
||||
$lang->issue->statusList['suspended'] = 'Suspended';
|
||||
|
||||
$lang->issue->resolveMethods = array();
|
||||
$lang->issue->resolveMethods['resolved'] = 'Resolved';
|
||||
|
||||
@@ -39,6 +39,7 @@ $lang->issue->assignedBy = 'AssignedBy';
|
||||
$lang->issue->assignedDate = 'AssignedDate';
|
||||
$lang->issue->resolve = 'Resolved';
|
||||
$lang->issue->id = 'ID';
|
||||
$lang->issue->confirm = 'Confirm';
|
||||
|
||||
$lang->issue->view = 'Issue Details';
|
||||
$lang->issue->close = 'Closed';
|
||||
@@ -90,12 +91,10 @@ $lang->issue->resolutionList['totask'] = 'To Task';
|
||||
|
||||
$lang->issue->statusList['unconfirmed'] = 'Unconfirmed';
|
||||
$lang->issue->statusList['confirmed'] = 'Confirmed';
|
||||
$lang->issue->statusList['unresolved'] = 'Unresolved';
|
||||
$lang->issue->statusList['resolved'] = 'Resolved';
|
||||
$lang->issue->statusList['canceled'] = 'Canceled';
|
||||
$lang->issue->statusList['closed'] = 'Closed';
|
||||
$lang->issue->statusList['active'] = 'Active';
|
||||
$lang->issue->statusList['suspended'] = 'Suspended';
|
||||
|
||||
$lang->issue->resolveMethods = array();
|
||||
$lang->issue->resolveMethods['resolved'] = 'Resolved';
|
||||
|
||||
@@ -39,6 +39,7 @@ $lang->issue->assignedBy = 'AssignedBy';
|
||||
$lang->issue->assignedDate = 'AssignedDate';
|
||||
$lang->issue->resolve = 'Resolved';
|
||||
$lang->issue->id = 'ID';
|
||||
$lang->issue->confirm = 'Confirm';
|
||||
|
||||
$lang->issue->view = 'Issue Details';
|
||||
$lang->issue->close = 'Closed';
|
||||
@@ -90,12 +91,10 @@ $lang->issue->resolutionList['totask'] = 'To Task';
|
||||
|
||||
$lang->issue->statusList['unconfirmed'] = 'Unconfirmed';
|
||||
$lang->issue->statusList['confirmed'] = 'Confirmed';
|
||||
$lang->issue->statusList['unresolved'] = 'Unresolved';
|
||||
$lang->issue->statusList['resolved'] = 'Resolved';
|
||||
$lang->issue->statusList['canceled'] = 'Canceled';
|
||||
$lang->issue->statusList['closed'] = 'Closed';
|
||||
$lang->issue->statusList['active'] = 'Active';
|
||||
$lang->issue->statusList['suspended'] = 'Suspended';
|
||||
|
||||
$lang->issue->resolveMethods = array();
|
||||
$lang->issue->resolveMethods['resolved'] = 'Resolved';
|
||||
|
||||
@@ -39,6 +39,7 @@ $lang->issue->assignedBy = '由谁指派';
|
||||
$lang->issue->assignedDate = '指派时间';
|
||||
$lang->issue->resolve = '解决';
|
||||
$lang->issue->id = '编号';
|
||||
$lang->issue->confirm = '确认';
|
||||
|
||||
$lang->issue->view = '问题详情';
|
||||
$lang->issue->close = '关闭';
|
||||
@@ -90,12 +91,10 @@ $lang->issue->resolutionList['totask'] = '转任务';
|
||||
|
||||
$lang->issue->statusList['unconfirmed'] = '待确认';
|
||||
$lang->issue->statusList['confirmed'] = '已确认';
|
||||
$lang->issue->statusList['unresolved'] = '正解决';
|
||||
$lang->issue->statusList['resolved'] = '已解决';
|
||||
$lang->issue->statusList['canceled'] = '取消';
|
||||
$lang->issue->statusList['closed'] = '已关闭';
|
||||
$lang->issue->statusList['active'] = '激活';
|
||||
$lang->issue->statusList['suspended'] = '挂起';
|
||||
|
||||
$lang->issue->resolveMethods = array();
|
||||
$lang->issue->resolveMethods['resolved'] = '已解决';
|
||||
|
||||
@@ -39,6 +39,7 @@ $lang->issue->assignedBy = '由誰指派';
|
||||
$lang->issue->assignedDate = '指派時間';
|
||||
$lang->issue->resolve = '解決';
|
||||
$lang->issue->id = '編號';
|
||||
$lang->issue->confirm = '確認';
|
||||
|
||||
$lang->issue->view = '問題詳情';
|
||||
$lang->issue->close = '關閉';
|
||||
@@ -51,6 +52,7 @@ $lang->issue->assignTo = '指派';
|
||||
$lang->issue->create = '新建問題';
|
||||
$lang->issue->edit = '編輯';
|
||||
$lang->issue->batchCreate = '批量新建';
|
||||
$lang->issue->deleted = '已刪除';
|
||||
|
||||
$lang->issue->labelList['all'] = '全部';
|
||||
$lang->issue->labelList['open'] = '開放';
|
||||
@@ -89,12 +91,10 @@ $lang->issue->resolutionList['totask'] = '轉任務';
|
||||
|
||||
$lang->issue->statusList['unconfirmed'] = '待確認';
|
||||
$lang->issue->statusList['confirmed'] = '已確認';
|
||||
$lang->issue->statusList['unresolved'] = '正解決';
|
||||
$lang->issue->statusList['resolved'] = '已解決';
|
||||
$lang->issue->statusList['canceled'] = '取消';
|
||||
$lang->issue->statusList['closed'] = '已關閉';
|
||||
$lang->issue->statusList['active'] = '激活';
|
||||
$lang->issue->statusList['suspended'] = '掛起';
|
||||
|
||||
$lang->issue->resolveMethods = array();
|
||||
$lang->issue->resolveMethods['resolved'] = '已解決';
|
||||
|
||||
+24
-7
@@ -245,7 +245,7 @@ class issueModel extends model
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return array
|
||||
*/
|
||||
public function assignTo($issueID)
|
||||
{
|
||||
@@ -265,7 +265,7 @@ class issueModel extends model
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return array
|
||||
*/
|
||||
public function close($issueID)
|
||||
{
|
||||
@@ -285,12 +285,28 @@ class issueModel extends model
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return array
|
||||
*/
|
||||
public function confirm($issueID)
|
||||
{
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
$data = fixer::input('post')->add('status', 'confirmed')->get();
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec();
|
||||
|
||||
return common::createChanges($oldIssue, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Cancel an issue.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function cancel($issueID)
|
||||
{
|
||||
$oldIssue = $this->getByID($issueID);
|
||||
$data = fixer::input('post')->get();
|
||||
$data = fixer::input('post')->add('status', 'canceled')->get();
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec();
|
||||
|
||||
return common::createChanges($oldIssue, $data);
|
||||
@@ -301,7 +317,7 @@ class issueModel extends model
|
||||
*
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return bool
|
||||
* @return array
|
||||
*/
|
||||
public function activate($issueID)
|
||||
{
|
||||
@@ -463,9 +479,10 @@ class issueModel extends model
|
||||
{
|
||||
$action = strtolower($action);
|
||||
|
||||
if($action == 'resolve') return $issue->status != 'resolved';
|
||||
if($action == 'confirm') return $issue->status == 'unconfirmed';
|
||||
if($action == 'resolve') return $issue->status == 'active' || $issue->status == 'confirmed';
|
||||
if($action == 'close') return $issue->status != 'closed';
|
||||
if($action == 'activate') return $issue->status != 'active';
|
||||
if($action == 'activate') return $issue->status == 'closed';
|
||||
if($action == 'cancel') return $issue->status != 'canceled';
|
||||
|
||||
return true;
|
||||
|
||||
@@ -38,12 +38,12 @@
|
||||
<?php $vars = "browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<th class="c-id w-60px"><?php echo common::printOrderLink('id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class="w-80px"><?php echo $lang->issue->type;?></th>
|
||||
<th style="width:auto"><?php echo $lang->issue->title;?></th>
|
||||
<th class="w-60px"><?php echo $lang->issue->severity;?></th>
|
||||
<th class="w-auto"><?php echo $lang->issue->title;?></th>
|
||||
<th class="w-80px"><?php echo $lang->issue->severity;?></th>
|
||||
<th class="w-60px"><?php echo $lang->issue->pri;?></th>
|
||||
<th class="w-90px"><?php echo $lang->issue->assignedTo;?></th>
|
||||
<th class="w-80px"><?php echo $lang->issue->owner;?></th>
|
||||
<th class="w-100px"><?php echo $lang->issue->status;?></th>
|
||||
<th class="w-90px"><?php echo $lang->issue->owner;?></th>
|
||||
<th class="w-80px"><?php echo $lang->issue->status;?></th>
|
||||
<th class="w-140px"><?php echo $lang->issue->createdDate;?></th>
|
||||
<th class="c-actions w-200px"><?php echo $lang->actions;?></th>
|
||||
</tr>
|
||||
@@ -63,14 +63,13 @@
|
||||
<td class="c-actions">
|
||||
<?php
|
||||
$params = "issueID=$issue->id";
|
||||
echo common::printIcon('issue', 'confirm', $params, $issue, 'list', 'start', '', 'iframe', 'yes', '', $lang->issue->confirm);
|
||||
echo common::printIcon('issue', 'resolve', $params, $issue, 'list', 'checked', '', 'iframe', 'yes', '', $lang->issue->resolve);
|
||||
echo common::printIcon('issue', 'assignTo', $params, $issue, 'list', 'hand-right', '', 'iframe', 'yes', '', $lang->issue->assignTo);
|
||||
echo common::printIcon('issue', 'close', $params, $issue, 'list', 'off', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'cancel', $params, $issue, 'list', 'ban-circle', '', 'iframe', 'yes');
|
||||
echo common::printIcon('issue', 'activate', $params, $issue, 'list', 'magic', '', 'iframe', 'yes', '', $lang->issue->activate);
|
||||
echo common::printIcon('issue', 'edit', $params, $issue, 'list', 'edit');
|
||||
$deleteClass = common::hasPriv('issue', 'delete') ? 'btn' : 'btn disabled';
|
||||
echo html::a($this->createLink('issue', 'delete', $params), '<i class="icon-trash"></i>', 'hiddenwin', "title='{$lang->issue->delete}' class='$deleteClass'");
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
@@ -92,4 +91,3 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
|
||||
|
||||
@@ -31,10 +31,6 @@
|
||||
<th><?php echo $lang->issue->desc;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('desc', $issue->desc, 'row="6"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->status;?></th>
|
||||
<td colspan='2'><?php echo html::select('status', $lang->issue->statusList, 'canceled', 'class="form-control chosen"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* The cancel of issue module of ZenTaoPMS.
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Jia Fu <fujia@cnezsoft.com>
|
||||
* @package issue
|
||||
* @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php include '../../common/view/header.html.php';?>
|
||||
<?php include '../../common/view/kindeditor.html.php';?>
|
||||
<div id='mainContent' class='main-content'>
|
||||
<div class='center-block'>
|
||||
<div class='main-header'>
|
||||
<h2>
|
||||
<span class='label label-id'><?php echo $issue->id;?></span>
|
||||
<?php echo "<span title='$issue->title'>" . $issue->title . '</span>';?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-body" style="min-height: 282px; overflow: auto;">
|
||||
<form method='post' enctype='multipart/form-data' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->title;?></th>
|
||||
<td colspan='2'><?php echo $issue->title;?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><?php echo $lang->issue->desc;?></th>
|
||||
<td colspan='2'><?php echo html::textarea('desc', $issue->desc, 'row="6"');?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan='3' class='text-center form-actions'>
|
||||
<?php echo html::submitButton();?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php include '../../common/view/footer.html.php';?>
|
||||
@@ -64,6 +64,7 @@ foreach($issue as $field => $value)
|
||||
<?php if(!$issue->deleted):?>
|
||||
<?php
|
||||
$params = "issueID=$issue->id";
|
||||
common::printIcon('issue', 'confirm', $params, $issue, 'button', 'start', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('issue', 'resolve', $params, $issue, 'button', 'checked', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('issue', 'assignTo', $params, $issue, 'button', '', '', 'iframe showinonlybody', true);
|
||||
common::printIcon('issue', 'cancel', $params, $issue, 'button', '', '', 'iframe showinonlybody', true);
|
||||
|
||||
@@ -70,17 +70,13 @@ class personnel extends control
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function putInto($programID = 0, $browseType = 'all', $orderBy = 'id_desc')
|
||||
public function putInto($programID = 0)
|
||||
{
|
||||
$this->setProgramNavMenu($programID);
|
||||
|
||||
$this->view->title = $this->lang->personnel->putInto;
|
||||
$this->view->position[] = $this->lang->personnel->putInto;
|
||||
|
||||
$this->view->programID = $programID;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->inputPersonnel = $this->personnel->getInputPersonnel($programID, $browseType, $orderBy);
|
||||
$this->view->title = $this->lang->personnel->putInto;
|
||||
$this->view->position[] = $this->lang->personnel->putInto;
|
||||
$this->view->inputPersonnel = $this->personnel->getInputPersonnel($programID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
<?php
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = $lang->sprintCommon;
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->role = 'Role';
|
||||
|
||||
$lang->personnel->name = 'User';
|
||||
$lang->personnel->projects = 'Projects';
|
||||
$lang->personnel->executions = 'Iterations/Phases';
|
||||
$lang->personnel->workingHours = 'Hours';
|
||||
$lang->personnel->task = 'Task';
|
||||
$lang->personnel->bug = 'Bug';
|
||||
$lang->personnel->createStory = 'Story';
|
||||
$lang->personnel->risk = 'Risk';
|
||||
$lang->personnel->issue = 'Issue';
|
||||
$lang->personnel->putInto = 'Input';
|
||||
$lang->personnel->surplus = 'Remained';
|
||||
$lang->personnel->created = 'Created';
|
||||
$lang->personnel->finished = 'Finished';
|
||||
$lang->personnel->pending = 'Pending';
|
||||
$lang->personnel->resolved = 'Resolved';
|
||||
$lang->personnel->UR = 'UR';
|
||||
$lang->personnel->SR = 'SR';
|
||||
|
||||
$lang->personnel->whitelist = 'Whitelist';
|
||||
$lang->personnel->addWhitelist = 'Add Whitelist';
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
<?php
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = $lang->sprintCommon;
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->role = 'Role';
|
||||
|
||||
$lang->personnel->name = 'User';
|
||||
$lang->personnel->projects = 'Projects';
|
||||
$lang->personnel->executions = 'Iterations/Phases';
|
||||
$lang->personnel->workingHours = 'Hours';
|
||||
$lang->personnel->task = 'Task';
|
||||
$lang->personnel->bug = 'Bug';
|
||||
$lang->personnel->createStory = 'Story';
|
||||
$lang->personnel->risk = 'Risk';
|
||||
$lang->personnel->issue = 'Issue';
|
||||
$lang->personnel->putInto = 'Input';
|
||||
$lang->personnel->surplus = 'Remained';
|
||||
$lang->personnel->created = 'Created';
|
||||
$lang->personnel->finished = 'Finished';
|
||||
$lang->personnel->pending = 'Pending';
|
||||
$lang->personnel->resolved = 'Resolved';
|
||||
$lang->personnel->UR = 'UR';
|
||||
$lang->personnel->SR = 'SR';
|
||||
|
||||
$lang->personnel->whitelist = 'Whitelist';
|
||||
$lang->personnel->addWhitelist = 'Add Whitelist';
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
<?php
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = $lang->sprintCommon;
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->role = 'Role';
|
||||
|
||||
$lang->personnel->name = 'User';
|
||||
$lang->personnel->projects = 'Projects';
|
||||
$lang->personnel->executions = 'Iterations/Phases';
|
||||
$lang->personnel->workingHours = 'Hours';
|
||||
$lang->personnel->task = 'Task';
|
||||
$lang->personnel->bug = 'Bug';
|
||||
$lang->personnel->createStory = 'Story';
|
||||
$lang->personnel->risk = 'Risk';
|
||||
$lang->personnel->issue = 'Issue';
|
||||
$lang->personnel->putInto = 'Input';
|
||||
$lang->personnel->surplus = 'Remained';
|
||||
$lang->personnel->created = 'Created';
|
||||
$lang->personnel->finished = 'Finished';
|
||||
$lang->personnel->pending = 'Pending';
|
||||
$lang->personnel->resolved = 'Resolved';
|
||||
$lang->personnel->UR = 'UR';
|
||||
$lang->personnel->SR = 'SR';
|
||||
|
||||
$lang->personnel->whitelist = 'Whitelist';
|
||||
$lang->personnel->addWhitelist = 'Add Whitelist';
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
<?php
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = $lang->sprintCommon;
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->common = 'Program Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->delete = 'Remove';
|
||||
$lang->personnel->role = 'Role';
|
||||
|
||||
$lang->personnel->name = 'User';
|
||||
$lang->personnel->projects = 'Projects';
|
||||
$lang->personnel->executions = 'Iterations/Phases';
|
||||
$lang->personnel->workingHours = 'Hours';
|
||||
$lang->personnel->task = 'Task';
|
||||
$lang->personnel->bug = 'Bug';
|
||||
$lang->personnel->createStory = 'Story';
|
||||
$lang->personnel->risk = 'Risk';
|
||||
$lang->personnel->issue = 'Issue';
|
||||
$lang->personnel->putInto = 'Input';
|
||||
$lang->personnel->surplus = 'Remained';
|
||||
$lang->personnel->created = 'Created';
|
||||
$lang->personnel->finished = 'Finished';
|
||||
$lang->personnel->pending = 'Pending';
|
||||
$lang->personnel->resolved = 'Resolved';
|
||||
$lang->personnel->UR = 'UR';
|
||||
$lang->personnel->SR = 'SR';
|
||||
|
||||
$lang->personnel->whitelist = 'Whitelist';
|
||||
$lang->personnel->addWhitelist = 'Add Whitelist';
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
<?php
|
||||
$lang->personnel->common = '项目集人员';
|
||||
$lang->personnel->accessible = '可访问人员列表';
|
||||
$lang->personnel->putInto = '投入人员列表';
|
||||
$lang->personnel->department = '部门';
|
||||
$lang->personnel->realName = '真实姓名';
|
||||
$lang->personnel->userName = '用户名';
|
||||
$lang->personnel->job = '岗位';
|
||||
$lang->personnel->genders = '性别';
|
||||
$lang->personnel->project = '项目';
|
||||
$lang->personnel->sprint = $lang->sprintCommon;
|
||||
$lang->personnel->user = '用户';
|
||||
$lang->personnel->role = '角色';
|
||||
$lang->personnel->search = '搜索';
|
||||
$lang->personnel->program = '项目集';
|
||||
$lang->personnel->emptyTip = '暂无';
|
||||
$lang->personnel->childrenStage = '子阶段';
|
||||
$lang->personnel->delete = '移除';
|
||||
$lang->personnel->common = '项目集人员';
|
||||
$lang->personnel->accessible = '可访问人员列表';
|
||||
$lang->personnel->putInto = '投入人员列表';
|
||||
$lang->personnel->department = '部门';
|
||||
$lang->personnel->realName = '真实姓名';
|
||||
$lang->personnel->userName = '用户名';
|
||||
$lang->personnel->job = '岗位';
|
||||
$lang->personnel->genders = '性别';
|
||||
$lang->personnel->project = '项目';
|
||||
$lang->personnel->search = '搜索';
|
||||
$lang->personnel->emptyTip = '暂无';
|
||||
$lang->personnel->delete = '移除';
|
||||
$lang->personnel->role = '角色';
|
||||
|
||||
$lang->personnel->name = '人员名称';
|
||||
$lang->personnel->projects = '项目数';
|
||||
$lang->personnel->executions = '迭代/阶段数';
|
||||
$lang->personnel->workingHours = '工时';
|
||||
$lang->personnel->task = '任务';
|
||||
$lang->personnel->bug = 'Bug';
|
||||
$lang->personnel->createStory = '创建需求数';
|
||||
$lang->personnel->risk = '风险';
|
||||
$lang->personnel->issue = '问题';
|
||||
$lang->personnel->putInto = '已投入';
|
||||
$lang->personnel->surplus = '剩余';
|
||||
$lang->personnel->created = '创建';
|
||||
$lang->personnel->finished = '完成';
|
||||
$lang->personnel->pending = '待处理';
|
||||
$lang->personnel->resolved = '解决';
|
||||
$lang->personnel->UR = '用需';
|
||||
$lang->personnel->SR = '软需';
|
||||
|
||||
$lang->personnel->whitelist = '白名单列表';
|
||||
$lang->personnel->addWhitelist = '添加白名单';
|
||||
|
||||
@@ -1,21 +1,35 @@
|
||||
<?php
|
||||
$lang->personnel->common = '項目集人員';
|
||||
$lang->personnel->accessible = '可訪問人員列表';
|
||||
$lang->personnel->putInto = '投入人員列表';
|
||||
$lang->personnel->department = '部門';
|
||||
$lang->personnel->realName = '真實姓名';
|
||||
$lang->personnel->userName = '用戶名';
|
||||
$lang->personnel->job = '崗位';
|
||||
$lang->personnel->genders = '性別';
|
||||
$lang->personnel->project = '項目';
|
||||
$lang->personnel->sprint = $lang->sprintCommon;
|
||||
$lang->personnel->user = '用戶';
|
||||
$lang->personnel->role = '角色';
|
||||
$lang->personnel->search = '搜索';
|
||||
$lang->personnel->program = '項目集';
|
||||
$lang->personnel->emptyTip = '暫無';
|
||||
$lang->personnel->childrenStage = '子階段';
|
||||
$lang->personnel->delete = '移除';
|
||||
$lang->personnel->common = '項目集人員';
|
||||
$lang->personnel->accessible = '可訪問人員列表';
|
||||
$lang->personnel->putInto = '投入人員列表';
|
||||
$lang->personnel->department = '部門';
|
||||
$lang->personnel->realName = '真實姓名';
|
||||
$lang->personnel->userName = '用戶名';
|
||||
$lang->personnel->job = '崗位';
|
||||
$lang->personnel->genders = '性別';
|
||||
$lang->personnel->project = '項目';
|
||||
$lang->personnel->search = '搜索';
|
||||
$lang->personnel->emptyTip = '暫無';
|
||||
$lang->personnel->delete = '移除';
|
||||
$lang->personnel->role = '角色';
|
||||
|
||||
$lang->personnel->name = '人員名稱';
|
||||
$lang->personnel->projects = '項目數';
|
||||
$lang->personnel->executions = '迭代/階段數';
|
||||
$lang->personnel->workingHours = '工時';
|
||||
$lang->personnel->task = '任務';
|
||||
$lang->personnel->bug = 'Bug';
|
||||
$lang->personnel->createStory = '創建需求數';
|
||||
$lang->personnel->risk = '風險';
|
||||
$lang->personnel->issue = '問題';
|
||||
$lang->personnel->putInto = '已投入';
|
||||
$lang->personnel->surplus = '剩餘';
|
||||
$lang->personnel->created = '創建';
|
||||
$lang->personnel->finished = '完成';
|
||||
$lang->personnel->pending = '待處理';
|
||||
$lang->personnel->resolved = '解決';
|
||||
$lang->personnel->UR = '用需';
|
||||
$lang->personnel->SR = '軟需';
|
||||
|
||||
$lang->personnel->whitelist = '白名單列表';
|
||||
$lang->personnel->addWhitelist = '添加白名單';
|
||||
|
||||
+320
-84
@@ -59,12 +59,10 @@ class personnelModel extends model
|
||||
* Access to program set input staff.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param string $browseType
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getInputPersonnel($programID = 0, $browseType = 'all', $orderBy = 'id_desc')
|
||||
public function getInputPersonnel($programID = 0)
|
||||
{
|
||||
$personnelList = array();
|
||||
|
||||
@@ -73,37 +71,335 @@ class personnelModel extends model
|
||||
->where('type')->eq('project')
|
||||
->andWhere('path')->like("%,$programID,%")
|
||||
->andWhere('deleted')->eq('0')
|
||||
->orderBy($orderBy)
|
||||
->orderBy('id_desc')
|
||||
->fetchAll('id');
|
||||
|
||||
$personnelList['projects'] = $projects;
|
||||
if(empty($projects)) return $personnelList;
|
||||
|
||||
$sprintAndStage = $this->getSprintAndStage($projects);
|
||||
$personnelList['sprintAndStage'] = $sprintAndStage['sprintAndStage'];
|
||||
$personnelList['childrenStage'] = $sprintAndStage['childrenStage'];
|
||||
$personnelList['teams'] = $sprintAndStage['teams'];
|
||||
$personnelList['objectRows'] = $sprintAndStage['objectRows'];
|
||||
$accountPairs = $this->getInvolvedProjects($projects);
|
||||
if(empty($accountPairs)) return $personnelList;
|
||||
|
||||
/* Get the program name for each level. */
|
||||
$programNameList = $this->dao->select('id, name')->from(TABLE_PROGRAM)->where('type')->eq('program')->andWhere('deleted')->eq(0)->fetchPairs();
|
||||
foreach($personnelList['projects'] as $id => $project)
|
||||
$executionPairs = $this->getInvolvedExecutions($projects);
|
||||
$taskInput = $this->getProjectTaskInput($projects, $accountPairs);
|
||||
$bugAndStoryInput = $this->getBugAndStoryInput($accountPairs, $programID);
|
||||
$issueInput = $this->getIssueInput($accountPairs, $projects);
|
||||
$riskInput = $this->getRiskInput($accountPairs, $projects);
|
||||
$userPairs = $this->loadModel('user')->getListByAccounts(array_keys($accountPairs), 'account');
|
||||
foreach($userPairs as $user) $user->role = zget($this->lang->user->roleList, $user->role, $user->role);
|
||||
|
||||
foreach($accountPairs as $account => $projects)
|
||||
{
|
||||
$path = explode(',', $project->path);
|
||||
$path = array_filter($path);
|
||||
unset($path[$id]);
|
||||
$programName = '';
|
||||
foreach($path as $program)
|
||||
{
|
||||
if($program == $id) continue;
|
||||
$programName .= '/' . $programNameList[$program];
|
||||
}
|
||||
$personnelList['projects'][$id]->programName = $programName;
|
||||
$personnelList[$account]['realname'] = $userPairs[$account]->realname;
|
||||
$personnelList[$account]['account'] = $account;
|
||||
$personnelList[$account]['role'] = $userPairs[$account]->role;
|
||||
$personnelList[$account]['projects'] = $projects;
|
||||
$personnelList[$account]['executions'] = zget($executionPairs, $account, 0);
|
||||
|
||||
$personnelList[$account]['createdTask'] = $taskInput[$account]['created'];
|
||||
$personnelList[$account]['finishedTask'] = $taskInput[$account]['finished'];
|
||||
$personnelList[$account]['pendingTask'] = $taskInput[$account]['pending'];
|
||||
$personnelList[$account]['consumedTask'] = $taskInput[$account]['consumed'];
|
||||
$personnelList[$account]['leftTask'] = $taskInput[$account]['left'];
|
||||
|
||||
$personnelList[$account]['createdBug'] = $bugAndStoryInput[$account]['created'];
|
||||
$personnelList[$account]['resolvedBug'] = $bugAndStoryInput[$account]['resolved'];
|
||||
$personnelList[$account]['pendingBug'] = $bugAndStoryInput[$account]['pending'];
|
||||
$personnelList[$account]['UR'] = $bugAndStoryInput[$account]['UR'];
|
||||
$personnelList[$account]['SR'] = $bugAndStoryInput[$account]['SR'];
|
||||
|
||||
$personnelList[$account]['createdIssue'] = $issueInput[$account]['created'];
|
||||
$personnelList[$account]['resolvedIssue'] = $issueInput[$account]['resolved'];
|
||||
$personnelList[$account]['pendingIssue'] = $issueInput[$account]['pending'];
|
||||
|
||||
$personnelList[$account]['createdRisk'] = $riskInput[$account]['created'];
|
||||
$personnelList[$account]['resolvedRisk'] = $riskInput[$account]['resolved'];
|
||||
$personnelList[$account]['pendingRisk'] = $riskInput[$account]['pending'];
|
||||
}
|
||||
|
||||
return $personnelList;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user project risk input.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @param object $projects
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getRiskInput($accounts, $projects)
|
||||
{
|
||||
$risks = $this->dao->select('id,createdBy,resolvedBy,status,assignedTo')->from(TABLE_RISK)
|
||||
->where('PRJ')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetchAll('id');
|
||||
|
||||
/* Initialization personnel risks. */
|
||||
$putInto = array();
|
||||
foreach($accounts as $account => $project)
|
||||
{
|
||||
$putInto[$account]['created'] = 0;
|
||||
$putInto[$account]['resolved'] = 0;
|
||||
$putInto[$account]['pending'] = 0;
|
||||
}
|
||||
|
||||
foreach($risks as $risk)
|
||||
{
|
||||
if($risk->createdBy && isset($putInto[$risk->createdBy])) $putInto[$risk->createdBy]['created'] += 1;
|
||||
if($risk->resolvedBy && isset($putInto[$risk->resolvedBy])) $putInto[$risk->resolvedBy]['resolved'] += 1;
|
||||
if($risk->assignedTo && $risk->status == 'active' && isset($putInto[$risk->assignedTo])) $putInto[$risk->assignedTo]['pending'] += 1;
|
||||
}
|
||||
|
||||
return $putInto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user project issue input.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @param object $projects
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getIssueInput($accounts, $projects)
|
||||
{
|
||||
$issues = $this->dao->select('id,createdBy,resolvedBy,status,assignedTo')->from(TABLE_ISSUE)
|
||||
->where('PRJ')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetchAll('id');
|
||||
|
||||
/* Initialization personnel issues. */
|
||||
$putInto = array();
|
||||
foreach($accounts as $account => $project)
|
||||
{
|
||||
$putInto[$account]['created'] = 0;
|
||||
$putInto[$account]['resolved'] = 0;
|
||||
$putInto[$account]['pending'] = 0;
|
||||
}
|
||||
|
||||
foreach($issues as $issue)
|
||||
{
|
||||
if($issue->createdBy && isset($putInto[$issue->createdBy])) $putInto[$issue->createdBy]['created'] += 1;
|
||||
if($issue->resolvedBy && isset($putInto[$issue->resolvedBy])) $putInto[$issue->resolvedBy]['resolved'] += 1;
|
||||
if($issue->assignedTo && in_array($issue->status, array('unconfirmed', 'confirmed', 'active')) && isset($putInto[$issue->assignedTo])) $putInto[$issue->assignedTo]['pending'] += 1;
|
||||
}
|
||||
|
||||
return $putInto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user bug and story input.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getBugAndStoryInput($accounts, $programID)
|
||||
{
|
||||
$productPairs = $this->loadModel('product')->getPairs('', $programID);
|
||||
$productKeys = array_keys($productPairs);
|
||||
|
||||
$bugs = $this->dao->select('id,status,openedBy,assignedTo,resolvedBy')->from(TABLE_BUG)
|
||||
->where('product')->in($productKeys)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->fetchAll('id');
|
||||
|
||||
$requirement = $this->dao->select('openedBy, count(id) as number')->from(TABLE_STORY)
|
||||
->where('product')->in($productKeys)
|
||||
->andWhere('openedBy')->in(array_keys($accounts))
|
||||
->andWhere('type')->eq('requirement')
|
||||
->andWhere('deleted')->eq(0)
|
||||
->groupBy('openedBy')
|
||||
->fetchPairs('openedBy');
|
||||
|
||||
$story = $this->dao->select('openedBy, count(id) as number')->from(TABLE_STORY)
|
||||
->where('product')->in($productKeys)
|
||||
->andWhere('openedBy')->in(array_keys($accounts))
|
||||
->andWhere('type')->eq('story')
|
||||
->andWhere('deleted')->eq(0)
|
||||
->groupBy('openedBy')
|
||||
->fetchPairs('openedBy');
|
||||
|
||||
/* Initialize bugs and requirements related to personnel. */
|
||||
$putInto = array();
|
||||
foreach($accounts as $account => $project)
|
||||
{
|
||||
$putInto[$account]['created'] = 0;
|
||||
$putInto[$account]['resolved'] = 0;
|
||||
$putInto[$account]['pending'] = 0;
|
||||
$putInto[$account]['UR'] = 0;
|
||||
$putInto[$account]['SR'] = 0;
|
||||
}
|
||||
|
||||
foreach($requirement as $account => $number) $putInto[$account]['UR'] = $number;
|
||||
foreach($story as $account => $number) $putInto[$account]['SR'] = $number;
|
||||
|
||||
foreach($bugs as $bug)
|
||||
{
|
||||
if($bug->openedBy && isset($putInto[$bug->openedBy])) $putInto[$bug->openedBy]['created'] += 1;
|
||||
if($bug->resolvedBy && isset($putInto[$bug->resolvedBy])) $putInto[$bug->resolvedBy]['resolved'] += 1;
|
||||
if($bug->assignedTo && $bug->status == 'active' && isset($putInto[$bug->assignedTo])) $putInto[$bug->assignedTo]['pending'] += 1;
|
||||
}
|
||||
return $putInto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the project member accounts and the number of participating projects.
|
||||
*
|
||||
* @param object $projects
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getInvolvedProjects($projects)
|
||||
{
|
||||
return $this->dao->select('account, count(root) as projects')->from(TABLE_TEAM)
|
||||
->where('root')->in(array_keys($projects))
|
||||
->andWhere('type')->eq('project')
|
||||
->groupBy('account')
|
||||
->fetchPairs('account');
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the iteration or phase under the project.
|
||||
*
|
||||
* @param object $projects
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getInvolvedExecutions($projects)
|
||||
{
|
||||
$executions = $this->dao->select('id')->from(TABLE_PROJECT)
|
||||
->where('type')->in('stage,sprint')
|
||||
->andWhere('project')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq('0')
|
||||
->fetchPairs('id');
|
||||
|
||||
return $this->dao->select('account, count(root) as executions')->from(TABLE_TEAM)
|
||||
->where('root')->in(array_keys($executions))
|
||||
->andWhere('type')->in('stage,sprint')
|
||||
->groupBy('account')
|
||||
->fetchPairs('account');
|
||||
}
|
||||
|
||||
/**
|
||||
* Get project task inputs.
|
||||
*
|
||||
* @param object $projects
|
||||
* @param array $accounts
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getProjectTaskInput($projects, $accounts)
|
||||
{
|
||||
$tasks = $this->dao->select('id,status,openedBy,finishedBy,assignedTo,PRJ')->from(TABLE_TASK)
|
||||
->where('PRJ')->in(array_keys($projects))
|
||||
->andWhere('deleted')->eq('0')
|
||||
->fetchAll('id');
|
||||
|
||||
/* Initialize personnel related tasks. */
|
||||
$putInto = array();
|
||||
foreach($accounts as $account => $project)
|
||||
{
|
||||
$putInto[$account]['created'] = 0;
|
||||
$putInto[$account]['finished'] = 0;
|
||||
$putInto[$account]['pending'] = 0;
|
||||
$putInto[$account]['consumed'] = 0;
|
||||
$putInto[$account]['left'] = 0;
|
||||
}
|
||||
|
||||
/* Number of tasks per person. */
|
||||
$userTasks = array();
|
||||
foreach($tasks as $task)
|
||||
{
|
||||
if($task->openedBy && isset($putInto[$task->openedBy]))
|
||||
{
|
||||
$putInto[$task->openedBy]['created'] += 1;
|
||||
$userTasks[$task->openedBy][$task->id] = $task->id;
|
||||
}
|
||||
|
||||
if($task->finishedBy && isset($putInto[$task->finishedBy]))
|
||||
{
|
||||
$putInto[$task->finishedBy]['finished'] += 1;
|
||||
$userTasks[$task->finishedBy][$task->id] = $task->id;
|
||||
}
|
||||
|
||||
if($task->assignedTo && $task->status == 'wait' && isset($putInto[$task->assignedTo]))
|
||||
{
|
||||
$putInto[$task->assignedTo]['pending'] += 1;
|
||||
$userTasks[$task->assignedTo][$task->id] = $task->id;
|
||||
}
|
||||
}
|
||||
|
||||
/* The number of hours per person. */
|
||||
$userHours = array();
|
||||
if(isset($this->config->qcVersion) || isset($this->config->proVersion) || isset($this->config->bizVersion))
|
||||
{
|
||||
$userHours = $this->getUserEffortHours($userTasks);
|
||||
}
|
||||
else
|
||||
{
|
||||
$userHours = $this->getUserHours($userTasks);
|
||||
}
|
||||
|
||||
foreach($userHours as $account => $hours)
|
||||
{
|
||||
$putInto[$account]['left'] = $hours->left;
|
||||
$putInto[$account]['consumed'] = $hours->consumed;
|
||||
}
|
||||
|
||||
return $putInto;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user hours.
|
||||
*
|
||||
* @param object $userTasks
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getUserEffortHours($userTasks)
|
||||
{
|
||||
$accounts = array();
|
||||
$taskIDList = array();
|
||||
foreach($userTasks as $account => $taskID)
|
||||
{
|
||||
$accounts[] = $account;
|
||||
$taskIDList = array_merge($taskIDList, $taskID);
|
||||
}
|
||||
|
||||
$userHours = $this->dao->select('account, sum(`left`) as `left`, sum(consumed) as consumed')->from(TABLE_EFFORT)
|
||||
->where('account')->in($accounts)
|
||||
->andWhere('objectType')->eq('task')
|
||||
->andWhere('objectID')->in($taskIDList)
|
||||
->groupBy('account')
|
||||
->fetchAll('account');
|
||||
return $userHours;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user hours.
|
||||
*
|
||||
* @param object $userTasks
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getUserHours($userTasks)
|
||||
{
|
||||
$accounts = array();
|
||||
$taskIDList = array();
|
||||
foreach($userTasks as $account => $taskID)
|
||||
{
|
||||
$accounts[] = $account;
|
||||
$taskIDList = array_merge($taskIDList, $taskID);
|
||||
}
|
||||
|
||||
$userHours = $this->dao->select('account, sum(`left`) as `left`, sum(consumed) as consumed')->from(TABLE_TASKESTIMATE)
|
||||
->where('account')->in($accounts)
|
||||
->andWhere('task')->in($taskIDList)
|
||||
->groupBy('account')
|
||||
->fetchAll('account');
|
||||
return $userHours;
|
||||
}
|
||||
|
||||
/**
|
||||
* Access to data on stages and sprints.
|
||||
*
|
||||
@@ -113,71 +409,11 @@ class personnelModel extends model
|
||||
*/
|
||||
public function getSprintAndStage($projects)
|
||||
{
|
||||
/* Get all sprints and iterations under the project. */
|
||||
$projectKeys = array_keys($projects);
|
||||
$projectObjet = $this->dao->select('id,project,model,type,parent,path,grade,name')->from(TABLE_PROJECT)
|
||||
->where('project')->in($projectKeys)
|
||||
->andWhere('deleted')->eq('0')
|
||||
->orderBy('id_desc')
|
||||
->fetchAll();
|
||||
|
||||
/* Get the team's root ID, separate the parent-child iteration. */
|
||||
$rootIDList = array();
|
||||
$sprintAndStage = array();
|
||||
$childrenStage = array();
|
||||
foreach($projectObjet as $id => $object)
|
||||
{
|
||||
if($object->grade == 1)
|
||||
{
|
||||
$sprintAndStage[$object->project][] = $object;
|
||||
}
|
||||
else
|
||||
{
|
||||
$childrenStage[$object->parent][] = $object;
|
||||
}
|
||||
$rootIDList[] = $object->id;
|
||||
}
|
||||
|
||||
$teams = $this->dao->select('t1.id,t1.root,t1.type,t1.role,t1.account,t2.realname')->from(TABLE_TEAM)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account')
|
||||
->where('t1.root')->in($rootIDList)
|
||||
->andWhere('t1.type')->in('stage,sprint')
|
||||
->fetchGroup('root', 'id');
|
||||
|
||||
/* Calculate the number of cross rows for iterations and sprints. */
|
||||
$objectRows = array();
|
||||
foreach($projects as $project)
|
||||
{
|
||||
$objectRows[$project->id] = isset($sprintAndStage[$project->id]) ? count($sprintAndStage[$project->id]) + 1 : 1;
|
||||
if(!isset($sprintAndStage[$project->id])) continue;
|
||||
foreach($sprintAndStage[$project->id] as $object)
|
||||
{
|
||||
$objectRows[$object->id] = 1;
|
||||
if($object->type == 'sprint')
|
||||
{
|
||||
$objectRows[$object->id] = isset($teams[$object->id]) ? count($teams[$object->id]) + 1 : 1;
|
||||
$objectRows[$project->id] += $objectRows[$object->id] > 1 ? count($teams[$object->id]) : 0;;
|
||||
}
|
||||
elseif($object->type == 'stage' && isset($childrenStage[$object->id]))
|
||||
{
|
||||
$objectRows[$object->id] += count($childrenStage[$object->id]);
|
||||
$objectRows[$project->id] += count($childrenStage[$object->id]);
|
||||
foreach($childrenStage[$object->id] as $stage)
|
||||
{
|
||||
$objectRows[$stage->id] = isset($teams[$stage->id]) ? count($teams[$stage->id]) + 1 : 1;
|
||||
$objectRows[$object->id] += $objectRows[$stage->id] > 1 ? count($teams[$stage->id]) : 0;
|
||||
$objectRows[$project->id] += $objectRows[$stage->id] > 1 ? count($teams[$stage->id]) : 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$objectRows[$object->id] = isset($teams[$object->id]) ? count($teams[$object->id]) + 1 : 1;
|
||||
$objectRows[$project->id] += $objectRows[$object->id] > 1 ? count($teams[$object->id]) : 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return array('sprintAndStage' => $sprintAndStage, 'childrenStage' => $childrenStage, 'teams' => $teams, 'objectRows' => $objectRows);
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -15,104 +15,67 @@
|
||||
.main-table tbody>tr:nth-child(odd):hover { background-color: #f5f5f5; }
|
||||
</style>
|
||||
<div id="mainContent" class="main-row fade">
|
||||
<?php if(!empty($inputPersonnel['projects'])):?>
|
||||
<?php if(!empty($inputPersonnel)):?>
|
||||
<div class="main-col">
|
||||
<form class="main-table table-personnel" action="" data-ride="table">
|
||||
<?php $vars = "programID=$programID&browseType=$browseType&orderBy=%s";?>
|
||||
<?php $existChildrenStage = empty($inputPersonnel['childrenStage']) ? false : true;?>
|
||||
<table id="accessibleList" class="table table-bordered has-sort-head">
|
||||
<form class="main-table table-product" data-ride="table" method="post" action="">
|
||||
<table class="table has-sort-head table-fixed table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="w-160px"><?php echo $lang->personnel->program;?></th>
|
||||
<th class="w-100px"><?php echo common::printOrderLink('id', $orderBy, $vars, $lang->personnel->project);?></th>
|
||||
<th class="w-80px"><?php echo $lang->personnel->sprint;?></th>
|
||||
<?php if($existChildrenStage):?>
|
||||
<th class="w-80px"><?php echo $lang->personnel->childrenStage;?></th>
|
||||
<?php endif;?>
|
||||
<th class="w-60px"><?php echo $lang->personnel->user;?></th>
|
||||
<th class="w-60px"><?php echo $lang->personnel->role;?></th>
|
||||
<tr class="text-center">
|
||||
<th rowspan='2'><?php echo $lang->personnel->name;?></th>
|
||||
<th rowspan='2'><?php echo $lang->personnel->role;?></th>
|
||||
<th rowspan='2'><?php echo $lang->personnel->projects;?></th>
|
||||
<th rowspan='2'><?php echo $lang->personnel->executions;?></th>
|
||||
<th colspan="2"><?php echo $lang->personnel->workingHours;?></th>
|
||||
<th colspan="3"><?php echo $lang->personnel->task;?></th>
|
||||
<th colspan="3"><?php echo $lang->personnel->bug;?></th>
|
||||
<th colspan="2"><?php echo $lang->personnel->createStory;?></th>
|
||||
<th colspan="3"><?php echo $lang->personnel->issue;?></th>
|
||||
<th colspan="3"><?php echo $lang->personnel->risk;?></th>
|
||||
</tr>
|
||||
<tr class="text-center">
|
||||
<th><?php echo $lang->personnel->putInto;?></th>
|
||||
<th><?php echo $lang->personnel->surplus;?></th>
|
||||
<th><?php echo $lang->personnel->created;?></th>
|
||||
<th><?php echo $lang->personnel->finished;?></th>
|
||||
<th><?php echo $lang->personnel->pending;?></th>
|
||||
<th><?php echo $lang->personnel->created;?></th>
|
||||
<th><?php echo $lang->personnel->resolved;?></th>
|
||||
<th><?php echo $lang->personnel->pending;?></th>
|
||||
<th><?php echo $lang->personnel->UR;?></th>
|
||||
<th><?php echo $lang->personnel->SR;?></th>
|
||||
<th><?php echo $lang->personnel->created;?></th>
|
||||
<th><?php echo $lang->personnel->resolved;?></th>
|
||||
<th><?php echo $lang->personnel->pending;?></th>
|
||||
<th><?php echo $lang->personnel->created;?></th>
|
||||
<th><?php echo $lang->personnel->resolved;?></th>
|
||||
<th><?php echo $lang->personnel->pending;?></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach($inputPersonnel['projects'] as $project):?>
|
||||
<tbody class="sortable">
|
||||
<?php foreach($inputPersonnel as $personnel):?>
|
||||
<tr>
|
||||
<?php $projectRow = $inputPersonnel['objectRows'][$project->id];?>
|
||||
<?php if($browseType == 'noempty' && $projectRow == 1) continue;?>
|
||||
<td class="text-ellipsis" rowspan="<?php echo $projectRow;?>" title="<?php echo $project->programName;?>"><?php echo $project->programName;?></td>
|
||||
<td class="text-ellipsis" rowspan="<?php echo $projectRow;?>" title="<?php echo $project->name;?>"><?php echo $project->name;?></td>
|
||||
<?php if($projectRow == 1):?>
|
||||
<?php if($existChildrenStage):?>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo $personnel['realname'];?></td>
|
||||
<td><?php echo $personnel['role'];?></td>
|
||||
<td><?php echo $personnel['projects'];?></td>
|
||||
<td><?php echo $personnel['executions'];?></td>
|
||||
<td><?php echo $personnel['consumedTask'];?></td>
|
||||
<td><?php echo $personnel['leftTask'];?></td>
|
||||
<td><?php echo $personnel['createdTask'];?></td>
|
||||
<td><?php echo $personnel['finishedTask'];?></td>
|
||||
<td><?php echo $personnel['pendingTask'];?></td>
|
||||
<td><?php echo $personnel['createdBug'];?></td>
|
||||
<td><?php echo $personnel['resolvedBug'];?></td>
|
||||
<td><?php echo $personnel['pendingBug'];?></td>
|
||||
<td><?php echo $personnel['UR'];?></td>
|
||||
<td><?php echo $personnel['SR'];?></td>
|
||||
<td><?php echo $personnel['createdIssue'];?></td>
|
||||
<td><?php echo $personnel['resolvedIssue'];?></td>
|
||||
<td><?php echo $personnel['pendingIssue'];?></td>
|
||||
<td><?php echo $personnel['createdRisk'];?></td>
|
||||
<td><?php echo $personnel['resolvedRisk'];?></td>
|
||||
<td><?php echo $personnel['pendingRisk'];?></td>
|
||||
</tr>
|
||||
|
||||
<?php if(isset($inputPersonnel['sprintAndStage'][$project->id])):;?>
|
||||
<?php foreach($inputPersonnel['sprintAndStage'][$project->id] as $object):?>
|
||||
<?php $objectRow = $inputPersonnel['objectRows'][$object->id];?>
|
||||
<tr>
|
||||
<td class="text-ellipsis" id="<?php echo $object->id;?>" rowspan="<?php echo $objectRow;?>" title="<?php echo $object->name;?>"><?php echo $object->name;?></td>
|
||||
<?php if($objectRow == 1):?>
|
||||
<?php if($existChildrenStage):?>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
|
||||
<?php if($object->type == 'sprint' && $objectRow > 1):?>
|
||||
<?php foreach($inputPersonnel['teams'][$object->id] as $team):?>
|
||||
<tr>
|
||||
<?php if($existChildrenStage):?>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo $team->realname;?></td>
|
||||
<td><?php echo $team->role;?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
|
||||
<?php if($object->type == 'stage' && $object->grade == 1):?>
|
||||
<?php if(isset($inputPersonnel['childrenStage'][$object->id])):?>
|
||||
<?php foreach($inputPersonnel['childrenStage'][$object->id] as $stage):?>
|
||||
<tr>
|
||||
<?php $teamRow = $inputPersonnel['objectRows'][$stage->id];?>
|
||||
<td class="text-ellipsis" rowspan="<?php echo $teamRow;?>" title="<?php echo $stage->name;?>"><?php echo $stage->name;?></td>
|
||||
<?php if($teamRow == 1):?>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
</tr>
|
||||
<?php if($teamRow > 1):?>
|
||||
<?php foreach($inputPersonnel['teams'][$stage->id] as $team):?>
|
||||
<tr>
|
||||
<td><?php echo $team->realname;?></td>
|
||||
<td><?php echo $team->role;?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php else:?>
|
||||
<?php if(isset($inputPersonnel['teams'][$object->id])):?>
|
||||
<?php foreach($inputPersonnel['teams'][$object->id] as $team):?>
|
||||
<tr>
|
||||
<?php if($existChildrenStage):?>
|
||||
<td></td>
|
||||
<?php endif;?>
|
||||
<td><?php echo $team->realname;?></td>
|
||||
<td><?php echo $team->role;?></td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
<?php endforeach;?>
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
|
||||
@@ -46,6 +46,25 @@ class userModel extends model
|
||||
->fetchAll();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get user information by accounts.
|
||||
*
|
||||
* @param array $accounts
|
||||
* @param string $keyField
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getListByAccounts($accounts = array(), $keyField = 'id')
|
||||
{
|
||||
if(empty($accounts)) return array();
|
||||
|
||||
return $this->dao->select('id,account,realname,role')->from(TABLE_USER)
|
||||
->where('account')->in($accounts)
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('type')->eq('inside')
|
||||
->fetchAll($keyField);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the account=>realname pairs.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user