* Finish task#7742.
This commit is contained in:
+24
-24
@@ -4,9 +4,9 @@
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @author Yong Lei <leiyong@easycorp.ltd>
|
||||
* @package issue
|
||||
* @version $Id: control.php 5145 2013-07-15 06:47:26Z chencongzhi520@gmail.com $
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
class issue extends control
|
||||
@@ -14,7 +14,7 @@ class issue extends control
|
||||
/**
|
||||
* Get issue list data.
|
||||
*
|
||||
* @param string $browseType
|
||||
* @param string $browseType bySearch|open|assignTo|closed|suspended|canceled
|
||||
* @param int param
|
||||
* @param string orderBy
|
||||
* @param int recTotal
|
||||
@@ -43,14 +43,14 @@ class issue extends control
|
||||
$this->view->param = $param;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->issueList = $this->issue->getIssueList($browseType, $queryID, $orderBy, $pager);
|
||||
$this->view->issueList = $this->issue->getList($browseType, $queryID, $orderBy, $pager);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|pofirst|nodeleted');
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a issue.
|
||||
* Create an issue.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
@@ -251,61 +251,61 @@ class issue extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* Resolve a issue.
|
||||
* Resolve an issue.
|
||||
*
|
||||
* @param int $issue
|
||||
* @param int $issueID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function resolve($issue)
|
||||
public function resolve($issueID)
|
||||
{
|
||||
if($_POST)
|
||||
{
|
||||
$this->issue->resolve($issue);
|
||||
$this->issue->resolve($issueID);
|
||||
$resolution = $this->post->issue['resolution'];
|
||||
|
||||
$objectID = '';
|
||||
if($resolution == 'totask')
|
||||
{
|
||||
$objectID = $this->issue->createTask($issue);
|
||||
$objectID = $this->issue->createTask($issueID);
|
||||
$objectLink = html::a($this->createLink('task', 'view', "id=$objectID"), $this->post->name, "data-toggle='modal'");
|
||||
$comment = sprintf($this->lang->issue->logComments[$resolution], $objectLink);
|
||||
$this->loadModel('action')->create('task', $objectID, 'Opened', '');
|
||||
$this->loadModel('action')->create('issue', $issue, 'Resolved', $comment);
|
||||
$this->loadModel('action')->create('issue', $issueID, 'Resolved', $comment);
|
||||
}
|
||||
|
||||
if($resolution == 'tostory')
|
||||
{
|
||||
$objectID = $this->issue->createStory($issue);
|
||||
$objectID = $this->issue->createStory($issueID);
|
||||
$objectLink = html::a($this->createLink('story', 'view', "id=$objectID"), $this->post->title, "data-toggle='modal'");
|
||||
$comment = sprintf($this->lang->issue->logComments[$resolution], $objectLink);
|
||||
$this->loadModel('action')->create('story', $objectID, 'Opened', '');
|
||||
$this->loadModel('action')->create('issue', $issue, 'Resolved', $comment);
|
||||
$this->loadModel('action')->create('issue', $issueID, 'Resolved', $comment);
|
||||
}
|
||||
if($resolution == 'tobug')
|
||||
{
|
||||
$objectID = $this->issue->createBug($issue);
|
||||
$objectID = $this->issue->createBug($issueID);
|
||||
$objectLink = html::a($this->createLink('bug', 'view', "id=$objectID"), $this->post->title, "data-toggle='modal'");
|
||||
$comment = sprintf($this->lang->issue->logComments[$resolution], $objectLink);
|
||||
$this->loadModel('action')->create('bug', $objectID, 'Opened', '');
|
||||
$this->loadModel('action')->create('issue', $issue, 'Resolved', $comment);
|
||||
$this->loadModel('action')->create('issue', $issueID, 'Resolved', $comment);
|
||||
}
|
||||
|
||||
if($resolution == 'torisk')
|
||||
{
|
||||
$objectID = $this->issue->createRisk($issue);
|
||||
$objectID = $this->issue->createRisk($issueID);
|
||||
$objectLink = html::a($this->createLink('risk', 'view', "id=$objectID"), $this->post->title, "data-toggle='modal'");
|
||||
$comment = sprintf($this->lang->issue->logComments[$resolution], $objectLink);
|
||||
$this->loadModel('action')->create('risk', $objectID, 'Opened', '');
|
||||
$this->loadModel('action')->create('issue', $issue, 'Resolved', $comment);
|
||||
$this->loadModel('action')->create('issue', $issueID, 'Resolved', $comment);
|
||||
}
|
||||
|
||||
$this->dao->update(TABLE_ISSUE)->set('objectID')->eq($objectID)->where('id')->eq($issue)->exec();
|
||||
$this->dao->update(TABLE_ISSUE)->set('objectID')->eq($objectID)->where('id')->eq($issueID)->exec();
|
||||
$this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => inlink('browse')));
|
||||
}
|
||||
|
||||
$this->view->title = $this->lang->issue->resolve;
|
||||
$this->view->issue = $this->issue->getByID($issue);
|
||||
$this->view->issue = $this->issue->getByID($issueID);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter');
|
||||
|
||||
$this->prepairParams($this->view->issue);
|
||||
@@ -313,7 +313,7 @@ class issue extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* prepairParams
|
||||
* Build page parameters.
|
||||
*
|
||||
* @param int $issue
|
||||
* @access public
|
||||
@@ -368,9 +368,9 @@ class issue extends control
|
||||
$this->view->members = $members;
|
||||
$this->view->moduleOptionMenu = $moduleOptionMenu;
|
||||
|
||||
$this->view->projects = $this->loadModel('project')->getPairs();
|
||||
$this->view->program = $this->loadModel('project')->getById($this->session->program);
|
||||
$this->view->products = $this->loadModel('product')->getPairs();
|
||||
$this->view->projects = $this->loadModel('project')->getPairs();
|
||||
$this->view->program = $this->loadModel('project')->getById($this->session->program);
|
||||
$this->view->products = $this->loadModel('product')->getPairs();
|
||||
$this->view->productID = $this->session->product;
|
||||
$this->view->moduleID = 0;
|
||||
$this->view->branch = 0;
|
||||
@@ -401,7 +401,7 @@ class issue extends control
|
||||
}
|
||||
|
||||
/**
|
||||
* commonAction
|
||||
* Common actions of issue module.
|
||||
*
|
||||
* @param int $issueID
|
||||
* @param int $object
|
||||
|
||||
@@ -57,7 +57,7 @@ $lang->issue->labelList['open'] = 'Open';
|
||||
$lang->issue->labelList['assignto'] = 'AssignedToMe';
|
||||
$lang->issue->labelList['closed'] = 'Closed';
|
||||
$lang->issue->labelList['suspended'] = 'Suspended';
|
||||
$lang->issue->labelList['cancelled'] = 'Canceled';
|
||||
$lang->issue->labelList['canceled'] = 'Canceled';
|
||||
|
||||
$lang->issue->priList[''] = '';
|
||||
$lang->issue->priList['1'] = 1;
|
||||
|
||||
@@ -57,7 +57,7 @@ $lang->issue->labelList['open'] = '开放';
|
||||
$lang->issue->labelList['assignto'] = '指派给我';
|
||||
$lang->issue->labelList['closed'] = '已关闭';
|
||||
$lang->issue->labelList['suspended'] = '已挂起';
|
||||
$lang->issue->labelList['cancelled'] = '已取消';
|
||||
$lang->issue->labelList['canceled'] = '已取消';
|
||||
|
||||
$lang->issue->priList[''] = '';
|
||||
$lang->issue->priList['1'] = 1;
|
||||
|
||||
+36
-36
@@ -4,41 +4,15 @@
|
||||
*
|
||||
* @copyright Copyright 2009-2015 青岛易软天创网络科技有限公司(QingDao Nature Easy Soft Network Technology Co,LTD, www.cnezsoft.com)
|
||||
* @license ZPL (http://zpl.pub/page/zplv12.html)
|
||||
* @author Chunsheng Wang <chunsheng@cnezsoft.com>
|
||||
* @author Yong Lei <leiyong@easycorp.ltd>
|
||||
* @package issue
|
||||
* @version $Id: model.php 5145 2013-07-15 06:47:26Z chencongzhi520@gmail.com $
|
||||
* @version $Id$
|
||||
* @link http://www.zentao.net
|
||||
*/
|
||||
?>
|
||||
<?php
|
||||
class issueModel extends model
|
||||
{
|
||||
/**
|
||||
* Create an issue.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$now = helper::now();
|
||||
$data = fixer::input('post')
|
||||
->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)
|
||||
->get();
|
||||
|
||||
$this->dao->insert(TABLE_ISSUE)->data($data)->batchCheck($this->config->issue->create->requiredFieldsm, 'notempty')->exec();
|
||||
$issueID = $this->dao->lastInsertID();
|
||||
$this->loadModel('file')->saveUpload('issue', $issueID);
|
||||
|
||||
return $issueID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get stakeholder issue list data.
|
||||
* @param string $owner
|
||||
@@ -73,16 +47,16 @@ class issueModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Get issue list.
|
||||
* Get issue list data.
|
||||
*
|
||||
* @param string $browseType
|
||||
* @param string $browseType bySearch|open|assignTo|closed|suspended|canceled
|
||||
* @param int $queryID
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getIssueList($browseType = 'all', $queryID = 0, $orderBy = 'id_desc', $pager = null)
|
||||
public function getList($browseType = 'all', $queryID = 0, $orderBy = 'id_desc', $pager = null)
|
||||
{
|
||||
$issueQuery = '';
|
||||
if($browseType == 'bysearch')
|
||||
@@ -114,9 +88,9 @@ class issueModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* getBlockIssues
|
||||
* Get the issue in the block.
|
||||
*
|
||||
* @param string $browseType
|
||||
* @param string $browseType open|assignto|closed|suspended|canceled
|
||||
* @param int $limit
|
||||
* @param string $orderBy
|
||||
* @access public
|
||||
@@ -131,7 +105,7 @@ class issueModel extends model
|
||||
->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()
|
||||
->beginIF($browseType == 'canceled')->andWhere('status')->eq('canceled')->fi()
|
||||
->orderBy($orderBy)
|
||||
->limit($limit)
|
||||
->fetchAll();
|
||||
@@ -150,6 +124,32 @@ class issueModel extends model
|
||||
return $this->dao->select('id,name')->from(TABLE_ACTIVITY)->where('deleted')->eq('0')->orderBy('id_desc')->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an issue.
|
||||
*
|
||||
* @access public
|
||||
* @return bool
|
||||
*/
|
||||
public function create()
|
||||
{
|
||||
$now = helper::now();
|
||||
$data = fixer::input('post')
|
||||
->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)
|
||||
->get();
|
||||
|
||||
$this->dao->insert(TABLE_ISSUE)->data($data)->batchCheck($this->config->issue->create->requiredFields, 'notempty')->exec();
|
||||
$issueID = $this->dao->lastInsertID();
|
||||
$this->loadModel('file')->saveUpload('issue', $issueID);
|
||||
|
||||
return $issueID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Update an issue.
|
||||
*
|
||||
@@ -172,7 +172,7 @@ class issueModel extends model
|
||||
|
||||
$this->dao->update(TABLE_ISSUE)->data($data)
|
||||
->where('id')->eq($issueID)
|
||||
->batchCreate($this->config->issue->edit->requiredFields, 'notempty')
|
||||
->batchCheck($this->config->issue->edit->requiredFields, 'notempty')
|
||||
->exec();
|
||||
|
||||
return common::createChanges($oldIssue, $data);
|
||||
@@ -306,7 +306,7 @@ class issueModel extends model
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a task.
|
||||
* Create an task.
|
||||
*
|
||||
* @access public
|
||||
* @return object
|
||||
|
||||
Reference in New Issue
Block a user