* adjust for upgrade.

This commit is contained in:
wangyidong
2018-03-27 14:23:19 +08:00
parent a4b6765a3b
commit 4d8984eeb5
4 changed files with 13 additions and 14 deletions
+3 -2
View File
@@ -413,12 +413,13 @@ class bugModel extends model
* getActiveBugs
*
* @param array $products
* @param int $branch
* @param int $projectID
* @param object $pager
* @access public
* @return array
*/
public function getActiveBugs($products, $branch, $projectID, $pager = null)
public function getActiveBugs($products, $branch, $projects, $pager = null)
{
return $this->dao->select('*')->from(TABLE_BUG)
->where('status')->eq('active')
@@ -426,7 +427,7 @@ class bugModel extends model
->andWhere('tostory')->eq(0)
->beginIF(!empty($products))->andWhere('product')->in($products)->fi()
->beginIF($branch)->andWhere('branch')->in("0,$branch")->fi()
->beginIF(empty($products))->andWhere('project')->eq($projectID)->fi()
->beginIF(!empty($projects))->andWhere('project')->in($projects)->fi()
->andWhere('deleted')->eq(0)
->orderBy('id desc')
->page($pager)
+2 -2
View File
@@ -514,9 +514,9 @@ class productplan extends control
}
else
{
$projects = $this->loadModel('project')->getPairs();
$projects = $this->loadModel('project')->getPairs();
$projects[0] = '';
$allBugs= $this->bug->getActiveBugs($this->view->product->id, $plan->branch, $projects);
$allBugs = $this->bug->getActiveBugs($this->view->product->id, $plan->branch, array_keys($projects));
}
$this->view->allBugs = $allBugs;
+2
View File
@@ -85,6 +85,7 @@ class upgrade extends control
*/
public function confirm()
{
$this->session->set('step', '');
$this->view->title = $this->lang->upgrade->confirm;
$this->view->position[] = $this->lang->upgrade->common;
$this->view->confirm = $this->upgrade->getConfirm($this->post->fromVersion);
@@ -104,6 +105,7 @@ class upgrade extends control
*/
public function execute($fromVersion = '')
{
$this->session->set('step', '');
$fromVersion = isset($_POST['fromVersion']) ? $this->post->fromVersion : $fromVersion;
$this->upgrade->execute($fromVersion);
+6 -10
View File
@@ -2168,11 +2168,9 @@ class upgradeModel extends model
{
$lastChild = isset($lastChildTasks[$parentTask->id]) ? $lastChildTasks[$parentTask->id] : '';
$this->dao->update(TABLE_TASK)
->set('assignedTo')->eq('closed')
->beginIF($lastChild)->set('assignedDate')->eq($lastChild->assignedDate)->fi()
->where('id')->eq($parentTask->id)
->exec();
$stmt = $this->dao->update(TABLE_TASK)->set('assignedTo')->eq('closed');
if($lastChild) $stmt->set('assignedDate')->eq($lastChild->assignedDate);
$stmt->where('id')->eq($parentTask->id)->exec();
if(empty($parentTask->closedBy) && !empty($lastChild->closedBy))
{
@@ -2192,11 +2190,9 @@ class upgradeModel extends model
foreach($childTasks as $childTask)
{
$this->dao->update(TABLE_TASK)
->set('assignedTo')->eq('closed')
->beginIF(!empty($parent))->set('assignedDate')->eq($parent->assignedDate)->fi()
->where('id')->eq($childTask->id)
->exec();
$stmt = $this->dao->update(TABLE_TASK)->set('assignedTo')->eq('closed');
if(!empty($parent)) $stmt->set('assignedDate')->eq($parent->assignedDate);
$stmt->where('id')->eq($childTask->id)->exec();
if(empty($childTask->closedBy) && !empty($parent->closedBy))
{