diff --git a/config/filter.php b/config/filter.php
index dca7d428d4..6b26ad992d 100644
--- a/config/filter.php
+++ b/config/filter.php
@@ -85,7 +85,7 @@ $filter->program->browse = new stdclass();
$filter->program->export = new stdclass();
$filter->program->pgmbrowse = new stdclass();
$filter->program->export = new stdclass();
-$filter->program->ajaxgetpgmdropmenu = new stdclass();
+$filter->program->ajaxgetdropmenu = new stdclass();
$filter->project->default = new stdclass();
$filter->project->browse = new stdclass();
$filter->project->story = new stdclass();
@@ -165,13 +165,13 @@ $filter->product->index->cookie['preBranch'] = 'int';
$filter->product->export->cookie['checkedItem'] = 'reg::checked';
$filter->product->project->cookie['involved'] = 'code';
-$filter->program->default->cookie['lastPGM'] = 'int';
-$filter->program->default->cookie['lastPRJ'] = 'int';
-$filter->program->prjbrowse->cookie['programType'] = 'code';
-$filter->program->project->cookie['involved'] = 'code';
-$filter->program->browse->cookie['showClosed'] = 'code';
-$filter->program->export->cookie['checkedItem'] = 'reg::checked';
-$filter->program->ajaxgetpgmdropmenu->cookie['showClosed'] = 'code';
+$filter->program->default->cookie['lastPGM'] = 'int';
+$filter->program->default->cookie['lastPRJ'] = 'int';
+$filter->program->prjbrowse->cookie['programType'] = 'code';
+$filter->program->project->cookie['involved'] = 'code';
+$filter->program->browse->cookie['showClosed'] = 'code';
+$filter->program->export->cookie['checkedItem'] = 'reg::checked';
+$filter->program->ajaxgetdropmenu->cookie['showClosed'] = 'code';
$filter->project->default->cookie['lastProject'] = 'int';
$filter->project->default->cookie['lastPRJ'] = 'int';
diff --git a/module/build/control.php b/module/build/control.php
index 5bd2bad7a2..5a68f6f040 100644
--- a/module/build/control.php
+++ b/module/build/control.php
@@ -63,7 +63,7 @@ class build extends control
$products = array();
foreach($productGroups as $product) $products[$product->id] = $product->name;
- $this->view->title = $execution->name . $this->lang->colon . $this->lang->build->create;
+ $this->view->title = $this->lang->build->create;
$this->view->position[] = $this->lang->build->create;
$this->view->product = isset($productGroups[$productID]) ? $productGroups[$productID] : '';
@@ -110,7 +110,7 @@ class build extends control
$build = $this->build->getById((int)$buildID);
/* Set menu. */
- $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $build->execution);
+ $this->execution->setMenu($this->execution->getPairs($build->project), $build->execution);
/* Get stories and bugs. */
$orderBy = 'status_asc, stage_asc, id_desc';
@@ -205,8 +205,8 @@ class build extends control
foreach($stages as $storyID => $stage)$stories[$storyID]->stage = $stage;
/* Set menu. */
- $this->loadModel('execution')->setMenu($this->execution->getPairs($this->session->PRJ), $build->execution, $buildID);
- $executions = $this->execution->getPairs($this->session->PRJ, 'all', 'empty');
+ commonModel::setAppObjectID('execution', $build->execution);
+ $executions = $this->loadModel('execution')->getPairs($this->session->PRJ, 'all', 'empty');
$this->view->title = "BUILD #$build->id $build->name - " . $executions[$build->execution];
$this->view->position[] = html::a($this->createLink('execution', 'task', "executionID=$build->execution"), $executions[$build->execution]);
@@ -400,7 +400,7 @@ class build extends control
$this->session->set('storyList', inlink('view', "buildID=$buildID&type=story&link=true¶m=" . helper::safe64Encode("&browseType=$browseType&queryID=$param")));
$build = $this->build->getById($buildID);
$product = $this->loadModel('product')->getById($build->product);
- $this->loadModel('execution')->setMenu($this->execution->getPairs($this->session->PRJ), $build->execution);
+ $this->loadModel('execution')->setMenu($this->execution->getPairs($build->project), $build->execution);
$this->loadModel('story');
$this->loadModel('tree');
$this->loadModel('product');
@@ -519,7 +519,7 @@ class build extends control
/* Set menu. */
$build = $this->build->getByID($buildID);
$product = $this->loadModel('product')->getByID($build->product);
- $this->loadModel('execution')->setMenu($this->execution->getPairs($this->session->PRJ), $build->execution);
+ $this->loadModel('execution')->setMenu($this->execution->getPairs($build->project), $build->execution);
/* Load pager. */
$this->app->loadClass('pager', $static = true);
diff --git a/module/execution/control.php b/module/execution/control.php
index b011e50a06..48c60058e9 100644
--- a/module/execution/control.php
+++ b/module/execution/control.php
@@ -475,7 +475,7 @@ class execution extends control
$toExecution = $execution->id;
$branches = $this->execution->getBranches($toExecution);
$tasks = $this->execution->getTasks2Imported($toExecution, $branches);
- $executions = $this->execution->getsToImport(array_keys($tasks), $execution->type);
+ $executions = $this->execution->getToImport(array_keys($tasks), $execution->type);
unset($executions[$toExecution]);
unset($tasks[$toExecution]);
@@ -540,7 +540,7 @@ class execution extends control
$this->app->session->set('executionList', $uri);
$this->loadModel('bug');
- $executions = $this->execution->getPairs($this->session->PRJ, 'all', 'nocode');
+ $executions = $this->execution->getPairs(0, 'all', 'nocode');
$this->execution->setMenu($executions, $executionID);
/* Load pager. */
@@ -1052,7 +1052,7 @@ class execution extends control
$this->view->orderBy = $orderBy;
$this->view->tasks = $productTasks;
$this->view->users = $this->loadModel('user')->getPairs('noclosed|noletter');
- $this->view->products = $this->loadModel('product')->getPairs('', $this->session->PRJ);
+ $this->view->products = $this->loadModel('product')->getPairs('', 0);
$this->view->canBeChanged = common::canModify('execution', $execution); // Determines whether an object is editable.
$this->display();
@@ -2964,7 +2964,7 @@ class execution extends control
$this->view->cases = $cases;
$this->view->story = $story;
$this->view->users = $users;
- $this->view->executions = $this->loadModel('execution')->getPairs($this->session->PRJ, 'all', 'nocode');
+ $this->view->executions = $this->loadModel('execution')->getPairs(0, 'all', 'nocode');
$this->view->actions = $this->loadModel('action')->getList('story', $storyID);
$this->view->modulePath = $modulePath;
$this->view->version = $version == 0 ? $story->version : $version;
diff --git a/module/execution/model.php b/module/execution/model.php
index 6822f93ff5..07d33a723e 100644
--- a/module/execution/model.php
+++ b/module/execution/model.php
@@ -212,7 +212,7 @@ class executionModel extends model
*/
public function tree()
{
- $products = $this->loadModel('product')->getPairs('nocode', $this->session->PRJ);
+ $products = $this->loadModel('product')->getPairs('nocode', 0);
$productGroup = $this->getProductGroupList();
$executionTree = "
";
foreach($productGroup as $productID => $executions)
@@ -920,7 +920,7 @@ class executionModel extends model
if($projectID)
{
$executionModel = $this->dao->select('model')->from(TABLE_EXECUTION)->where('id')->eq($projectID)->andWhere('deleted')->eq(0)->fetch('model');
- $orderBy = $executionModel == 'waterfall' ? 'sortStatus_asc,begin_asc,id_asc' : 'begin_desc';
+ $orderBy = $executionModel == 'waterfall' ? 'sortStatus_asc,begin_asc,id_asc' : 'id_desc';
/* Waterfall execution, when all phases are closed, in reverse order of date. */
if($executionModel == 'waterfall')
@@ -1709,10 +1709,10 @@ class executionModel extends model
*/
public function getTasks2Imported($toExecution, $branches)
{
- $products = $this->getProducts($toExecution);
+ $products = $this->getProducts($toExecution);
if(empty($products)) return array();
- $execution = $this->getById($toExecution);
+ $execution = $this->getById($toExecution);
$executions = $this->dao->select('t1.product, t1.project')->from(TABLE_PROJECTPRODUCT)->alias('t1')
->leftJoin(TABLE_EXECUTION)->alias('t2')->on('t1.project=t2.id')
->where('t1.product')->in(array_keys($products))
@@ -1855,6 +1855,7 @@ class executionModel extends model
$bugToTasks = fixer::input('post')->get();
$bugs = $this->bug->getByList(array_keys($bugToTasks->import));
+ $projectID = $this->loadModel('execution')->getProjectID($executionID);
foreach($bugToTasks->import as $key => $value)
{
$bug = zget($bugs, $key, '');
@@ -1862,8 +1863,8 @@ class executionModel extends model
$task = new stdClass();
$task->bug = $bug;
- $task->PRJ = $this->session->PRJ;
- $task->execution = $executionID;
+ $task->project = $projectID;
+ $task->execution = $executionID;
$task->story = $bug->story;
$task->storyVersion = $bug->storyVersion;
$task->module = isset($modules[$bug->module]) ? $bug->module : 0;
diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php
index 3bcc6c9050..dd7b9cb8d7 100644
--- a/module/execution/view/all.html.php
+++ b/module/execution/view/all.html.php
@@ -22,7 +22,7 @@
.table td.has-child > .plan-toggle > .icon:before {text-align: left;}
.table td.has-child > .plan-toggle.collapsed > .icon {-ms-transform:rotate(90deg); -moz-transform:rotate(90deg); -o-transform:rotate(90deg); -webkit-transform:rotate(90deg); transform: rotate(90deg);}
.main-table tbody > tr.table-children > td:first-child::before {width: 3px;}
-.hours {text-align: right;}
+.hours {text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;}
@-moz-document url-prefix() {.main-table tbody > tr.table-children > td:first-child::before {width: 4px;}}
@@ -67,11 +67,11 @@
execution->execName : $lang->execution->name);?> |
execution->owner);?> |
-
execution->end);?> |
-
execution->execStatus : $lang->execution->status);?> |
-
execution->totalEstimate;?> |
-
execution->totalConsumed;?> |
-
execution->totalLeft;?> |
+
execution->end);?> |
+
execution->execStatus : $lang->execution->status);?> |
+
execution->totalEstimate;?> |
+
execution->totalConsumed;?> |
+
execution->totalLeft;?> |
execution->progress;?> |
execution->burn;?> |
diff --git a/module/execution/view/batchedit.html.php b/module/execution/view/batchedit.html.php
index 5ccf48a5ad..51bcaa38dd 100755
--- a/module/execution/view/batchedit.html.php
+++ b/module/execution/view/batchedit.html.php
@@ -42,7 +42,7 @@
| idAB;?> |
- execution->name;?> |
+ execution->name;?> |
execution->code;?> |
'>execution->PM;?> |
'>execution->PO;?> |
@@ -55,7 +55,6 @@
'> execution->desc;?> |
'>execution->teamname;?> |
'>execution->days;?> |
- execution->order;?> |
@@ -97,7 +96,6 @@
execution->day;?>
- order, "class='form-control'")?> |
config->moreLinks["PMs[$executionID]"])) unset($this->config->moreLinks["PMs[$executionID]"]);
diff --git a/module/execution/view/testtask.html.php b/module/execution/view/testtask.html.php
index 3d0475b5b0..5d4629f5c6 100644
--- a/module/execution/view/testtask.html.php
+++ b/module/execution/view/testtask.html.php
@@ -30,7 +30,7 @@
- " . $lang->testtask->create, '', "class='btn btn-primary'");?>
+ project", " " . $lang->testtask->create, '', "class='btn btn-primary'");?>
diff --git a/module/product/model.php b/module/product/model.php
index 33f6921931..febb71a391 100644
--- a/module/product/model.php
+++ b/module/product/model.php
@@ -763,7 +763,6 @@ class productModel extends model
if($browseType == 'changedstory') $stories = $this->story->getByStatus($productID, $branch, $modules, 'changed', $type, $sort, $pager);
if($browseType == 'willclose') $stories = $this->story->get2BeClosed($productID, $branch, $modules, $type, $sort, $pager);
if($browseType == 'closedstory') $stories = $this->story->getByStatus($productID, $branch, $modules, 'closed', $type, $sort, $pager);
- if($browseType == 'emptysr') $stories = $this->story->getEmptySR($productID, $branch, $modules, '', $type, $sort, $pager);
return $stories;
}
diff --git a/module/program/view/ajaxgetdropmenu.html.php b/module/program/view/ajaxgetdropmenu.html.php
index c369546b4e..0d1d968201 100644
--- a/module/program/view/ajaxgetdropmenu.html.php
+++ b/module/program/view/ajaxgetdropmenu.html.php
@@ -34,6 +34,7 @@ $programsPinYin = common::convert2Pinyin($programNames);
#programTree li > a > span.title {color: #3C4353; white-space: nowrap; max-width: 60%; overflow: hidden; text-overflow: ellipsis; vertical-align: middle;}
#programTree li > a > span.user {color: #838a9d;}
#programTree li > a > span.user > .icon-person {font-size: 14px; position: relative; top: -1px; color: #a6aab8}
+#programTree li > a:first-child {padding-left: 18px;}
#programTree li > .list-toggle {transform: rotate(0deg); width: 16px; height: 16px; border: 4px solid #a6aab8; border-radius: 2px; top: 7px;}
#programTree li > .list-toggle:before {content: ' '; display: block; position: absolute; border: 1px solid #a6aab8; top: 2px; left: -3px; right: -3px; bottom: 2px; min-width: 0; transition: all .2s;}
@@ -58,11 +59,11 @@ $programsPinYin = common::convert2Pinyin($programNames);
$('#programTree').tree();
$(function()
{
- $('input[name^="showClosed"]').click(function()
+ $(document).on('change', 'input[name^="showClosed"]', function()
{
var showClosed = $(this).is(':checked') ? 1 : 0;
$.cookie('showClosed', showClosed, {expires:config.cookieLife, path:config.webRoot});
- window.location.reload();
+ $("#dropMenu > .list-group").load(createLink('program', 'ajaxgetdropmenu', 'programID=' + programID + '&module=' + module + '&method=' + method));
});
});
diff --git a/module/project/control.php b/module/project/control.php
index a47163f5e3..c44c2dab1c 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -685,6 +685,8 @@ class project extends control
$this->loadModel('build');
$project = $this->project->getByID($projectID);
+ $this->session->set('buildList', $this->app->getURI(true));
+
/* Get products' list. */
$products = $this->project->getProducts($projectID, false);
$products = array('' => '') + $products;
diff --git a/module/project/js/build.js b/module/project/js/build.js
index fdab9a0141..e98b0b44e9 100644
--- a/module/project/js/build.js
+++ b/module/project/js/build.js
@@ -20,6 +20,6 @@ $(function()
*/
function changeProduct(productID)
{
- link = createLink('project', 'build', 'type=product¶m=' + productID);
+ link = createLink('project', 'build', 'projectID=' + projectID + '&type=product¶m=' + productID);
location.href = link;
}
diff --git a/module/project/view/build.html.php b/module/project/view/build.html.php
index 8c68de6b57..6ceca83724 100644
--- a/module/project/view/build.html.php
+++ b/module/project/view/build.html.php
@@ -75,16 +75,16 @@
createLink('build', 'view', "buildID=$build->id&type=story&link=true"), "", '', "class='btn' title='{$lang->build->linkStory}'");
+ echo html::a($this->createLink('build', 'view', "buildID=$build->id&type=story&link=true"), "", '', "class='btn' title='{$lang->build->linkStory}' data-app='project'");
}
- common::printIcon('testtask', 'create', "product=$build->product&project={$build->execution}&build=$build->id", $build, 'list', 'bullhorn');
+ common::printIcon('testtask', 'create', "product=$build->product&executionID={$build->execution}&build=$build->id&projectID=$projectID", $build, 'list', 'bullhorn', '', '', '', "data-app='execution'");
$lang->project->bug = $lang->execution->viewBug;
- common::printIcon('project', 'bug', "project={$build->execution}&orderBy=status&build=$build->id", $build, 'list');
+ common::printIcon('execution', 'bug', "project={$build->execution}&orderBy=status&build=$build->id", $build, 'list', '', '', '', '', "data-app='execution'");
common::printIcon('build', 'edit', "buildID=$build->id", $build, 'list');
if(common::hasPriv('build', 'delete', $build))
{
$deleteURL = $this->createLink('build', 'delete', "buildID=$build->id&confirm=yes");
- echo html::a("javascript:ajaxDelete(\"$deleteURL\", \"buildList\", confirmDelete)", '', '', "class='btn' title='{$lang->build->delete}'");
+ echo html::a("###", '', '', "onclick='ajaxDelete(\"$deleteURL\", \"buildList\", confirmDelete)' class='btn' title='{$lang->build->delete}'");
}
?>
diff --git a/module/task/control.php b/module/task/control.php
index 8c2da8f404..716aa93ec3 100644
--- a/module/task/control.php
+++ b/module/task/control.php
@@ -41,7 +41,7 @@ class task extends control
{
commonModel::setAppObjectID('execution', $executionID);
- $executions = $this->execution->getPairs($this->session->PRJ);
+ $executions = $this->execution->getPairs();
$executionID = $this->execution->saveState($executionID, $executions);
$this->execution->getLimitedExecution();
@@ -208,7 +208,7 @@ class task extends control
$this->view->title = $title;
$this->view->position = $position;
$this->view->execution = $execution;
- $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject($this->session->PRJ, 'all', 0, true);
+ $this->view->executions = $this->config->systemMode == 'classic' ? $executions : $this->execution->getByProject(0, 'all', 0, true);
$this->view->task = $task;
$this->view->users = $users;
$this->view->stories = $stories;
@@ -250,7 +250,7 @@ class task extends control
$storyLink = $this->session->storyList ? $this->session->storyList : $this->createLink('execution', 'story', "executionID=$executionID");
/* Set menu. */
- $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $execution->id);
+ $this->execution->setMenu($this->execution->getPairs(), $execution->id);
/* When common task are child tasks, query whether common task are consumed. */
$taskConsumed = 0;
@@ -319,7 +319,7 @@ class task extends control
$this->view->actions = $this->loadModel('action')->getList('task', $taskID);
/* Set menu. */
- $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $this->view->execution->id);
+ $this->execution->setMenu($this->execution->getPairs(), $this->view->execution->id);
$this->view->position[] = html::a($this->createLink('execution', 'browse', "execution={$this->view->task->execution}"), $this->view->execution->name);
}
@@ -394,7 +394,7 @@ class task extends control
$this->view->users = $this->loadModel('user')->getPairs('nodeleted', "{$this->view->task->openedBy},{$this->view->task->canceledBy},{$this->view->task->closedBy}");
$this->view->showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : '';
$this->view->modules = $this->tree->getTaskOptionMenu($this->view->task->execution, 0, 0, $this->view->showAllModule ? 'allModule' : '');
- $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject($this->session->PRJ, 'all', 0, true);
+ $this->view->executions = $this->config->systemMode == 'classic' ? $this->execution->getPairs() : $this->execution->getByProject(0, 'all', 0, true);
$this->display();
}
@@ -447,7 +447,7 @@ class task extends control
if($executionID)
{
$execution = $this->execution->getById($executionID);
- $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $execution->id);
+ $this->execution->setMenu($this->execution->getPairs(), $execution->id);
/* Set modules and members. */
$showAllModule = isset($this->config->task->allModule) ? $this->config->task->allModule : '';
@@ -656,7 +656,7 @@ class task extends control
/* Set menu. */
$execution = $this->execution->getById($task->execution);
- $this->execution->setMenu($this->execution->getPairs($this->session->PRJ), $execution->id);
+ $this->execution->setMenu($this->execution->getPairs(), $execution->id);
$this->executeHooks($taskID);
@@ -1324,7 +1324,7 @@ class task extends control
}
}
- $executions = $this->execution->getPairs($this->session->PRJ);
+ $executions = $this->execution->getPairs();
$this->execution->setMenu($executions, $executionID);
$this->executions = $executions;
diff --git a/module/task/model.php b/module/task/model.php
index 2f2053e347..7bbce65382 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -28,7 +28,6 @@ class taskModel extends model
return false;
}
- $this->getExtraRequiredFields();
$executionID = (int)$executionID;
$taskIdList = array();
$taskFiles = array();
@@ -47,7 +46,7 @@ class taskModel extends model
->setDefault('execution', $executionID)
->setDefault('estimate,left,story', 0)
->setDefault('status', 'wait')
- ->setIF($this->config->systemMode == 'new', 'project', $this->session->PRJ)
+ ->setIF($this->config->systemMode == 'new', 'project', $this->getProjectID($executionID))
->setIF($this->post->estimate != false, 'left', $this->post->estimate)
->setIF($this->post->story != false, 'storyVersion', $this->loadModel('story')->getVersion($this->post->story))
->setDefault('estStarted', '0000-00-00')
@@ -280,8 +279,8 @@ class taskModel extends model
$assignedTo = '';
/* Get task data. */
- $this->getExtraRequiredFields();
$extendFields = $this->getFlowExtendFields();
+ $projectID = $this->getProjectID($executionID);
$data = array();
foreach($tasks->name as $i => $name)
{
@@ -303,7 +302,7 @@ class taskModel extends model
$data[$i]->pri = $tasks->pri[$i];
$data[$i]->estimate = $tasks->estimate[$i];
$data[$i]->left = $tasks->estimate[$i];
- $data[$i]->project = $this->config->systemMode == 'new' ? $this->session->PRJ : 0;
+ $data[$i]->project = $this->config->systemMode == 'new' ? $projectID : 0;
$data[$i]->execution = $executionID;
$data[$i]->estStarted = empty($tasks->estStarted[$i]) ? '0000-00-00' : $tasks->estStarted[$i];
$data[$i]->deadline = empty($tasks->deadline[$i]) ? '0000-00-00' : $tasks->deadline[$i];
@@ -779,8 +778,6 @@ class taskModel extends model
*/
public function update($taskID)
{
- $this->getExtraRequiredFields();
-
$oldTask = $this->getByID($taskID);
if($this->post->estimate < 0 or $this->post->left < 0 or $this->post->consumed < 0)
{
@@ -1872,6 +1869,11 @@ class taskModel extends model
return $this->processTask($task);
}
+ public function getProjectID($executionID = 0)
+ {
+ return $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project');
+ }
+
/**
* Get task list.
*
@@ -2534,7 +2536,7 @@ class taskModel extends model
$datas = $this->processData4Report($tasks, '', 'execution');
- $executions = $this->loadModel('execution')->getPairs($this->session->PRJ, 'all', 'all');
+ $executions = $this->loadModel('execution')->getPairs(0, 'all', 'all');
foreach($datas as $executionID => $data)
{
$data->name = isset($executions[$executionID]) ? $executions[$executionID] : $this->lang->report->undefined;
@@ -3250,21 +3252,4 @@ class taskModel extends model
}
return $members;
}
-
- /**
- * Get additional required fields.
- *
- * @access public
- * @return void
- */
- public function getExtraRequiredFields()
- {
- /* Add required fields to waterfall execution. */
- $execution = $this->loadModel('project')->getByID($this->session->PRJ);
- if(!empty($execution) && $execution->model == 'waterfall')
- {
- $this->config->task->create->requiredFields .= ',estStarted,deadline';
- $this->config->task->edit->requiredFields .= ',estStarted,deadline';
- }
- }
}
diff --git a/module/testcase/control.php b/module/testcase/control.php
index 996f94a9c2..a679d4ba53 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -374,6 +374,11 @@ class testcase extends control
$modules = $this->tree->getAllChildID($modules);
}
$stories = $this->story->getProductStoryPairs($productID, $branch, $modules, array_keys($storyStatus), 'id_desc', 50, 'null', 'story', false);
+ if($this->app->openApp != 'qa')
+ {
+ $projectID = $this->app->openApp == 'project' ? $this->session->PRJ : $this->session->execution;
+ $stories = $this->story->getExecutionStoryPairs($projectID, $productID, $branch);
+ }
if($storyID and !isset($stories[$storyID])) $stories = $this->story->formatStories(array($storyID => $story)) + $stories;//Fix bug #2406.
/* Set custom. */
diff --git a/module/testcase/model.php b/module/testcase/model.php
index b30bfef98b..125ee96e4d 100644
--- a/module/testcase/model.php
+++ b/module/testcase/model.php
@@ -285,7 +285,7 @@ class testcaseModel extends model
->leftJoin(TABLE_PROJECTSTORY)->alias('t3')->on('t3.story=t2.story')
->leftJoin(TABLE_STORY)->alias('t4')->on('t3.story=t4.id')
->where('t2.product')->eq((int)$productID)
- ->beginIF($this->lang->navGroup->testcase != 'qa')->andWhere('t1.project')->eq($this->session->PRJ)->fi()
+ ->beginIF($this->app->openApp == 'project')->andWhere('t1.project')->eq($this->session->PRJ)->fi()
->beginIF($branch)->andWhere('t2.branch')->eq($branch)->fi()
->beginIF($moduleIdList)->andWhere('t2.module')->in($moduleIdList)->fi()
->beginIF($browseType == 'wait')->andWhere('t2.status')->eq($browseType)->fi()
diff --git a/module/testtask/control.php b/module/testtask/control.php
index 6310d2e720..6e4dffb9d2 100644
--- a/module/testtask/control.php
+++ b/module/testtask/control.php
@@ -186,7 +186,7 @@ class testtask extends control
* @access public
* @return void
*/
- public function create($productID, $executionID = 0, $build = 0)
+ public function create($productID, $executionID = 0, $build = 0, $projectID = 0)
{
if(!empty($_POST))
{
@@ -200,7 +200,6 @@ class testtask extends control
/* Create testtask from testtask of test.*/
$productID = $productID ? $productID : key($this->products);
- $projectID = $this->lang->navGroup->testtask == 'qa' ? 0 : $this->session->PRJ;
$executions = empty($productID) ? array() : $this->product->getExecutionPairsByProduct($productID, 0, 'id_desc', $projectID);
$builds = empty($productID) ? array() : $this->loadModel('build')->getProductBuildPairs($productID, 0, 'notrunk', true);