From f5319cee4e079f5bcffa5ccbe1bb0a5ffe9dbfe0 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 20 Aug 2020 16:27:26 +0800 Subject: [PATCH] * Code for block riskList. --- module/action/lang/de.php | 3 ++ module/action/lang/en.php | 3 ++ module/action/lang/fr.php | 3 ++ module/action/lang/vi.php | 3 ++ module/action/lang/zh-cn.php | 3 ++ module/action/lang/zh-tw.php | 3 ++ module/block/control.php | 7 +++- module/block/view/cmmiriskblock.html.php | 51 ++++++++++++++++++++++++ module/group/lang/resource.php | 24 +++++++++++ module/risk/lang/zh-cn.php | 2 +- module/risk/model.php | 19 +++++++++ 11 files changed, 118 insertions(+), 3 deletions(-) diff --git a/module/action/lang/de.php b/module/action/lang/de.php index 0894b152cc..3dd5720193 100644 --- a/module/action/lang/de.php +++ b/module/action/lang/de.php @@ -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[''] = ''; diff --git a/module/action/lang/en.php b/module/action/lang/en.php index 8b0ec75269..ba6d92efc9 100755 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -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[''] = ''; diff --git a/module/action/lang/fr.php b/module/action/lang/fr.php index 1e86546ae8..e391d748e1 100644 --- a/module/action/lang/fr.php +++ b/module/action/lang/fr.php @@ -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[''] = ''; diff --git a/module/action/lang/vi.php b/module/action/lang/vi.php index cf850adb39..7e99a7a548 100644 --- a/module/action/lang/vi.php +++ b/module/action/lang/vi.php @@ -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[''] = ''; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 71b78ecbc6..db6c3aef0f 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -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[''] = ''; diff --git a/module/action/lang/zh-tw.php b/module/action/lang/zh-tw.php index 6251b07bc5..1718c581d3 100755 --- a/module/action/lang/zh-tw.php +++ b/module/action/lang/zh-tw.php @@ -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[''] = ''; diff --git a/module/block/control.php b/module/block/control.php index 4a034203b5..6d536d04e2 100644 --- a/module/block/control.php +++ b/module/block/control.php @@ -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); } /** diff --git a/module/block/view/cmmiriskblock.html.php b/module/block/view/cmmiriskblock.html.php index e69de29bb2..039082fdfb 100644 --- a/module/block/view/cmmiriskblock.html.php +++ b/module/block/view/cmmiriskblock.html.php @@ -0,0 +1,51 @@ + +
block->emptyTip;?>
+ + +
+ '> + + + + + + + + + + + + + + + + + + + createLink('risk', 'view', "riskID={$risk->id}"); + ?> + + + + + + + + + + + + + + + + +
idAB;?>risk->name;?> risk->strategy;?>risk->status;?>risk->riskindex;?>risk->pri;?>risk->assignedTo;?>risk->category;?>
id);?>name);?>risk->strategyList, $risk->strategy, $risk->strategy)?> + risk->statusList, $risk->status);?> + riskindex?>risk->priList, $risk->pri, $risk->pri)?>assignedTo, $risk->assignedTo)?>risk->categoryList, $risk->category, $risk->category)?>
+
+ diff --git a/module/group/lang/resource.php b/module/group/lang/resource.php index ade26fa1ee..be42041b55 100644 --- a/module/group/lang/resource.php +++ b/module/group/lang/resource.php @@ -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'; diff --git a/module/risk/lang/zh-cn.php b/module/risk/lang/zh-cn.php index 3017926153..b713342a56 100644 --- a/module/risk/lang/zh-cn.php +++ b/module/risk/lang/zh-cn.php @@ -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 */ diff --git a/module/risk/model.php b/module/risk/model.php index 467b69b9f2..9dfaf13c1c 100644 --- a/module/risk/model.php +++ b/module/risk/model.php @@ -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 *