From 1288cc0803e836cad1fd0b9902a50c5622493708 Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Wed, 19 Aug 2020 15:40:59 +0800 Subject: [PATCH 1/9] * Add batchCreate method. --- module/issue/control.php | 26 ++++++++++ module/issue/model.php | 41 +++++++++++++++- module/issue/view/batchcreate.html.php | 66 ++++++++++++++++++++++++++ 3 files changed, 132 insertions(+), 1 deletion(-) create mode 100644 module/issue/view/batchcreate.html.php diff --git a/module/issue/control.php b/module/issue/control.php index d6c4231c56..b537006768 100644 --- a/module/issue/control.php +++ b/module/issue/control.php @@ -53,4 +53,30 @@ class issue extends control $this->display(); } + + + /** + * batchCreate issues + * + * @access public + * @return void + */ + public function batchCreate() + { + if($_POST) + { + $results = $this->issue->batchCreate(); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all'))); + } + + $this->view->title = $this->lang->issue->common . $this->lang->colon . $this->lang->issue->batchCreate; + $this->view->position[] = $this->lang->issue->common; + $this->view->position[] = $this->lang->issue->batchCreate; + + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + + $this->display(); + } + } diff --git a/module/issue/model.php b/module/issue/model.php index 7e2e8cc72c..0f53e7d601 100644 --- a/module/issue/model.php +++ b/module/issue/model.php @@ -15,7 +15,7 @@ class issueModel extends model { public function create() { - $now = helper::now(); + $now = helper::now(); $data = fixer::input('post') ->add('createdBy', $this->app->user->account) ->add('createdDate', $now) @@ -45,4 +45,43 @@ class issueModel extends model $this->dao->insert(TABLE_ISSUE)->data($data)->exec(); return true; } + + /** + * Batch create issue. + * + * @access public + * @return void + */ + public function batchCreate() + { + $now = helper::now(); + $data = fixer::input('post')->get(); + + $issues = array(); + foreach($data->dataList as $issue) + { + if(!trim($issue['title'])) continue; + + $issue['createdBy'] = $this->app->user->account; + $issue['createdDate'] = $now; + + if($issue['assignedTo']) + { + $issue['assignedBy'] = $this->app->user->account; + $issue['assignedDate'] = $now; + } + + foreach(explode(',',$this->config->issue->create->requiredFields) as $field) + { + $field = trim($field); + if($field and empty($issue["$field"])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->issue->$field))); + } + + $issues[] = $issue; + } + + foreach($issues as $issue) $this->dao->insert(TABLE_ISSUE)->data($issue)->exec(); + + return true; + } } diff --git a/module/issue/view/batchcreate.html.php b/module/issue/view/batchcreate.html.php new file mode 100644 index 0000000000..62331b46a4 --- /dev/null +++ b/module/issue/view/batchcreate.html.php @@ -0,0 +1,66 @@ + + * @package issue + * @version $Id$ + * @link http://www.zentao.net + */ +?> + +
+
+

issue->batchCreate;?>

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
issue->title;?>issue->type;?>issue->severity;?>issue->desc;?>issue->pri;?>issue->deadline;?>issue->assignedTo;?>
+ + + issue->typeList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'type"')?> + + issue->serverityList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'severity"')?> + + + + issue->priList, '', 'class="form-control chosen chosen-controled" id="dataList'.$i.'pri"')?> + + + + +
+
+ + +
+
+
+ + From f84599de14be71173946252ded456205d2feac58 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 19 Aug 2020 15:54:32 +0800 Subject: [PATCH 2/9] * Improve the problem function module. --- module/issue/config.php | 8 +- module/issue/control.php | 212 ++++++++++++++++++++++++-- module/issue/lang/zh-cn.php | 19 ++- module/issue/model.php | 224 +++++++++++++++++++++++++--- module/issue/view/activate.html.php | 43 ++++++ module/issue/view/assignto.html.php | 39 +++++ module/issue/view/browse.html.php | 68 ++++++++- module/issue/view/cancel.html.php | 48 ++++++ module/issue/view/close.html.php | 43 ++++++ module/issue/view/create.html.php | 106 ++++++------- module/issue/view/edit.html.php | 71 +++++++++ module/issue/view/resolve.html.php | 65 ++++++++ 12 files changed, 852 insertions(+), 94 deletions(-) create mode 100644 module/issue/view/activate.html.php create mode 100644 module/issue/view/assignto.html.php create mode 100644 module/issue/view/cancel.html.php create mode 100644 module/issue/view/close.html.php create mode 100644 module/issue/view/edit.html.php create mode 100644 module/issue/view/resolve.html.php diff --git a/module/issue/config.php b/module/issue/config.php index 7ed6ebfba3..c80ed978c8 100644 --- a/module/issue/config.php +++ b/module/issue/config.php @@ -1,6 +1,12 @@ issue->create = new stdclass(); +$config->issue->edit = new stdclass(); + $config->issue->create->requiredFields = 'title,type,severity'; +$config->issue->edit->requiredFields = 'title,type,severity'; $config->issue->editor = new stdclass(); -$config->issue->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->issue->editor->create = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->issue->editor->edit = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->issue->editor->cancel = array('id' => 'desc', 'tools' => 'simpleTools'); +$config->issue->editor->resolve = array('id' => 'resolutionComment', 'tools' => 'simpleTools'); diff --git a/module/issue/control.php b/module/issue/control.php index b537006768..0fb41af1b1 100644 --- a/module/issue/control.php +++ b/module/issue/control.php @@ -24,9 +24,23 @@ class issue extends control */ public function browse($browseType = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { + $browseType = strtolower($browseType); + /* Load pager */ + $this->app->loadClass('pager', true); + $pager = pager::init($recTotal, $recPerPage, $pageID); + $this->view->title = $this->lang->issue->common . $this->lang->colon . $this->lang->issue->browse; $this->view->position[] = $this->lang->issue->browse; + $this->view->pager = $pager; + $this->view->recTotal = $recTotal; + $this->view->recPerPage = $recPerPage; + $this->view->pageID = $pageID; + $this->view->orderBy = $orderBy; + $this->view->browseType = $browseType; + $this->view->issueList = $this->issue->getIssueList($browseType, $orderBy, $pager); + $this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted'); + $this->display(); } @@ -40,8 +54,9 @@ class issue extends control { if($_POST) { - $result = $this->issue->create(); + $issueID = $this->issue->create(); if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + $this->loadModel('action')->create('issue', $issueID, 'Opened'); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all'))); } @@ -53,8 +68,7 @@ class issue extends control $this->display(); } - - + /** * batchCreate issues * @@ -63,20 +77,194 @@ class issue extends control */ public function batchCreate() { - if($_POST) - { - $results = $this->issue->batchCreate(); - if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); - $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all'))); - } - + if($_POST) + { + $results = $this->issue->batchCreate(); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all'))); + } + $this->view->title = $this->lang->issue->common . $this->lang->colon . $this->lang->issue->batchCreate; $this->view->position[] = $this->lang->issue->common; - $this->view->position[] = $this->lang->issue->batchCreate; + $this->view->position[] = $this->lang->issue->batchCreate; $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); - $this->display(); + $this->display(); } + /** + * Delete a issue. + * + * @param int $issueID + * @param string $confirm yes|no + * @access public + * @return void + */ + public function delete($issueID = 0, $confirm = 'no') + { + if($confirm == 'no') + { + die(js::confirm($this->lang->issue->confirmDelete, inLink('delete', "issueID=$issueID&confirm=yes"))); + } + else + { + $this->issue->delete($issueID); + die(js::reload('parent')); + } + } + + /** + * Edit a issue. + * + * @param int $issueID + * @access public + * @return void + */ + public function edit($issueID) + { + if($_POST) + { + $changes = $this->issue->update($issueID); + if(dao::isError()) return $this->send(array('result' => 'fail', 'message' => dao::getError())); + + $actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited'); + $this->action->logHistory($actionID, $changes); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inLink('browse', 'browseType=all'))); + } + + $this->view->title = $this->lang->issue->common . $this->lang->colon . $this->lang->issue->edit; + $this->view->position[] = $this->lang->issue->common; + $this->view->position[] = $this->lang->issue->edit; + + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + $this->view->issue = $this->issue->getByID($issueID); + + $this->display(); + } + + /** + * Assign a issue. + * + * @param int $issueID + * @access public + * @return void + */ + public function assignTo($issueID) + { + if($_POST) + { + $changes = $this->issue->assignTo($issueID); + + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited'); + + $this->action->logHistory($actionID, $changes); + die(js::closeModal('parent.parent', 'this')); + } + + $this->view->issue = $this->issue->getByID($issueID); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + + $this->display(); + } + + /** + * Close a issue. + * + * @param int $issueID + * @access public + * @return void + */ + public function close($issueID) + { + if($_POST) + { + $changes = $this->issue->close($issueID); + + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited'); + + $this->action->logHistory($actionID, $changes); + die(js::closeModal('parent.parent', 'this')); + } + + $this->view->issue = $this->issue->getByID($issueID); + + $this->display(); + } + + /** + * Cancel a issue. + * + * @param int $issueID + * @access public + * @return void + */ + public function cancel($issueID) + { + if($_POST) + { + $changes = $this->issue->cancel($issueID); + + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited'); + + $this->action->logHistory($actionID, $changes); + die(js::closeModal('parent.parent', 'this')); + } + + $this->view->issue = $this->issue->getByID($issueID); + + $this->display(); + } + + /** + * Activate a issue. + * + * @param int $issueID + * @access public + * @return void + */ + public function activate($issueID) + { + if($_POST) + { + $changes = $this->issue->activate($issueID); + + if(dao::isError()) die(js::error(dao::getError())); + $actionID = $this->loadModel('action')->create('issue', $issueID, 'Edited'); + + $this->action->logHistory($actionID, $changes); + die(js::closeModal('parent.parent', 'this')); + } + + $this->view->issue = $this->issue->getByID($issueID); + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + + $this->display(); + } + + /** + * Resolve a issue. + * + * @param int $issue + * @access public + * @return void + */ + public function resolve($issue) + { + if($_POST) + { + $this->issue->resolve($issue); + $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse'))); + } + + $this->view->title = $this->lang->issue->resolved; + $this->view->issue = $this->issue->getByID($issue); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + + $this->display(); + } +>>>>>>> Stashed changes } diff --git a/module/issue/lang/zh-cn.php b/module/issue/lang/zh-cn.php index fda597551e..3f74e74db2 100644 --- a/module/issue/lang/zh-cn.php +++ b/module/issue/lang/zh-cn.php @@ -29,11 +29,16 @@ $lang->issue->assignedBy = '由谁指派'; $lang->issue->assignedDate = '指派时间'; $lang->issue->resolved = '解决'; -$lang->issue->create = '新建'; +$lang->issue->delete = '删除'; +$lang->issue->active = '激活'; +$lang->issue->assign = '指派'; +$lang->issue->create = '新建问题'; +$lang->issue->edit = '编辑问题'; $lang->issue->batchCreate = '批量新建'; +$lang->issue->labelList['all'] = '全部'; $lang->issue->labelList['open'] = '开放'; -$lang->issue->labelList['assignTo'] = '指派给我'; +$lang->issue->labelList['assignto'] = '指派给我'; $lang->issue->labelList['closed'] = '已关闭'; $lang->issue->labelList['suspended'] = '已挂起'; $lang->issue->labelList['cancelled'] = '已取消'; @@ -72,4 +77,14 @@ $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'] = '已解决'; +$lang->issue->resolveMethods['totask'] = '转任务'; +$lang->issue->resolveMethods['tobug'] = '转BUG'; +$lang->issue->resolveMethods['tostory'] = '转需求'; +$lang->issue->resolveMethods['torisk'] = '转风险'; + +$lang->issue->confirmDelete = '您确认删除该问题?'; diff --git a/module/issue/model.php b/module/issue/model.php index 0f53e7d601..20e16698b5 100644 --- a/module/issue/model.php +++ b/module/issue/model.php @@ -13,12 +13,20 @@ add('createdBy', $this->app->user->account) ->add('createdDate', $now) + ->add('program', $this->session->program) + ->remove('labels,files') ->addIF($this->post->assignedTo, 'assignedBy', $this->app->user->account) ->addIF($this->post->assignedTo, 'assignedDate', $now) ->stripTags($this->config->issue->editor->create['id'], $this->config->allowedTags) @@ -43,9 +51,178 @@ class issueModel extends model } $this->dao->insert(TABLE_ISSUE)->data($data)->exec(); - return true; + $issueID = $this->dao->lastInsertID(); + $this->loadModel('file')->saveUpload('issue', $issueID); + + return $issueID; } - + + /** + * Get question list data. + * + * @param string $browseType + * @param string $orderBy + * @param object $pager + * @access public + * @return object + */ + public function getIssueList($browseType = 'all', $orderBy = 'id_desc', $pager = null) + { + $issueList = $this->dao->select('*')->from(TABLE_ISSUE) + ->where('program')->eq($this->session->program) + ->andWhere('deleted')->eq('0') + ->beginIF($browseType == 'open')->andWhere('status')->eq('active')->fi() + ->beginIF($browseType == 'assignto')->andWhere('assignedTo')->eq($this->app->user->account)->fi() + ->beginIF($browseType == 'closed')->andWhere('status')->eq('closed')->fi() + ->beginIF($browseType == 'suspended')->andWhere('status')->eq('suspended')->fi() + ->beginIF($browseType == 'cancelled')->andWhere('status')->eq('canceled')->fi() + ->orderBy($orderBy) + ->page($pager) + ->fetchAll(); + + return $issueList; + } + + /** + * Delete a question. + * + * @param int $issueID + * @param int $null + * @access public + * @return object + */ + public function delete($issueID = 0, $null = null) + { + $this->dao->update(TABLE_ISSUE)->set('deleted')->eq('1')->where('id')->eq($issueID)->exec(); + } + + /** + * Get a issue details. + * + * @param int $issueID + * @access public + * @return object + */ + public function getByID($issueID) + { + return $this->dao->select('*')->from(TABLE_ISSUE)->where('id')->eq($issueID)->andWhere('deleted')->eq('0')->fetch(); + } + + /** + * Update a question. + * + * @param int $issueID + * @access public + * @return bool + */ + public function update($issueID) + { + $now = helper::now(); + $data = fixer::input('post') + ->add('editedBy', $this->app->user->account) + ->add('editedDate', $now) + ->addIF($this->post->assignedTo, 'assignedBy', $this->app->user->account) + ->addIF($this->post->assignedTo, 'assignedDate', $now) + ->stripTags($this->config->issue->editor->edit['id'], $this->config->allowedTags) + ->get(); + + if(strpos($this->config->issue->edit->requiredFields, 'type') !== false and !$this->post->type) + { + dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->issue->type); + return false; + } + + if(strpos($this->config->issue->edit->requiredFields, 'title') !== false and !$this->post->title) + { + dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->issue->title); + return false; + } + + if(strpos($this->config->issue->edit->requiredFields, 'severity') !== false and !$this->post->severity) + { + dao::$errors[] = sprintf($this->lang->error->notempty, $this->lang->issue->severity); + return false; + } + $oldIssue = $this->getByID($issueID); + + $this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec(); + return common::createChanges($oldIssue, $data); + } + + /** + * Update assignor. + * + * @param int $issueID + * @access public + * @return bool + */ + public function assignTo($issueID) + { + $data = fixer::input('post') + ->add('assignedBy', $this->app->user->account) + ->add('assignedDate', helper::now()) + ->get(); + + $oldIssue = $this->getByID($issueID); + $this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec(); + + return common::createChanges($oldIssue, $data); + } + + /** + * Close issue. + * + * @param int $issueID + * @access public + * @return bool + */ + public function close($issueID) + { + $data = fixer::input('post') + ->add('closeBy', $this->app->user->account) + ->add('status', 'closed') + ->get(); + + $oldIssue = $this->getByID($issueID); + $this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec(); + + return common::createChanges($oldIssue, $data); + } + + /** + * Cancel issue. + * + * @param int $issueID + * @access public + * @return bool + */ + public function cancel($issueID) + { + $data = fixer::input('post')->get(); + $oldIssue = $this->getByID($issueID); + $this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec(); + + return common::createChanges($oldIssue, $data); + } + + /** + * Activate issue. + * + * @param int $issueID + * @access public + * @return bool + */ + public function activate($issueID) + { + $data = fixer::input('post') + ->add('status', 'active') + ->get(); + $oldIssue = $this->getByID($issueID); + $this->dao->update(TABLE_ISSUE)->data($data)->where('id')->eq($issueID)->exec(); + + return common::createChanges($oldIssue, $data); + } + /** * Batch create issue. * @@ -55,33 +232,32 @@ class issueModel extends model public function batchCreate() { $now = helper::now(); - $data = fixer::input('post')->get(); + $data = fixer::input('post')->get(); - $issues = array(); - foreach($data->dataList as $issue) - { - if(!trim($issue['title'])) continue; + $issues = array(); + foreach($data->dataList as $issue) + { + if(!trim($issue['title'])) continue; - $issue['createdBy'] = $this->app->user->account; - $issue['createdDate'] = $now; + $issue['createdBy'] = $this->app->user->account; + $issue['createdDate'] = $now; - if($issue['assignedTo']) - { - $issue['assignedBy'] = $this->app->user->account; - $issue['assignedDate'] = $now; - } + if($issue['assignedTo']) + { + $issue['assignedBy'] = $this->app->user->account; + $issue['assignedDate'] = $now; + } - foreach(explode(',',$this->config->issue->create->requiredFields) as $field) - { - $field = trim($field); - if($field and empty($issue["$field"])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->issue->$field))); - } + foreach(explode(',',$this->config->issue->create->requiredFields) as $field) + { + $field = trim($field); + if($field and empty($issue["$field"])) die(js::alert(sprintf($this->lang->error->notempty, $this->lang->issue->$field))); + } - $issues[] = $issue; - } + $issues[] = $issue; + } + foreach($issues as $issue) $this->dao->insert(TABLE_ISSUE)->data($issue)->exec(); - foreach($issues as $issue) $this->dao->insert(TABLE_ISSUE)->data($issue)->exec(); - - return true; + return true; } } diff --git a/module/issue/view/activate.html.php b/module/issue/view/activate.html.php new file mode 100644 index 0000000000..70c9d980d0 --- /dev/null +++ b/module/issue/view/activate.html.php @@ -0,0 +1,43 @@ + + * @package issue + * @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $ + * @link http://www.zentao.net + */ +?> + +
+
+
+

