* Fix bug.

This commit is contained in:
leiyong
2021-04-09 13:16:24 +03:00
parent b89e3d0665
commit d0e21dee63
8 changed files with 46 additions and 61 deletions
+1 -1
View File
@@ -1545,7 +1545,7 @@ class bugModel extends model
$execution = $this->dao->select('*')->from(TABLE_EXECUTION)->where('id')->eq($build->execution)->fetch();
$beforeBuilds = $this->dao->select('t1.id')->from(TABLE_BUILD)->alias('t1')
->leftJoin(TABLE_EXECTUION)->alias('t2')->on('t1.execution=t2.id')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.execution=t2.id')
->where('t1.product')->eq($productID)
->andWhere('t2.status')->ne('done')
->andWhere('t2.deleted')->eq(0)
+2 -6
View File
@@ -188,10 +188,6 @@ class build extends control
if(!$build) die(js::error($this->lang->notFound) . js::locate('back'));
$this->session->project = $build->project;
/* Set session and load modules. */
if($type == 'story')$this->session->set('storyList', $this->app->getURI(true), 'product');
if($type == 'bug') $this->session->set('bugList', $this->app->getURI(true), 'qa');
$this->loadModel('story');
$this->loadModel('bug');
@@ -404,7 +400,7 @@ class build extends control
}
/**
* Link stories
* Link stories.
*
* @param int $buildID
* @param string $browseType
@@ -423,7 +419,7 @@ class build extends control
die(js::locate(inlink('view', "buildID=$buildID&type=story"), 'parent'));
}
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product');
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), $this->app->openApp);
$build = $this->build->getById($buildID);
$product = $this->loadModel('product')->getById($build->product);
+17 -29
View File
@@ -258,6 +258,7 @@ class execution extends control
*
* @param int $executionID
* @param string $groupBy the field to group by
* @param string $filter
* @access public
* @return void
*/
@@ -268,7 +269,6 @@ class execution extends control
/* Save session. */
$this->app->session->set('taskList', $this->app->getURI(true), 'execution');
$this->app->session->set('storyList', $this->app->getURI(true), 'product');
/* Header and session. */
$this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->task;
@@ -491,7 +491,6 @@ class execution extends control
/* Save session. */
$this->app->session->set('taskList', $this->app->getURI(true), 'execution');
$this->app->session->set('storyList', $this->app->getURI(true), 'product');
$this->view->title = $execution->name . $this->lang->colon . $this->lang->execution->importTask;
$this->view->position[] = html::a(inlink('browse', "executionID=$toExecution"), $execution->name);
@@ -530,12 +529,6 @@ class execution extends control
$browseType = strtolower($browseType);
$queryID = ($browseType == 'bysearch') ? (int)$param : 0;
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('bugList', $uri, 'qa');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('executionList', $uri, 'execution');
$this->loadModel('bug');
$executions = $this->execution->getPairs(0, 'all', 'nocode');
$this->execution->setMenu($executionID);
@@ -819,7 +812,7 @@ class execution extends control
}
/**
* Exectuion qa dashboard.
* Execution qa dashboard.
*
* @param int $executionID
* @access public
@@ -1808,7 +1801,6 @@ class execution extends control
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('bugList', $uri, 'qa');
/* Compatibility IE8*/
@@ -1833,9 +1825,9 @@ class execution extends control
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->storyOrder = $orderBy;
$this->view->orderBy = 'id_asc';
$this->view->executionID = $executionID;
$this->view->executionID = $executionID;
$this->view->browseType = '';
$this->view->execution = $execution;
$this->view->execution = $execution;
$this->view->type = $type;
$this->view->kanbanGroup = $kanbanGroup;
$this->view->kanbanColumns = $this->execution->getKanbanColumns($kanbanSetting);
@@ -1865,8 +1857,8 @@ class execution extends control
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'product');
$this->app->session->set('taskList', $uri, 'execution');
$this->app->session->set('storyList', $uri, 'execution');
$this->app->session->set('executionList', $uri, 'execution');
$this->app->session->set('caseList', $uri, 'qa');
$this->app->session->set('bugList', $uri, 'qa');
@@ -2001,10 +1993,6 @@ class execution extends control
*/
public function storyKanban($executionID)
{
/* Save to session. */
$uri = $this->app->getURI(true);
$this->app->session->set('storyList', $uri, 'product');
/* Compatibility IE8*/
if(strpos($this->server->http_user_agent, 'MSIE 8.0') !== false) header("X-UA-Compatible: IE=EmulateIE7");
@@ -2023,8 +2011,8 @@ class execution extends control
$this->view->position[] = $this->lang->execution->storyKanban;
$this->view->stories = $this->story->getKanbanGroupData($stories);
$this->view->realnames = $this->loadModel('user')->getPairs('noletter');
$this->view->executionID = $executionID;
$this->view->execution = $execution;
$this->view->executionID = $executionID;
$this->view->execution = $execution;
$this->view->productID = $productID;
$this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable.
@@ -2367,15 +2355,15 @@ class execution extends control
$this->view->position[] = html::a($browseLink, $object->name);
$this->view->position[] = $this->lang->execution->linkStory;
$this->view->object = $object;
$this->view->products = $products;
$this->view->allStories = empty($allStories) ? $allStories : $allStories[$pageID - 1];;
$this->view->pager = $pager;
$this->view->browseType = $browseType;
$this->view->productType = $productType;
$this->view->modules = $modules;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->branchGroups = $branchGroups;
$this->view->object = $object;
$this->view->products = $products;
$this->view->allStories = empty($allStories) ? $allStories : $allStories[$pageID - 1];;
$this->view->pager = $pager;
$this->view->browseType = $browseType;
$this->view->productType = $productType;
$this->view->modules = $modules;
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->branchGroups = $branchGroups;
$this->display();
}
+3 -3
View File
@@ -124,9 +124,9 @@
<ul class='dropdown-menu pull-right'>
<?php
$misc = "data-toggle='modal' data-type='iframe' data-width='95%'";
echo (common::hasPriv('task', 'create')) ? '<li>' . html::a($this->createLink('task', 'create', "executionID=$story->execution&storyID=$story->id&moduleID=$story->module", '', true), $lang->execution->wbs, '', $misc) : '' . '</li>';
echo (common::hasPriv('task', 'batchCreate')) ? '<li>' . html::a($this->createLink('task', 'batchCreate', "executionID=$story->execution&storyID=$story->id&moduleID=0&taskID=0&iframe=true", '', true), $lang->execution->batchWBS, '', $misc) : '' . '</li>';
echo (common::hasPriv('execution', 'unlinkStory')) ? '<li>' . html::a($this->createLink('execution', 'unlinkStory', "executionID=$story->execution&storyID=$story->story&confirm=no", '', true), $lang->execution->unlinkStory, 'hiddenwin') : '' . '</li>';
echo (common::hasPriv('task', 'create')) ? '<li>' . html::a($this->createLink('task', 'create', "executionID=$executionID&storyID=$story->id&moduleID=$story->module", '', true), $lang->execution->wbs, '', $misc) : '' . '</li>';
echo (common::hasPriv('task', 'batchCreate')) ? '<li>' . html::a($this->createLink('task', 'batchCreate', "executionID=$executionID&storyID=$story->id&moduleID=0&taskID=0&iframe=true", '', true), $lang->execution->batchWBS, '', $misc) : '' . '</li>';
echo (common::hasPriv('execution', 'unlinkStory')) ? '<li>' . html::a($this->createLink('execution', 'unlinkStory', "executionID=$executionID&storyID=$story->story&confirm=no", '', true), $lang->execution->unlinkStory, 'hiddenwin') : '' . '</li>';
$misc = "data-toggle='modal' data-type='iframe'";
echo (common::hasPriv('story', 'close')) ? '<li>' . html::a($this->createLink('story', 'close', "storyID=$story->id", '', true), $lang->story->close, '', $misc) : '' . '</li>';
?>
+1 -1
View File
@@ -872,7 +872,7 @@ class project extends control
$project = $this->project->getByID($projectID);
$this->project->setMenu($projectID);
$this->session->set('buildList', $this->app->getURI(true), 'execution');
$this->session->set('buildList', $this->app->getURI(true), 'project');
/* Get products' list. */
$products = $this->project->getProducts($projectID, false);
+20 -19
View File
@@ -192,8 +192,7 @@ class projectrelease extends control
*/
public function view($releaseID, $type = 'story', $link = 'false', $param = '', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 100, $pageID = 1)
{
if($type == 'story') $this->session->set('storyList', $this->app->getURI(true), 'product');
if($type == 'bug' or $type == 'leftBug') $this->session->set('bugList', $this->app->getURI(true), 'qa');
$this->session->set('buildList', $this->app->getURI(true), 'execution');
$this->loadModel('story');
$this->loadModel('bug');
@@ -237,22 +236,23 @@ class projectrelease extends control
$this->executeHooks($releaseID);
$this->view->title = "RELEASE #$release->id $release->name/" . $product->name;
$this->view->position[] = $this->lang->release->view;
$this->view->release = $release;
$this->view->stories = $stories;
$this->view->bugs = $bugs;
$this->view->leftBugs = $leftBugs;
$this->view->actions = $this->loadModel('action')->getList('release', $releaseID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->type = $type;
$this->view->link = $link;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
$this->view->branchName = $release->productType == 'normal' ? '' : $this->loadModel('branch')->getById($release->branch);
$this->view->storyPager = $storyPager;
$this->view->bugPager = $bugPager;
$this->view->leftBugPager = $leftBugPager;
$this->view->title = "RELEASE #$release->id $release->name/" . $product->name;
$this->view->position[] = $this->lang->release->view;
$this->view->release = $release;
$this->view->stories = $stories;
$this->view->bugs = $bugs;
$this->view->leftBugs = $leftBugs;
$this->view->actions = $this->loadModel('action')->getList('release', $releaseID);
$this->view->users = $this->loadModel('user')->getPairs('noletter');
$this->view->type = $type;
$this->view->link = $link;
$this->view->param = $param;
$this->view->orderBy = $orderBy;
$this->view->branchName = $release->productType == 'normal' ? '' : $this->loadModel('branch')->getById($release->branch);
$this->view->storyPager = $storyPager;
$this->view->bugPager = $bugPager;
$this->view->leftBugPager = $leftBugPager;
$this->view->projectID = $this->session->project;
$this->display();
}
@@ -429,7 +429,7 @@ class projectrelease extends control
$this->projectrelease->linkStory($releaseID);
die(js::locate(inlink('view', "releaseID=$releaseID&type=story"), 'parent'));
}
$this->session->set('storyList', inlink('view', "releaseID=$releaseID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), 'product');
$this->session->set('storyList', inlink('view', "releaseID=$releaseID&type=story&link=true&param=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")), $this->app->openApp);
$release = $this->projectrelease->getByID($releaseID);
$build = $this->loadModel('build')->getByID($release->build);
@@ -482,6 +482,7 @@ class projectrelease extends control
$this->view->browseType = $browseType;
$this->view->param = $param;
$this->view->pager = $pager;
$this->view->projectID = $this->session->project;
$this->display();
}
@@ -51,7 +51,7 @@
<td class='text-left nobr' title='<?php echo $story->title?>'>
<?php
if($story->parent > 0) echo "<span class='label'>{$lang->story->childrenAB}</span>";
echo html::a($this->createLink('story', 'view', "storyID=$story->id", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");
echo html::a($this->createLink('story', 'view', "storyID={$story->id}&version=0&param=$projectID", '', true), $story->title, '', "data-toggle='modal' data-type='iframe' data-width='90%'");
?>
</td>
<td><?php echo zget($users, $story->openedBy);?></td>
+1 -1
View File
@@ -96,7 +96,7 @@
</thead>
<tbody>
<?php foreach($stories as $storyID => $story):?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id", '', true);?>
<?php $storyLink = $this->createLink('story', 'view', "storyID=$story->id&version=0&param=$projectID", '', true);?>
<tr>
<td class='c-id text-left'>
<?php if(($canBatchUnlink or $canBatchClose) and $canBeChanged):?>