* Finish task#8059.
This commit is contained in:
+12
-11
@@ -712,8 +712,9 @@ class baseDAO
|
||||
/**
|
||||
* 将记录进行分页,自动设置limit语句。
|
||||
* Page the records, set the limit part auto.
|
||||
*
|
||||
* @param object $pager
|
||||
*
|
||||
* @param object $pager
|
||||
* @param string $distinctField
|
||||
* @access public
|
||||
* @return object the dao object self.
|
||||
*/
|
||||
@@ -722,15 +723,15 @@ class baseDAO
|
||||
if(!is_object($pager)) return $this;
|
||||
|
||||
/*
|
||||
* 如果$pager的总记录为0,需要计算总结果数。
|
||||
* If the record total is 0, compute it.
|
||||
**/
|
||||
if($pager->recTotal == 0)
|
||||
{
|
||||
$recTotal = $this->count($distinctField);
|
||||
$pager->setRecTotal($recTotal);
|
||||
$pager->setPageTotal();
|
||||
}
|
||||
* 重新计算分页数据,并判断是否需要返回上一页。
|
||||
* Calculate pagination to determine whether to return to the previous page.
|
||||
*/
|
||||
$originalPageID = $pager->pageID;
|
||||
$recTotal = $this->count($distinctField);
|
||||
$pager->setRecTotal($recTotal);
|
||||
$pager->setPageTotal();
|
||||
if($originalPageID > $pager->pageTotal) $pager->setPageID($pager->pageTotal);
|
||||
|
||||
$this->sqlobj->limit($pager->limit());
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -360,8 +360,8 @@ class basePager
|
||||
/**
|
||||
* 设置分页信息的样式。
|
||||
* Get the pager html string.
|
||||
*
|
||||
* @param string $align
|
||||
*
|
||||
* @param string $align
|
||||
* @param string $type the pager type, full|short|shortest
|
||||
* @access public
|
||||
* @return string
|
||||
@@ -392,7 +392,7 @@ class basePager
|
||||
$position = $this->pageTotal == 1 ? '' : $this->pageID . '/' . $this->pageTotal;
|
||||
$pager = $pager . ' ' . $position;
|
||||
}
|
||||
else if($type != 'full')
|
||||
else if($type != 'full')
|
||||
{
|
||||
$pager = $this->pageID . '/' . $this->pageTotal . ' ' . $pager;
|
||||
}
|
||||
|
||||
@@ -127,18 +127,13 @@ class bug extends control
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
|
||||
$pager = pager::init(0, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Get projects. */
|
||||
$projects = $this->loadModel('project')->getPairs('empty|withdelete');
|
||||
|
||||
/* Get bugs. */
|
||||
$bugs = $this->bug->getBugs($productID, $projects, $branch, $browseType, $moduleID, $queryID, $sort, $pager);
|
||||
if(empty($bugs) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$bugs = $this->bug->getBugs($productID, $projects, $branch, $browseType, $moduleID, $queryID, $sort, $pager);
|
||||
}
|
||||
|
||||
/* Process the sql, get the conditon partion, save it to session. */
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'bug', $browseType == 'needconfirm' ? false : true);
|
||||
|
||||
@@ -200,11 +200,6 @@ class caselib extends control
|
||||
|
||||
/* save session .*/
|
||||
$cases = $this->caselib->getLibCases($libID, $browseType, $queryID, $moduleID, $sort, $pager);
|
||||
if(empty($cases) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$cases = $this->caselib->getLibCases($libID, $browseType, $queryID, $moduleID, $sort, $pager);
|
||||
}
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', true);
|
||||
|
||||
|
||||
@@ -166,16 +166,10 @@ class product extends control
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
if($this->app->getViewType() == 'mhtml') $recPerPage = 10;
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
/* Get stories. */
|
||||
$stories = $this->product->getStories($productID, $branch, $browseType, $queryID, $moduleID, $storyType, $sort, $pager);
|
||||
if(empty($stories) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$stories = $this->product->getStories($productID, $branch, $browseType, $queryID, $moduleID, $storyType, $sort, $pager);
|
||||
}
|
||||
|
||||
/* Process the sql, get the conditon partion, save it to session. */
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', $browseType != 'bysearch');
|
||||
|
||||
@@ -181,11 +181,6 @@ class project extends control
|
||||
|
||||
/* Get tasks. */
|
||||
$tasks = $this->project->getTasks($productID, $projectID, $this->projects, $browseType, $queryID, $moduleID, $sort, $pager);
|
||||
if(empty($tasks) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$tasks = $this->project->getTasks($productID, $projectID, $this->projects, $browseType, $queryID, $moduleID, $sort, $pager);
|
||||
}
|
||||
|
||||
/* Build the search form. */
|
||||
$actionURL = $this->createLink('project', 'task', "projectID=$projectID&status=bySearch¶m=myQueryID");
|
||||
@@ -707,11 +702,6 @@ class project extends control
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$stories = $this->story->getProjectStories($projectID, $sort, $type, $param, 'story', '', $pager);
|
||||
if(empty($stories) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$stories = $this->story->getProjectStories($projectID, $sort, $type, $param, 'story', '', $pager);
|
||||
}
|
||||
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'story', false);
|
||||
$users = $this->user->getPairs('noletter');
|
||||
|
||||
@@ -1463,7 +1463,6 @@ class story extends control
|
||||
$storyInfo['estimate'] = $story->estimate;
|
||||
$storyInfo['pri'] = $story->pri;
|
||||
$storyInfo['spec'] = html_entity_decode($story->spec);
|
||||
|
||||
|
||||
echo json_encode($storyInfo);
|
||||
}
|
||||
|
||||
@@ -1729,6 +1729,7 @@ class storyModel extends model
|
||||
$branch = join(',', $branch);
|
||||
if($branch) $branch = "0,$branch";
|
||||
}
|
||||
|
||||
$stories = $this->dao->select('*')->from(TABLE_STORY)
|
||||
->where('product')->in($productID)
|
||||
->beginIF(!$hasParent)->andWhere("parent")->ge(0)->fi()
|
||||
@@ -1738,7 +1739,10 @@ class storyModel extends model
|
||||
->beginIF($status and $status != 'all')->andWhere('status')->in($status)->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->andWhere('type')->eq($type)
|
||||
->orderBy($orderBy)->page($pager)->fetchAll('id');
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll('id');
|
||||
|
||||
return $this->mergePlanTitle($productID, $stories, $branch, $type);
|
||||
}
|
||||
|
||||
|
||||
@@ -1631,7 +1631,7 @@ class taskModel extends model
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('id')->eq((int)$taskID)->exec();
|
||||
if($oldTask->fromBug) $this->dao->update(TABLE_BUG)->set('toTask')->eq(0)->where('id')->eq($oldTask->fromBug)->exec();
|
||||
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
|
||||
if($oldTask->parent == '-1')
|
||||
if($oldTask->parent == '-1')
|
||||
{
|
||||
unset($task->assignedTo);
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('parent')->eq((int)$taskID)->exec();
|
||||
@@ -1695,7 +1695,7 @@ class taskModel extends model
|
||||
->exec();
|
||||
|
||||
if($oldTask->parent > 0) $this->updateParentStatus($taskID);
|
||||
if($oldTask->parent == '-1')
|
||||
if($oldTask->parent == '-1')
|
||||
{
|
||||
unset($task->left);
|
||||
$this->dao->update(TABLE_TASK)->data($task)->autoCheck()->where('parent')->eq((int)$taskID)->exec();
|
||||
|
||||
@@ -23,7 +23,6 @@
|
||||
<?php endif;?>
|
||||
</h2>
|
||||
</div>
|
||||
|
||||
<form method='post' target='hiddenwin'>
|
||||
<table class='table table-form'>
|
||||
<tr class='hide'>
|
||||
|
||||
@@ -92,16 +92,11 @@ class testcase extends control
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
$sort = $this->loadModel('common')->appendOrder($orderBy);
|
||||
|
||||
/* Get test cases. */
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
|
||||
if(empty($cases) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$cases = $this->testcase->getTestCases($productID, $branch, $browseType, $browseType == 'bysearch' ? $queryID : $suiteID, $moduleID, $sort, $pager);
|
||||
}
|
||||
|
||||
/* save session .*/
|
||||
$this->loadModel('common')->saveQueryCondition($this->dao->get(), 'testcase', $browseType != 'bysearch' ? false : true);
|
||||
@@ -1504,7 +1499,7 @@ class testcase extends control
|
||||
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = pager::init(0, $recPerPage, $pageID);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->view->title = $this->lang->testcase->common . $this->lang->colon . $this->lang->testcase->importFromLib;
|
||||
$this->view->position[] = $this->lang->testcase->importFromLib;
|
||||
|
||||
@@ -63,11 +63,6 @@ class testreport extends control
|
||||
$pager = pager::init($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$reports = $this->testreport->getList($objectID, $objectType, $extra, $orderBy, $pager);
|
||||
if(empty($reports) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$reports = $this->testreport->getList($objectID, $objectType, $extra, $orderBy, $pager);
|
||||
}
|
||||
|
||||
if($objectType == 'project' and isset($_POST['taskIdList']))
|
||||
{
|
||||
|
||||
@@ -54,11 +54,6 @@ class testsuite extends control
|
||||
$productName = isset($this->products[$productID]) ? $this->products[$productID] : '';
|
||||
|
||||
$suites = $this->testsuite->getSuites($productID, $sort, $pager);
|
||||
if(empty($suites) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$suites = $this->testsuite->getSuites($productID, $sort, $pager);
|
||||
}
|
||||
|
||||
$this->view->title = $productName . $this->lang->testsuite->common;
|
||||
$this->view->position[] = html::a($this->createLink('testsuite', 'browse', "productID=$productID"), $productName);
|
||||
|
||||
@@ -77,11 +77,6 @@ class testtask extends control
|
||||
|
||||
/* Get tasks. */
|
||||
$tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime);
|
||||
if(empty($tasks) and $pageID > 1)
|
||||
{
|
||||
$pager = pager::init(0, $recPerPage, 1);
|
||||
$tasks = $this->testtask->getProductTasks($productID, $branch, $sort, $pager, $scopeAndStatus, $beginTime, $endTime);
|
||||
}
|
||||
|
||||
$this->view->title = $this->products[$productID] . $this->lang->colon . $this->lang->testtask->common;
|
||||
$this->view->position[] = html::a($this->createLink('testtask', 'browse', "productID=$productID"), $this->products[$productID]);
|
||||
|
||||
Reference in New Issue
Block a user