+ id;?> + title'>" . $issue->title . '';?> +

+
+ +
+ + diff --git a/module/issue/view/assignto.html.php b/module/issue/view/assignto.html.php new file mode 100644 index 0000000000..358d93f3ee --- /dev/null +++ b/module/issue/view/assignto.html.php @@ -0,0 +1,39 @@ + + * @package issue + * @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $ + * @link http://www.zentao.net + */ +?> + +
+
+
+

+ id;?> + title'>" . $issue->title . '';?> +

+
+ +
+ + diff --git a/module/issue/view/browse.html.php b/module/issue/view/browse.html.php index 20b13a2d71..2215f865b7 100644 --- a/module/issue/view/browse.html.php +++ b/module/issue/view/browse.html.php @@ -1,24 +1,84 @@ - * @package story + * @package issue * @version $Id$ * @link http://www.zentao.net */ ?> -
+ +
+
+ +
+ + + + recTotal}&recPerPage={$pager->recPerPage}";?> + + + + + + + + + + + + + + $issue):?> + + + + + + + + + + + + + + +
idAB);?>issue->type;?>issue->title;?>issue->severity;?>issue->pri;?>issue->assignedTo;?>issue->owner;?>issue->status;?>issue->createdDate;?>actions;?>
id);?>issue->typeList, $issue->type);?>title;?>severity;?>pri;?>assignedTo);?>owner);?>issue->statusList, $issue->status);?>createdDate;?> + id", $issue, 'list', 'checked', '', 'iframe', 'yes'); + echo common::printIcon('issue', 'assignTo', "issueID=$issue->id", $issue, 'list', 'hand-right', '', 'iframe', 'yes'); + echo common::printIcon('issue', 'close', "issueID=$issue->id", $issue, 'list', 'off', '', 'iframe', 'yes'); + echo common::printIcon('issue', 'cancel', "issueID=$issue->id", $issue, 'list', 'ban-circle', '', 'iframe', 'yes'); + echo common::printIcon('issue', 'activate', "issueID=$issue->id", $issue, 'list', 'magic', '', 'iframe', 'yes'); + echo common::printIcon('issue', 'edit', "issueID=$issue->id", $issue, 'list', 'edit'); + $deleteClass = common::hasPriv('issue', 'delete') ? 'btn' : 'btn disabled'; + echo html::a($this->createLink('issue', 'delete', "issueID=$issue->id"), '', 'hiddenwin', "title='{$lang->issue->delete}' class='$deleteClass'"); + ?> +
+
+ +
noData;?>
+ +
+
diff --git a/module/issue/view/cancel.html.php b/module/issue/view/cancel.html.php new file mode 100644 index 0000000000..4f419a4bf0 --- /dev/null +++ b/module/issue/view/cancel.html.php @@ -0,0 +1,48 @@ + + * @package issue + * @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $ + * @link http://www.zentao.net + */ +?> + + +
+
+
+

