* Code for block riskList.

This commit is contained in:
holan20180123
2020-08-20 16:27:26 +08:00
parent 1cced1537d
commit f5319cee4e
11 changed files with 118 additions and 3 deletions

View File

@@ -224,6 +224,8 @@ $lang->action->label->unlinkchildrenstory = "unlinked a child story";
$lang->action->label->linkparentstory = "linked a parent story";
$lang->action->label->unlinkparentstory = "unlink from parent story";
$lang->action->label->deletechildrenstory = "delete children story";
$lang->action->label->tracked = 'tracked';
$lang->action->label->hangup = 'hangup';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass;
@@ -400,6 +402,7 @@ $lang->action->label->testreport = 'Berichte|testreport|view|report=%s';
$lang->action->label->entry = 'Eintrag|entry|browse|';
$lang->action->label->webhook = 'Webhook|webhook|browse|';
$lang->action->label->space = ' ';
$lang->action->label->risk = 'Risk|risk|view|riskID=%s';
/* Object type. */
$lang->action->search->objectTypeList[''] = '';

View File

@@ -224,6 +224,8 @@ $lang->action->label->unlinkchildrenstory = "unlinked a child story";
$lang->action->label->linkparentstory = "linked a parent story";
$lang->action->label->unlinkparentstory = "unlink from parent story";
$lang->action->label->deletechildrenstory = "delete children story";
$lang->action->label->tracked = 'tracked';
$lang->action->label->hangup = 'hangup';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
@@ -400,6 +402,7 @@ $lang->action->label->testreport = 'Report|testreport|view|report=%s';
$lang->action->label->entry = 'Application|entry|browse|';
$lang->action->label->webhook = 'Webhook|webhook|browse|';
$lang->action->label->space = ' ';
$lang->action->label->risk = 'Risk|risk|view|riskID=%s';
/* Object type. */
$lang->action->search->objectTypeList[''] = '';

View File

@@ -224,6 +224,8 @@ $lang->action->label->unlinkchildrenstory = "unlinked a child story";
$lang->action->label->linkparentstory = "linked a parent story";
$lang->action->label->unlinkparentstory = "unlink from parent story";
$lang->action->label->deletechildrenstory = "delete children story";
$lang->action->label->tracked = 'tracked';
$lang->action->label->hangup = 'hangup';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass;
@@ -400,6 +402,7 @@ $lang->action->label->testreport = 'Rapport|testreport|view|report=%s';
$lang->action->label->entry = 'Application|entry|browse|';
$lang->action->label->webhook = 'Webhook|webhook|browse|';
$lang->action->label->space = ' ';
$lang->action->label->risk = 'Risk|risk|view|riskID=%s';
/* Object type. */
$lang->action->search->objectTypeList[''] = '';

View File

@@ -224,6 +224,8 @@ $lang->action->label->unlinkchildrenstory = "hủy liên kết a child story";
$lang->action->label->linkparentstory = "linked a parent story";
$lang->action->label->unlinkparentstory = "unlink from parent story";
$lang->action->label->deletechildrenstory = "delete children story";
$lang->action->label->tracked = 'tracked';
$lang->action->label->hangup = 'hangup';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
@@ -400,6 +402,7 @@ $lang->action->label->testreport = 'Báo cáo|testreport|view|report=%s';
$lang->action->label->entry = 'Ứng dụng|entry|browse|';
$lang->action->label->webhook = 'Webhook|webhook|browse|';
$lang->action->label->space = ' ';
$lang->action->label->risk = 'Risk|risk|view|riskID%s';
/* Object type. */
$lang->action->search->objectTypeList[''] = '';

View File

@@ -224,6 +224,8 @@ $lang->action->label->unlinkchildrenstory = "取消关联子需求";
$lang->action->label->linkparentstory = "关联到父需求";
$lang->action->label->unlinkparentstory = "从父需求取消关联";
$lang->action->label->deletechildrenstory = "删除子需求";
$lang->action->label->tracked = '跟踪了';
$lang->action->label->hangup = '挂起了';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass();
@@ -400,6 +402,7 @@ $lang->action->label->testreport = '报告|testreport|view|report=%s';
$lang->action->label->entry = '应用|entry|browse|';
$lang->action->label->webhook = 'Webhook|webhook|browse|';
$lang->action->label->space = ' ';
$lang->action->label->risk = '风险|risk|view|riskID=%s';
/* Object type. */
$lang->action->search->objectTypeList[''] = '';

View File

@@ -224,6 +224,8 @@ $lang->action->label->unlinkchildrenstory = "取消關聯子需求";
$lang->action->label->linkparentstory = "關聯到父需求";
$lang->action->label->unlinkparentstory = "從父需求取消關聯";
$lang->action->label->deletechildrenstory = "刪除子需求";
$lang->action->label->tracked = '跟踪了';
$lang->action->label->hangup = '挂起了';
/* 動態信息按照對象分組 */
$lang->action->dynamicAction = new stdclass();
@@ -400,6 +402,7 @@ $lang->action->label->testreport = '報告|testreport|view|report=%s';
$lang->action->label->entry = '應用|entry|browse|';
$lang->action->label->webhook = 'Webhook|webhook|browse|';
$lang->action->label->space = ' ';
$lang->action->label->risk = '風險|risk|view|riskID=%s';
/* Object type. */
$lang->action->search->objectTypeList[''] = '';

View File

