Merge branch 'master' of github.com:easysoft/zentaopms

This commit is contained in:
wangyidong
2016-04-29 16:05:54 +08:00
5 changed files with 21 additions and 21 deletions
+3 -3
View File
@@ -250,18 +250,18 @@ class bugModel extends model
* Get bugs of a module.
*
* @param int $productID
* @param string|array $moduleIds
* @param string|array $moduleIdList
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleBugs($productID, $branch = 0, $moduleIds = 0, $projects, $orderBy = 'id_desc', $pager = null)
public function getModuleBugs($productID, $branch = 0, $moduleIdList = 0, $projects, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('product')->eq((int)$productID)
->beginIF(!empty($branch))->andWhere('branch')->eq($branch)->fi()
->beginIF(!empty($moduleIds))->andWhere('module')->in($moduleIds)->fi()
->beginIF(!empty($moduleIdList))->andWhere('module')->in($moduleIdList)->fi()
->andWhere('project')->in(array_keys($projects))
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
+3 -3
View File
@@ -313,12 +313,12 @@ class searchModel extends model
* Get records by the conditon.
*
* @param string $module
* @param string $moduleIds
* @param string $moduleIdList
* @param string $conditions
* @access public
* @return array
*/
public function getBySelect($module, $moduleIds, $conditions)
public function getBySelect($module, $moduleIdList, $conditions)
{
if($module == 'story')
{
@@ -348,7 +348,7 @@ class searchModel extends model
$query .= $operator . ' ' . $this->dbh->quote($value) . ' ';
}
foreach($moduleIds as $id)
foreach($moduleIdList as $id)
{
if(!$id) continue;
$title = $this->dao->select($pairs)
+9 -9
View File
@@ -1209,14 +1209,14 @@ class storyModel extends model
* Get stories list of a product.
*
* @param int $productID
* @param array|string $moduleIds
* @param array|string $moduleIdList
* @param string $status
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getProductStories($productID = 0, $branch = 0, $moduleIds = 0, $status = 'all', $orderBy = 'id_desc', $pager = null)
public function getProductStories($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $orderBy = 'id_desc', $pager = null)
{
if(defined('WIZARD')) return $this->loadModel('tutorial')->getStories();
@@ -1229,7 +1229,7 @@ class storyModel extends model
$stories = $this->dao->select('*')->from(TABLE_STORY)
->where('product')->in($productID)
->beginIF($branch)->andWhere("branch")->in($branch)->fi()
->beginIF(!empty($moduleIds))->andWhere('module')->in($moduleIds)->fi()
->beginIF(!empty($moduleIdList))->andWhere('module')->in($moduleIdList)->fi()
->beginIF($status and $status != 'all')->andWhere('status')->in($status)->fi()
->andWhere('deleted')->eq(0)
->orderBy($orderBy)->page($pager)->fetchAll();
@@ -1240,20 +1240,20 @@ class storyModel extends model
* Get stories pairs of a product.
*
* @param int $productID
* @param array|string $moduleIds
* @param array|string $moduleIdList
* @param string $status
* @param string $order
* @param int $limit
* @access public
* @return array
*/
public function getProductStoryPairs($productID = 0, $branch = 0, $moduleIds = 0, $status = 'all', $order = 'id_desc', $limit = 0)
public function getProductStoryPairs($productID = 0, $branch = 0, $moduleIdList = 0, $status = 'all', $order = 'id_desc', $limit = 0)
{
$stories = $this->dao->select('t1.id, t1.title, t1.module, t1.pri, t1.estimate, t2.name AS product')
->from(TABLE_STORY)->alias('t1')->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('1=1')
->beginIF($productID)->andWhere('t1.product')->in($productID)->fi()
->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->beginIF($branch)->andWhere('t1.branch')->in($branch)->fi()
->beginIF($status and $status != 'all')->andWhere('t1.status')->in($status)->fi()
->andWhere('t1.deleted')->eq(0)
@@ -1537,12 +1537,12 @@ class storyModel extends model
*
* @param int $projectID
* @param int $productID
* @param array|string $moduleIds
* @param array|string $moduleIdList
* @param string $type
* @access public
* @return array
*/
public function getProjectStoryPairs($projectID = 0, $productID = 0, $branch = 0, $moduleIds = 0, $type = 'full')
public function getProjectStoryPairs($projectID = 0, $productID = 0, $branch = 0, $moduleIdList = 0, $type = 'full')
{
if(defined('WIZARD')) return $this->loadModel('tutorial')->getProjectStoryPairs();
$stories = $this->dao->select('t2.id, t2.title, t2.module, t2.pri, t2.estimate, t3.name AS product')
@@ -1553,7 +1553,7 @@ class storyModel extends model
->andWhere('t2.deleted')->eq(0)
->beginIF($productID)->andWhere('t1.product')->eq((int)$productID)->fi()
->beginIF($branch)->andWhere('t2.branch')->in("0,$branch")->fi()
->beginIF($moduleIds)->andWhere('t2.module')->in($moduleIds)->fi()
->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi()
->fetchAll();
if(!$stories) return array();
return $this->formatStories($stories, $type);
+3 -3
View File
@@ -819,21 +819,21 @@ class taskModel extends model
* Get tasks list of a project.
*
* @param int $projectID
* @param array|string $moduleIds
* @param array|string $moduleIdList
* @param string $status
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getTasksByModule($projectID = 0, $moduleIds = 0, $orderBy = 'id_desc', $pager = null)
public function getTasksByModule($projectID = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null)
{
$tasks = $this->dao->select('t1.*, t2.id AS storyID, t2.title AS storyTitle, t2.product, t2.branch, t2.version AS latestStoryVersion, t2.status AS storyStatus, t3.realname AS assignedToRealName')
->from(TABLE_TASK)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story = t2.id')
->leftJoin(TABLE_USER)->alias('t3')->on('t1.assignedTo = t3.account')
->where('t1.project')->eq((int)$projectID)
->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->andWhere('t1.deleted')->eq(0)
->orderBy($orderBy)
->page($pager)
+3 -3
View File
@@ -179,19 +179,19 @@ class testcaseModel extends model
* Get cases of a module.
*
* @param int $productID
* @param int $moduleIds
* @param int $moduleIdList
* @param string $orderBy
* @param object $pager
* @access public
* @return array
*/
public function getModuleCases($productID, $branch = 0, $moduleIds = 0, $orderBy = 'id_desc', $pager = null)
public function getModuleCases($productID, $branch = 0, $moduleIdList = 0, $orderBy = 'id_desc', $pager = null)
{
return $this->dao->select('t1.*, t2.title as storyTitle')->from(TABLE_CASE)->alias('t1')
->leftJoin(TABLE_STORY)->alias('t2')->on('t1.story=t2.id')
->where('t1.product')->eq((int)$productID)
->beginIF($branch)->andWhere('t1.branch')->eq($branch)->fi()
->beginIF($moduleIds)->andWhere('t1.module')->in($moduleIds)->fi()
->beginIF($moduleIdList)->andWhere('t1.module')->in($moduleIdList)->fi()
->andWhere('t1.deleted')->eq('0')
->orderBy($orderBy)->page($pager)->fetchAll('id');
}