+ id;?> + title'>" . $issue->title . '';?> +

+
+ +
+
+ diff --git a/module/issue/view/close.html.php b/module/issue/view/close.html.php new file mode 100644 index 0000000000..4dc4522c2e --- /dev/null +++ b/module/issue/view/close.html.php @@ -0,0 +1,43 @@ + + * @package issue + * @version $Id: complete.html.php 935 2010-07-06 07:49:24Z jajacn@126.com $ + * @link http://www.zentao.net + */ +?> + +
+
+
+

+ id;?> + title'>" . $issue->title . '';?> +

+
+ +
+ + diff --git a/module/issue/view/create.html.php b/module/issue/view/create.html.php index b812d21526..df2384481f 100644 --- a/module/issue/view/create.html.php +++ b/module/issue/view/create.html.php @@ -1,11 +1,11 @@ - * @package story + * @package issue * @version $Id$ * @link http://www.zentao.net */ @@ -17,55 +17,59 @@

issue->create;?>

+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
issue->type;?>issue->typeList, '', 'class="form-control chosen"');?>
issue->title;?>
issue->severity;?>issue->serverityList, '', 'class="form-control chosen"');?>
issue->pri;?>issue->priList, '', 'class="form-control chosen"');?>
issue->deadline;?>
issue->assignedTo;?>
issue->desc;?>
files;?>fetch('file', 'buildform');?>
+
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
issue->type;?>issue->typeList, '', 'class="form-control chosen"');?>
issue->title;?>
issue->severity;?>issue->serverityList, '', 'class="form-control chosen"');?>
issue->pri;?>issue->priList, '', 'class="form-control chosen"');?>
issue->deadline;?>
issue->assignedTo;?>
issue->desc;?>
-
diff --git a/module/issue/view/edit.html.php b/module/issue/view/edit.html.php new file mode 100644 index 0000000000..a59f0e42b5 --- /dev/null +++ b/module/issue/view/edit.html.php @@ -0,0 +1,71 @@ + + * @package issue + * @version $Id$ + * @link http://www.zentao.net + */ +?> + + +
+
+
+