@@ -1034,7 +1034,7 @@ class block extends control
$this->session->set('riskList', $uri);
if(preg_match('/[^a-zA-Z0-9_]/', $this->params->type)) die();
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->issues = $this->loadModel('issue')->getBlockIssues($this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->num, null, $this->params->orderBy);
$this->view->issues = $this->loadModel('issue')->getBlockIssues($this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->num, $this->params->orderBy);
}
/**
@@ -1045,7 +1045,10 @@ class block extends control
*/
public function printCmmiRiskBlock()
{
$this->view->program = $this->loadModel('project')->getByID($this->session->program);
$uri = $this->app->getURI(true);
$this->session->set('riskList', $uri);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->risks = $this->loadModel('risk')->getBlockRisks($this->params->type, $this->viewType == 'json' ? 0 : (int)$this->params->num, $this->params->orderBy);
}
/**

View File

@@ -0,0 +1,51 @@
<?php if(empty($risks)): ?>
<div class='empty-tip'><?php echo $lang->block->emptyTip;?></div>
<?php else:?>
<style>
.block-risks .c-pri {width: 45px;text-align: center;}
.block-risks .c-status {width: 80px;}
</style>
<div class='panel-body has-table scrollbar-hover'>
<table class='table table-borderless table-hover table-fixed table-fixed-head tablesorter block-risks <?php if(!$longBlock) echo 'block-sm';?>'>
<thead>
<tr>
<th class='c-id'><?php echo $lang->idAB;?></th>
<th class='c-name'><?php echo $lang->risk->name;?></th>
<?php if($longBlock):?>
<th class='w-100px'> <?php echo $lang->risk->strategy;?></th>
<?php endif;?>
<th class='w-80px'><?php echo $lang->risk->status;?></th>
<?php if($longBlock):?>
<th class='w-80px'><?php echo $lang->risk->riskindex;?></th>
<th class='w-80px'><?php echo $lang->risk->pri;?></th>
<th class='w-120px'><?php echo $lang->risk->assignedTo;?></th>
<th class='w-120px'><?php echo $lang->risk->category;?></th>
<?php endif;?>
</tr>
</thead>
<tbody>
<?php foreach($risks as $risk):?>
<?php
$viewLink = $this->createLink('risk', 'view', "riskID={$risk->id}");
?>
<tr>
<td class='c-id-xs'><?php echo sprintf('%03d', $risk->id);?></td>
<td class='c-name' title='<?php echo $risk->name?>'><?php echo html::a($viewLink, $risk->name);?></td>
<?php if($longBlock):?>
<td class='c-strategy'><?php echo zget($lang->risk->strategyList, $risk->strategy, $risk->strategy)?></td>
<?php endif;?>
<td class='c-status'>
<span class="status-risk status-<?php echo $risk->status?>"><?php echo zget($lang->risk->statusList, $risk->status);?></span>
</td>
<?php if($longBlock):?>
<td class='c-riskindex'><?php echo $risk->riskindex?></td>
<td class='c-pri'><?php echo zget($lang->risk->priList, $risk->pri, $risk->pri)?></td>
<td><?php echo zget($users, $risk->assignedTo, $risk->assignedTo)?></td>
<td class='c-category'><?php echo zget($lang->risk->categoryList, $risk->category, $risk->category)?></td>
<?php endif;?>
</tr>
<?php endforeach;?>
</tbody>
</table>
</div>
<?php endif;?>

View File

@@ -180,6 +180,30 @@ $lang->program->methodOrder[60] = 'setPlanduration';
$lang->program->methodOrder[65] = 'manageMembers';
$lang->program->methodOrder[70] = 'export';
/* Risk . */
$lang->resource->risk = new stdclass();
$lang->resource->risk->browse = 'browse';
$lang->resource->risk->create = 'create';
$lang->resource->risk->edit = 'edit';
$lang->resource->risk->delete = 'delete';
$lang->resource->risk->activate = 'activate';
$lang->resource->risk->close = 'close';
$lang->resource->risk->hangup = 'hangup';
$lang->resource->risk->batchCreate = 'batchCreate';
$lang->resource->risk->cancel = 'cancel';
$lang->resource->risk->track = 'track';
$lang->risk->methodOrder[5] = 'browse';
$lang->risk->methodOrder[10] = 'create';
$lang->risk->methodOrder[15] = 'edit';
$lang->risk->methodOrder[20] = 'delete';
$lang->risk->methodOrder[25] = 'activate';
$lang->risk->methodOrder[30] = 'close';
$lang->risk->methodOrder[35] = 'hangup';
$lang->risk->methodOrder[40] = 'batchCreate';
$lang->risk->methodOrder[45] = 'cancel';
$lang->risk->methodOrder[50] = 'track';
/* Product. */
$lang->resource->product = new stdclass();
$lang->resource->product->index = 'index';

View File

@@ -11,7 +11,7 @@ $lang->risk->close = '关闭';
$lang->risk->cancel = '取消';
$lang->risk->track = '跟踪';
$lang->risk->assignTo = '指派';
$lang->risk->deleted = '删除';
$lang->risk->delete = '删除';
$lang->risk->byQuery = '搜索';
/* Fields */

View File

@@ -195,6 +195,25 @@ class riskModel extends model
return $this->dao->select('*')->from(TABLE_RISK)->where('id')->eq((int)$riskID)->fetch();
}
/**
* Get block risks
*
* @param string $browseType
* @param int $limit
* @param string $orderBy
* @access public
* @return object
*/
public function getBlockRisks($browseType = 'all', $limit = 15, $orderBy = 'id_desc')
{
return $this->dao->select('*')->from(TABLE_RISK)
->where('program')->eq($this->session->program)
->andWhere('deleted')->eq('0')
->orderBy($orderBy)
->limit($limit)
->fetchAll();
}
/**
* Print assignedTo html
*