issue->edit;?>

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
issue->type;?>issue->typeList, $issue->type, 'class="form-control chosen"');?>
issue->title;?>title, 'class="form-control"');?>
issue->severity;?>issue->serverityList, $issue->severity, 'class="form-control chosen"');?>
issue->pri;?>issue->priList, $issue->pri, 'class="form-control chosen"');?>
issue->deadline;?>deadline, 'class="form-control form-date"');?>
issue->assignedTo;?>assignedTo, 'class="form-control chosen"');?>
issue->desc;?>desc, 'row="6"');?>
+
+
+
+ diff --git a/module/issue/view/resolve.html.php b/module/issue/view/resolve.html.php new file mode 100644 index 0000000000..810f6b2ed0 --- /dev/null +++ b/module/issue/view/resolve.html.php @@ -0,0 +1,65 @@ + +
+
+
+

+ id;?> + title'>" . $issue->title . '';?> +

+
+ +
+ + From 0166d694113840ddd33ca1e9ba36e89892dcdd0c Mon Sep 17 00:00:00 2001 From: hufangzhou <746775970@qq.com> Date: Wed, 19 Aug 2020 16:03:16 +0800 Subject: [PATCH 3/9] * Fix bug. --- module/issue/control.php | 1 - module/issue/model.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/module/issue/control.php b/module/issue/control.php index 0fb41af1b1..f520a0fed9 100644 --- a/module/issue/control.php +++ b/module/issue/control.php @@ -266,5 +266,4 @@ class issue extends control $this->display(); } ->>>>>>> Stashed changes } diff --git a/module/issue/model.php b/module/issue/model.php index 20e16698b5..349382a722 100644 --- a/module/issue/model.php +++ b/module/issue/model.php @@ -241,8 +241,8 @@ class issueModel extends model $issue['createdBy'] = $this->app->user->account; $issue['createdDate'] = $now; - - if($issue['assignedTo']) + $issue['program'] = $this->session->program; + if($issue['assignedTo']) { $issue['assignedBy'] = $this->app->user->account; $issue['assignedDate'] = $now; From 2f0946291f07ccefd4cd7981599cb462b4678710 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 19 Aug 2020 16:12:54 +0800 Subject: [PATCH 4/9] * Adjust code . --- module/issue/model.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/module/issue/model.php b/module/issue/model.php index 349382a722..0599090122 100644 --- a/module/issue/model.php +++ b/module/issue/model.php @@ -242,7 +242,7 @@ class issueModel extends model $issue['createdBy'] = $this->app->user->account; $issue['createdDate'] = $now; $issue['program'] = $this->session->program; - if($issue['assignedTo']) + if($issue['assignedTo']) { $issue['assignedBy'] = $this->app->user->account; $issue['assignedDate'] = $now; From 538d6a9b40065186c7bafb9447a1da75b3f8abee Mon Sep 17 00:00:00 2001 From: z Date: Wed, 19 Aug 2020 16:29:04 +0800 Subject: [PATCH 5/9] * finish task #7647. --- module/custom/lang/de.php | 5 +---- module/custom/lang/en.php | 5 +---- module/custom/lang/fr.php | 5 +---- module/custom/lang/zh-cn.php | 5 +---- module/upgrade/model.php | 18 ++++++++++++++++++ 5 files changed, 22 insertions(+), 16 deletions(-) diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 2eaf322bc8..e2e28a936f 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -133,10 +133,7 @@ $lang->custom->productProject->relation['1_2'] = 'Project - Sprint'; $lang->custom->productProject->notice = 'Please select a concept according to your team.'; -$lang->custom->workingList['full'] = 'Full Management of Dev'; -$lang->custom->workingList['onlyTest'] = 'Test Management'; -$lang->custom->workingList['onlyStory'] = 'Story Management'; -$lang->custom->workingList['onlyTask'] = 'Task Management'; +$lang->custom->workingList['full'] = 'Full Management of Dev'; $lang->custom->menuTip = 'Click to show/hide navigation bar. Drag to swtich display order.'; $lang->custom->saveFail = 'Failed to save!'; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index ffd61eb164..12f36948d2 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -173,10 +173,7 @@ $lang->custom->productProject->relation['0_1'] = 'Program - Product - Sprint'; $lang->custom->productProject->notice = 'Select a concept that fits your team.'; -$lang->custom->workingList['full'] = 'Application Lifecycle Management'; -$lang->custom->workingList['onlyTest'] = 'Test Management'; -$lang->custom->workingList['onlyStory'] = 'Story Management'; -$lang->custom->workingList['onlyTask'] = 'Task Management'; +$lang->custom->workingList['full'] = 'Application Lifecycle Management'; $lang->custom->menuTip = 'Click to show/hide the menu. Drag to switch display order.'; $lang->custom->saveFail = 'Failed to save!'; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 71f1d1cc11..f8a6070826 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -133,10 +133,7 @@ $lang->custom->productProject->relation['1_2'] = 'Project - Sprint'; $lang->custom->productProject->notice = 'Sélectionnez le concept qui correspond à votre équipe.'; -$lang->custom->workingList['full'] = 'Application Lifecycle Management'; -$lang->custom->workingList['onlyTest'] = 'Gestion de la Qualité'; -$lang->custom->workingList['onlyStory'] = 'Gestion des Stories'; -$lang->custom->workingList['onlyTask'] = 'Gestion des Tâches'; +$lang->custom->workingList['full'] = 'Application Lifecycle Management'; $lang->custom->menuTip = "Cliquez pour montrer/cacher le menu. Déplacez pour changer l'ordre d'affichage."; $lang->custom->saveFail = 'Echec de la sauvegarde !'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 71bc692b24..985978eded 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -173,10 +173,7 @@ $lang->custom->productProject->relation['0_1'] = '项目 - 产品 - 冲刺'; $lang->custom->productProject->notice = '请根据实际情况选择适合自己团队的概念。'; -$lang->custom->workingList['full'] = '完整研发管理工具'; -$lang->custom->workingList['onlyTest'] = '测试管理工具'; -$lang->custom->workingList['onlyStory'] = "{$lang->storyCommon}管理工具"; -$lang->custom->workingList['onlyTask'] = '任务管理工具'; +$lang->custom->workingList['full'] = '完整研发管理工具'; $lang->custom->menuTip = '点击显示或隐藏导航条目,拖拽来更改显示顺序。'; $lang->custom->saveFail = '保存失败!'; diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 637e7258dc..26fd3d43d6 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -586,6 +586,11 @@ class upgradeModel extends model $this->saveLogs('Execute 12_2'); $this->execSQL($this->getUpgradeFile('12.2')); $this->appendExec('12_2'); + case '20_0': + $this->saveLogs('Execute 20_0'); + $this->execSQL($this->getUpgradeFile('20.0')); + $this->setWork2Full(); + $this->appendExec('20_0'); } $this->deletePatch(); @@ -757,6 +762,7 @@ class upgradeModel extends model $confirmContent .= file_get_contents($xuanxuanSql); } case '12_2': $confirmContent .= file_get_contents($this->getUpgradeFile('12.2')); + case '20_0': $confirmContent .= file_get_contents($this->getUpgradeFile('20.0')); } return str_replace('zt_', $this->config->db->prefix, $confirmContent); } @@ -3988,6 +3994,18 @@ class upgradeModel extends model } } + /** + * Set work to full. + * + * @access public + * @return bool + */ + public function setWork2Full() + { + $this->loadModel('setting')->setItem('system.common.global.flow', 'full'); + return true; + } + /** * Append execute for pro and biz. * From 2d59fe5555b140916a264aa6bc25e2ef6eb32fca Mon Sep 17 00:00:00 2001 From: z Date: Wed, 19 Aug 2020 16:41:58 +0800 Subject: [PATCH 6/9] * finish task #7646. --- module/program/model.php | 1 + module/upgrade/model.php | 1 + 2 files changed, 2 insertions(+) diff --git a/module/program/model.php b/module/program/model.php index f56a39afa1..fbc5b19ca7 100644 --- a/module/program/model.php +++ b/module/program/model.php @@ -63,6 +63,7 @@ class programModel extends model $this->lang->project->team = $this->lang->project->teamname; $project = fixer::input('post') ->setDefault('status', 'wait') + ->add('type', 'program') ->setIF($this->post->acl != 'custom', 'whitelist', '') ->setDefault('openedBy', $this->app->user->account) ->setDefault('openedDate', helper::now()) diff --git a/module/upgrade/model.php b/module/upgrade/model.php index 26fd3d43d6..f735ce70e2 100644 --- a/module/upgrade/model.php +++ b/module/upgrade/model.php @@ -3772,6 +3772,7 @@ class upgradeModel extends model $program->name = $data->name; $program->code = $data->code; $program->template = 'scrum'; + $program->type = 'program'; $program->category = count($productIdList) > 1 ? 'multiple' : 'single'; $program->status = 'wait'; $program->begin = $data->begin; From f375b8a910926acc4a7ea150a29e350c45d4e270 Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 19 Aug 2020 16:57:25 +0800 Subject: [PATCH 7/9] * Add issue details page. --- module/issue/view/browse.html.php | 2 +- module/issue/view/view.html.php | 76 +++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 module/issue/view/view.html.php diff --git a/module/issue/view/browse.html.php b/module/issue/view/browse.html.php index 2215f865b7..58d3ac18b2 100644 --- a/module/issue/view/browse.html.php +++ b/module/issue/view/browse.html.php @@ -51,7 +51,7 @@ id);?> issue->typeList, $issue->type);?> - title;?> + id", $issue->title);?> severity;?> pri;?> assignedTo);?> diff --git a/module/issue/view/view.html.php b/module/issue/view/view.html.php new file mode 100644 index 0000000000..c3a0612807 --- /dev/null +++ b/module/issue/view/view.html.php @@ -0,0 +1,76 @@ + + * @package issue + * @version $Id: edit.html.php 4488 2013-02-27 02:54:49Z chencongzhi520@gmail.com $ + * @link http://www.zentao.net + */ +?> + + +createLink('issue', 'browse'); +$createLink = $this->createLink('issue', 'create'); +?> + +
+
+
+
+

标题 - 设计出现偏差,需求重新设计

+

标题 - 设计出现偏差,需求重新设计

+
+
+
issue->desc;?>
+
+ desc) ? $issue->desc : '
' . $lang->noData . '
';?> +
+
+
+ createLink('action', 'comment', "objectType=issue&objectID=$issue->id");?> +
+
+
+
+
+ +
+
+ + + + + + + + +
issue->type;?>
+
+
+
+
+
+
+ From 8e1c142badbfbe11aeb301dcf03ac8f8c0a5154f Mon Sep 17 00:00:00 2001 From: leiyong <1549684884@qq.com> Date: Wed, 19 Aug 2020 17:14:46 +0800 Subject: [PATCH 8/9] * Add issue details page. --- module/issue/control.php | 33 +++++++++++++++++++++++++++++++++ module/issue/lang/zh-cn.php | 1 + 2 files changed, 34 insertions(+) diff --git a/module/issue/control.php b/module/issue/control.php index f520a0fed9..30a372ce0f 100644 --- a/module/issue/control.php +++ b/module/issue/control.php @@ -266,4 +266,37 @@ class issue extends control $this->display(); } + + /** + * Get question details. + * + * @param int $issueID + * @access public + * @return void + */ + public function view($issueID) + { + $this->commonAction($issueID, 'issue'); + $issue = $this->issue->getByID($issueID); + $this->view->title = $this->lang->issue->common . $this->lang->colon . $issue->title; + $this->view->position[] = $this->lang->issue->common; + $this->view->position[] = $this->lang->issue->basicInfo; + + $this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted'); + $this->view->issue = $issue; + + $this->display(); + } + + /** + * Common actions of issue module. + * + * @param int $issueID + * @access public + * @return void + */ + public function commonAction($issueID, $object) + { + $this->view->actions = $this->loadModel('action')->getList($object, $issueID); + } } diff --git a/module/issue/lang/zh-cn.php b/module/issue/lang/zh-cn.php index 3f74e74db2..d2ffb9cf2f 100644 --- a/module/issue/lang/zh-cn.php +++ b/module/issue/lang/zh-cn.php @@ -30,6 +30,7 @@ $lang->issue->assignedDate = '指派时间'; $lang->issue->resolved = '解决'; $lang->issue->delete = '删除'; +$lang->issue->basicInfo = '基本信息'; $lang->issue->active = '激活'; $lang->issue->assign = '指派'; $lang->issue->create = '新建问题'; From 12220a05247700f586274dccf3a29e4f1d2e387c Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Wed, 19 Aug 2020 17:28:09 +0800 Subject: [PATCH 9/9] * Code for risk. --- db/update20.0.sql | 16 +-- module/risk/config.php | 52 ++++++++ module/risk/control.php | 54 ++++++-- module/risk/lang/zh-cn.php | 17 +++ module/risk/model.php | 27 ++++ module/risk/view/browse.html.php | 3 +- module/risk/view/cancel.html.php | 7 +- module/risk/view/edit.html.php | 9 +- module/risk/view/view.html.php | 206 +++++++++++++++++++++++++++++++ 9 files changed, 366 insertions(+), 25 deletions(-) create mode 100644 module/risk/view/view.html.php diff --git a/db/update20.0.sql b/db/update20.0.sql index e115a922b3..3704afa7d6 100644 --- a/db/update20.0.sql +++ b/db/update20.0.sql @@ -140,23 +140,23 @@ CREATE TABLE `zt_risk` ( `remedy` text NOT NULL, `plannedClosedDate` date NOT NULL, `actualClosedDate` date NOT NULL, - `addedDate` date NOT NULL, + `createdBy` varchar(30) NOT NULL, + `createdDate` datetime NOT NULL, + `editedBy` varchar(30) NOT NULL, + `editedDate` datetime NOT NULL, `resolution` text NOT NULL, `resolvedBy` varchar(30) NOT NULL, `activateBy` varchar(30) NOT NULL, `activateDate` date NOT NULL, - `closeBy` varchar(30) NOT NULL, - `closedDate` date NOT NULL, `assignedTo` varchar(30) NOT NULL, - `assignedBy` varchar(30) NOT NULL, `cancelBy` varchar(30) NOT NULL, - `cancelDate` datetime NOT NULL, + `cancelDate` date NOT NULL, `cancelReason` char(30) NOT NULL, `hangupBy` varchar(30) NOT NULL, - `hangupdDate` datetime NOT NULL, + `hangupdDate` date NOT NULL, `trackedBy` varchar(30) NOT NULL, - `trackedDate` datetime NOT NULL, - `assignedDate` datetime NOT NULL, + `trackedDate` date NOT NULL, + `assignedDate` date NOT NULL, `deleted` enum('0','1') NOT NULL DEFAULT '0', PRIMARY KEY (`id`) ) ENGINE=MyISAM DEFAULT CHARSET=utf8; diff --git a/module/risk/config.php b/module/risk/config.php index 1b426bb019..ea0bf70def 100644 --- a/module/risk/config.php +++ b/module/risk/config.php @@ -6,6 +6,58 @@ $config->risk->editor->assignto = array('id' => 'comment', 'tools' => 'simpleToo $config->risk->editor->cancel = array('id' => 'comment', 'tools' => 'simpleTools'); $config->risk->editor->close = array('id' => 'resolution', 'tools' => 'simpleTools'); $config->risk->editor->track = array('id' => 'prevention,resolution,comment', 'tools' => 'simpleTools'); +$config->risk->editor->view = array('id' => 'lastComment', 'tools' => 'simpleTools'); $config->risk->create = new stdclass(); $config->risk->create->requiredFields = 'name'; + +global $lang; +$config->risk->search['module'] = 'bug'; +$config->risk->search['fields']['id'] = $lang->risk->id; +$config->risk->search['fields']['name'] = $lang->risk->name; +$config->risk->search['fields']['source'] = $lang->risk->source; +$config->risk->search['fields']['categroy'] = $lang->risk->category; +$config->risk->search['fields']['strategy'] = $lang->risk->strategy; +$config->risk->search['fields']['status'] = $lang->risk->status; +$config->risk->search['fields']['impact'] = $lang->risk->impact; +$config->risk->search['fields']['probability'] = $lang->risk->probability; +$config->risk->search['fields']['riskindex'] = $lang->risk->riskindex; +$config->risk->search['fields']['pri'] = $lang->risk->pri; +$config->risk->search['fields']['identifiedDate'] = $lang->risk->identifiedDate; +$config->risk->search['fields']['prevention'] = $lang->risk->prevention; +$config->risk->search['fields']['remedy'] = $lang->risk->remedy; +$config->risk->search['fields']['resolution'] = $lang->risk->resolution; +$config->risk->search['fields']['plannedClosedDate'] = $lang->risk->plannedClosedDate; +$config->risk->search['fields']['actualClosedDate'] = $lang->risk->actualClosedDate; +$config->risk->search['fields']['createdBy'] = $lang->risk->createdBy; +$config->risk->search['fields']['createdDate'] = $lang->risk->createdDate; +$config->risk->search['fields']['resolvedBy'] = $lang->risk->resolvedBy; +$config->risk->search['fields']['activateBy'] = $lang->risk->activateBy; +$config->risk->search['fields']['assignedTo'] = $lang->risk->assignedTo; +$config->risk->search['fields']['cancelBy'] = $lang->risk->cancelBy; +$config->risk->search['fields']['hangupBy'] = $lang->risk->hangupBy; +$config->risk->search['fields']['trackedBy'] = $lang->risk->trackedDate; + +$config->risk->search['params']['name'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->risk->search['params']['source'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->risk->sourceList); +$config->risk->search['params']['category'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->risk->categoryList); +$config->risk->search['params']['strategy'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->risk->strategyList); +$config->risk->search['params']['status'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->risk->status); +$config->risk->search['params']['impact'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->risk->impactList); +$config->risk->search['params']['probability'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->risk->probabilityList); +$config->risk->search['params']['riskindex'] = array('operator' => '=', 'control' => 'input', 'values' => ''); +$config->risk->search['params']['pri'] = array('operator' => '=', 'control' => 'select', 'values' => $lang->risk->priList); +$config->risk->search['params']['identifiedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->risk->search['params']['prevention'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->risk->search['params']['remedy'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->risk->search['params']['plannedClosedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->risk->search['params']['actualClosedDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->risk->search['params']['createBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->risk->search['params']['createDate'] = array('operator' => '=', 'control' => 'input', 'values' => '', 'class' => 'date'); +$config->risk->search['params']['resolution'] = array('operator' => 'include', 'control' => 'input', 'values' => ''); +$config->risk->search['params']['resolvedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->risk->search['params']['activateBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->risk->search['params']['assignedTo'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->risk->search['params']['cancelBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->risk->search['params']['hangupBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); +$config->risk->search['params']['trackedBy'] = array('operator' => '=', 'control' => 'select', 'values' => 'users'); diff --git a/module/risk/control.php b/module/risk/control.php index 1229bceb89..91696bcfd3 100644 --- a/module/risk/control.php +++ b/module/risk/control.php @@ -1,8 +1,14 @@ createLink('risk', 'browse', "browseType=bySearch&queryID=myQueryID"); + $this->config->risk->search['onMenuBar'] = 'yes'; + $this->risk->buildSearchForm($queryID, $actionURL); + /* Load pager. */ $this->app->loadClass('pager', $static = true); if($this->app->getViewType() == 'mhtml') $recPerPage = 10; @@ -11,6 +17,8 @@ class risk extends control $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->browse; $this->view->position[] = $this->lang->risk->browse; $this->view->risks = $this->risk->getList($orderBy, $pager); + $this->view->browseType = $browseType; + $this->view->param = $param; $this->view->orderBy = $orderBy; $this->view->pager = $pager; $this->view->users = $this->loadModel('user')->getPairs('noletter'); @@ -68,7 +76,7 @@ class risk extends control $this->send($response); } - $this->view->risk = $this->risk->getByID($riskID); + $this->view->risk = $this->risk->getById($riskID); $this->view->users = $this->loadModel('user')->getPairs(); $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->edit; $this->view->position[] = $this->lang->risk->edit; @@ -76,6 +84,34 @@ class risk extends control $this->display(); } + public function view($riskID) + { + $this->loadModel('action'); + + $this->view->risk = $this->risk->getById($riskID); + $this->view->actions = $this->action->getList('risk', $riskID); + $this->view->users = $this->loadModel('user')->getPairs('noletter'); + + $this->display(); + } + + public function delete($riskID, $confirm = 'no') + { + $risk = $this->risk->getById($riskID); + + if($confirm == 'no') + { + echo js::confirm($this->lang->risk->confirmDelete, $this->createLink('risk', 'delete', "risk=$riskID&confirm=yes"), ''); + exit; + } + else + { + $this->risk->delete(TABLE_RISK, $riskID); + + die(js::locate(inlink('browse'), 'parent')); + } + } + public function track($riskID) { if($_POST) @@ -98,7 +134,7 @@ class risk extends control $response['locate'] = inlink('browse'); $this->send($response); } - $this->view->risk = $this->risk->getByID($riskID); + $this->view->risk = $this->risk->getById($riskID); $this->view->users = $this->loadModel('user')->getPairs(); $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->track; $this->view->position[] = $this->lang->risk->track; @@ -120,7 +156,7 @@ class risk extends control if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('risk', 'browse'), 'parent')); } - $risk = $this->risk->getByID($riskID); + $risk = $this->risk->getById($riskID); $this->view->users = $this->loadModel('user')->getPairs(); $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->assignedTo; @@ -144,7 +180,7 @@ class risk extends control if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('risk', 'browse'), 'parent')); } - $risk = $this->risk->getByID($riskID); + $risk = $this->risk->getById($riskID); $this->view->users = $this->loadModel('user')->getPairs(); $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->cancel; @@ -167,7 +203,7 @@ class risk extends control if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('risk', 'browse'), 'parent')); } - $risk = $this->risk->getByID($riskID); + $risk = $this->risk->getById($riskID); $this->view->users = $this->loadModel('user')->getPairs(); $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->close; @@ -190,7 +226,7 @@ class risk extends control if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('risk', 'browse'), 'parent')); } - $risk = $this->risk->getByID($riskID); + $risk = $this->risk->getById($riskID); $this->view->users = $this->loadModel('user')->getPairs(); $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->hangup; @@ -207,13 +243,13 @@ class risk extends control if(dao::isError()) die(js::error(dao::getError())); $this->loadModel('action'); - $actionID = $this->action->create('risk', $riskID, 'Hangup', $this->post->comment); + $actionID = $this->action->create('risk', $riskID, 'Activated', $this->post->comment); $this->action->logHistory($actionID, $changes); if(isonlybody()) die(js::closeModal('parent.parent', 'this')); die(js::locate($this->createLink('risk', 'browse'), 'parent')); } - $risk = $this->risk->getByID($riskID); + $risk = $this->risk->getById($riskID); $this->view->users = $this->loadModel('user')->getPairs(); $this->view->title = $this->lang->risk->common . $this->lang->colon . $this->lang->risk->activate; diff --git a/module/risk/lang/zh-cn.php b/module/risk/lang/zh-cn.php index ff8c5706c2..b99c51f6d2 100644 --- a/module/risk/lang/zh-cn.php +++ b/module/risk/lang/zh-cn.php @@ -9,6 +9,12 @@ $lang->risk->hangup = '挂起'; $lang->risk->close = '关闭'; $lang->risk->cancel = '取消'; $lang->risk->track = '跟踪'; +$lang->risk->assignTo = '指派'; +$lang->risk->deleted = '删除'; + +$lang->risk->legendBasicInfo = '基本信息'; +$lang->risk->legendLifeTime = '风险的一生'; +$lang->risk->confirmDelete = '您确认删除该风险吗?'; /* Fields */ $lang->risk->common = '风险'; @@ -27,6 +33,7 @@ $lang->risk->remedy = '应急措施'; $lang->risk->identifiedDate = '识别日期'; $lang->risk->plannedClosedDate = '计划关闭日期'; $lang->risk->assignedTo = '指派给'; +$lang->risk->assignedDate = '指派日期'; $lang->risk->createdBy = '由谁创建'; $lang->risk->createdDate = '创建日期'; $lang->risk->noAssigned = '未指派'; @@ -44,6 +51,12 @@ $lang->risk->activateDate = '激活日期'; $lang->risk->isChange = '是否有变化'; $lang->risk->trackedBy = '由谁跟踪'; $lang->risk->trackedDate = '跟踪日期'; +$lang->risk->editedBy = '由谁编辑'; +$lang->risk->editedDate = '编辑日期'; + +$lang->risk->action = new stdclass(); +$lang->risk->action->hangup = '$date, 由 $actor 挂起。' . "\n"; +$lang->risk->action->tracked = '$date, 由 $actor 跟踪。' . "\n"; $lang->risk->sourceList[''] = ''; $lang->risk->sourceList['business'] = '业务部门'; @@ -92,3 +105,7 @@ $lang->risk->strategyList['acceptance'] = '接受'; $lang->risk->isChangeList[0] = '否'; $lang->risk->isChangeList[1] = '是'; + +$lang->risk->cancelReasonList[''] = ''; +$lang->risk->cancelReasonList['disappeared'] = '风险自行消失'; +$lang->risk->cancelReasonList['mistake'] = '识别错误'; diff --git a/module/risk/model.php b/module/risk/model.php index 76efa2addd..8d424cc032 100644 --- a/module/risk/model.php +++ b/module/risk/model.php @@ -206,4 +206,31 @@ class riskModel extends model if(!dao::isError()) return common::createChanges($oldRisk, $risk); return false; } + + public static function isClickable($risk, $action) + { + $action = strtolower($action); + + if($action == 'cancel' or $action == 'close') return $risk->status != 'canceled' and $risk->status != 'closed'; + if($action == 'hangup') return $risk->status == 'active'; + if($action == 'activate') return $risk->status != 'active'; + + return true; + } + + /** + * Build search form. + * + * @param int $queryID + * @param string $actionURL + * @access public + * @return void + */ + public function buildSearchForm($queryID, $actionURL) + { + $this->config->risk->search['actionURL'] = $actionURL; + $this->config->risk->search['queryID'] = $queryID; + + $this->loadModel('search')->setSearchParams($this->config->bug->search); + } } diff --git a/module/risk/view/browse.html.php b/module/risk/view/browse.html.php index e0b82535ad..07dddccce6 100644 --- a/module/risk/view/browse.html.php +++ b/module/risk/view/browse.html.php @@ -40,7 +40,7 @@ id;?> - name;?> + createLink('risk', 'view', "riskID=$risk->id"), $risk->name);?> risk->strategyList, $risk->strategy);?> risk->statusList, $risk->status);?> identifiedDate == '0000-00-00' ? '' : $risk->identifiedDate;?> @@ -64,6 +64,7 @@ diff --git a/module/risk/view/cancel.html.php b/module/risk/view/cancel.html.php index 81f68a7303..b00dd8c37b 100644 --- a/module/risk/view/cancel.html.php +++ b/module/risk/view/cancel.html.php @@ -19,7 +19,12 @@ risk->cancelDate;?> - + + + risk->cancelReason;?> + risk->cancelReasonList, '', "class='form-control chosen'");?> + + comment;?> diff --git a/module/risk/view/edit.html.php b/module/risk/view/edit.html.php index 293b791926..1f7b8953c9 100644 --- a/module/risk/view/edit.html.php +++ b/module/risk/view/edit.html.php @@ -70,15 +70,12 @@ resolution, "class='form-control'");?> - risk->prevention;?> - prevention, "class='form-control'");?> + risk->resolvedBy;?> + resolvedBy) ? $this->app->user->account : $risk->resolvedBy, "class='form-control chosen'");?> - risk->remedy;?> - remedy, "class='form-control'");?> - risk->assignedTo;?> - assignedTo, "class='form-control chosen'");?> + assignedTo) ? $this->app->user->account : $risk->assignedTo, "class='form-control chosen'");?> diff --git a/module/risk/view/view.html.php b/module/risk/view/view.html.php new file mode 100644 index 0000000000..55ed1bf0af --- /dev/null +++ b/module/risk/view/view.html.php @@ -0,0 +1,206 @@ + + +createLink('risk', 'browse');?> + + +
+
+
+
+
risk->prevention;?>
+
prevention;?>
+
+
+
risk->remedy;?>
+
remedy;?>
+
+
+
risk->resolution;?>
+
resolution;?>
+
+
+
+
+
+ +
";?> + deleted):?> + id", $risk, 'button', 'checked', '', 'showinonlybody'); + common::printIcon('risk', 'assignTo', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true); + common::printIcon('risk', 'cancel', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true); + common::printIcon('risk', 'close', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true); + common::printIcon('risk', 'hangup', "riskID=$risk->id", $risk, 'button', 'arrow-up', '', 'iframe showinonlybody', true); + common::printIcon('risk', 'activate', "riskID=$risk->id", $risk, 'button', '', '', 'iframe showinonlybody', true); + echo "
"; + common::printIcon('risk', 'edit', "riskID=$risk->id", $risk); + common::printIcon('risk', 'delete', "riskID=$risk->id", $risk, 'button', 'trash', 'hiddenwin'); + ?> + +
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
risk->id;?>id;?>
risk->source;?>risk->sourceList, $risk->source);?>
risk->category;?>risk->categoryList, $risk->category);?>
risk->strategy;?>risk->strategy, $risk->strategy);?>
risk->status;?> processStatus('risk', $risk);?>
risk->impact;?>risk->impact, $risk->impact);?>
risk->probability;?>risk->probability, $risk->probability);?>
risk->riskindex;?>riskindex;?>
risk->pri;?>pri;?>' title='risk->priList, $risk->pri)?>'>risk->priList, $risk->pri)?>
risk->identifiedDate;?>identifiedDate == '0000-00-00' ? '' : $risk->identifiedDate;?>
risk->plannedClosedDate;?>plannedClosedDate == '0000-00-00' ? '' : $risk->plannedClosedDate;?>
risk->actualClosedDate;?>actualClosedDate == '0000-00-00' ? '' : $risk->actualClosedDate;?>
+
+
+
+
+
+
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
risk->assignedTo;?>assignedTo);?>
risk->trackedBy;?>trackedBy);?>
risk->trackedDate;?>trackedDate == '0000-00-00' ? '' : $risk->trackedDate;?>
risk->createdBy;?>createdBy);?>
risk->createdDate;?>createdDate == '0000-00-00' ? '' : $risk->createdDate;?>
risk->editedBy;?>editedBy);?>
risk->editedDate;?>editedDate == '0000-00-00' ? '' : $risk->editedDate;?>
risk->assignedDate;?>assignedDate == '0000-00-00' ? '' : $risk->assignedDate;?>
risk->resolvedBy;?>resolvedBy);?>
risk->actualClosedDate;?>actualClosedDate == '0000-00-00' ? '' : $risk->actualClosedDate;?>
risk->cancelBy;?>cancelBy);?>
risk->cancelDate;?>cancelDate == '0000-00-00' ? '' : $risk->cancelDate;?>
risk->cancelReason;?>risk->cancelReasonList, $risk->cancelReason);?>
risk->hangupBy;?>hangupBy);?>
risk->hangupDate;?>hangupDate == '0000-00-00' ? '' : $risk->hangupDate;?>
risk->activateBy;?>activateBy);?>
risk->activateDate;?>activateDate == '0000-00-00' ? '' : $risk->activateDate;?>
+
+
+
+
+
+ +