diff --git a/module/bug/control.php b/module/bug/control.php
index 23103be3ca..f7e54492da 100755
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -1147,6 +1147,7 @@ class bug extends control
$assignedToList = array_filter($assignedToList);
if(empty($assignedToList)) $assignedToList = $this->user->getPairs('devfirst|noclosed');
}
+ if($bug->status == 'closed') $assignedToList['closed'] = 'Closed';
$this->view->bug = $bug;
$this->view->productID = $productID;
diff --git a/module/bug/model.php b/module/bug/model.php
index 80ff5ef43c..d68d6e40da 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -1688,7 +1688,7 @@ class bugModel extends model
$query = preg_replace('/`(\w+)`/', 't1.`$1`', $query);
if($type != 'bySearch' and !$this->loadModel('common')->checkField(TABLE_BUG, $type)) return array();
- $bugs = $this->dao->select('t1.*,t2.name as productName')->from(TABLE_BUG)->alias('t1')
+ return $this->dao->select('t1.*,t2.name as productName')->from(TABLE_BUG)->alias('t1')
->leftJoin(TABLE_PRODUCT)->alias('t2')->on('t1.product = t2.id')
->where('t1.deleted')->eq(0)
->beginIF($type == 'bySearch')->andWhere($query)->fi()
@@ -1697,6 +1697,7 @@ class bugModel extends model
->beginIF($type != 'all' and $type != 'bySearch')->andWhere("t1.`$type`")->eq($account)->fi()
->beginIF($type == 'bySearch' and $moduleName == 'workBug')->andWhere("t1.assignedTo")->eq($account)->fi()
->beginIF($type == 'bySearch' and $moduleName == 'contributeBug')
+ ->beginIF($type == 'assignedTo' and $moduleName == 'workBug')->andWhere('t1.status')->ne('closed')->fi()
->andWhere('t1.openedBy', 1)->eq($account)
->orWhere('t1.closedBy')->eq($account)
->orWhere('t1.resolvedBy')->eq($account)
@@ -1707,7 +1708,6 @@ class bugModel extends model
->beginIF($limit > 0)->limit($limit)->fi()
->page($pager)
->fetchAll();
- return $bugs ? $bugs : array();
}
/**
diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php
index 2d434fa2d0..48a26082c2 100644
--- a/module/common/view/datatable.fix.html.php
+++ b/module/common/view/datatable.fix.html.php
@@ -24,12 +24,6 @@ $(function()
{
$dropmenu.append("
moduleName . '&method=' . $this->methodName . '&extra=requirement')?>' data-toggle='modal' data-type='ajax'>datatable->custom?>");
}
- else if(typeof(from) != 'undefined')
- {
-
-
- $dropmenu.append("moduleName . '&method=' . $this->methodName . "&extra=$fromPage")?>' data-toggle='modal' data-type='ajax'>datatable->custom?>");
- }
else
{
$dropmenu.append("moduleName . '&method=' . $this->methodName)?>' data-toggle='modal' data-type='ajax'>datatable->custom?>");
diff --git a/module/datatable/control.php b/module/datatable/control.php
index 1f2ba3a0c1..8c2b0c4886 100644
--- a/module/datatable/control.php
+++ b/module/datatable/control.php
@@ -99,18 +99,6 @@ class datatable extends control
unset($cols['caseCount']);
}
- if($module == 'execution' and $method == 'all')
- {
- if($extra == 'execution' or $extra == 'project')
- {
- unset($cols['percent']);
- unset($cols['attribute']);
- unset($cols['actions']);
- }
-
- if($extra == 'project' or $extra == 'stage') unset($cols['project']);
- }
-
$this->view->cols = $cols;
$this->view->setting = $setting;
$this->display();
diff --git a/module/execution/config.php b/module/execution/config.php
index a79943e81e..8f369cf79f 100644
--- a/module/execution/config.php
+++ b/module/execution/config.php
@@ -141,11 +141,11 @@ $config->execution->gantt->linkType['begin']['end'] = 3;
$config->execution->datatable = new stdclass();
if(!isset($config->setCode) or $config->setCode == 1)
{
- $config->execution->datatable->defaultField = array('id', 'name', 'code', 'project', 'PM', 'status', 'progress', 'percent', 'attribute', 'begin', 'end', 'estimate', 'consumed', 'left', 'burn', 'actions');
+ $config->execution->datatable->defaultField = array('id', 'name', 'code', 'project', 'PM', 'status', 'progress', 'begin', 'end', 'estimate', 'consumed', 'left', 'burn');
}
else
{
- $config->execution->datatable->defaultField = array('id', 'name', 'project', 'PM', 'status', 'progress', 'percent', 'attribute', 'begin', 'end', 'estimate', 'consumed', 'left', 'burn', 'actions');
+ $config->execution->datatable->defaultField = array('id', 'name', 'project', 'PM', 'status', 'progress', 'begin', 'end', 'estimate', 'consumed', 'left', 'burn');
}
$config->execution->datatable->fieldList['id']['title'] = 'idAB';
@@ -187,18 +187,6 @@ $config->execution->datatable->fieldList['progress']['width'] = '70';
$config->execution->datatable->fieldList['progress']['required'] = 'no';
$config->execution->datatable->fieldList['progress']['sort'] = 'no';
-$config->execution->datatable->fieldList['percent']['title'] = 'percent';
-$config->execution->datatable->fieldList['percent']['fixed'] = 'no';
-$config->execution->datatable->fieldList['percent']['width'] = '85';
-$config->execution->datatable->fieldList['percent']['required'] = 'no';
-$config->execution->datatable->fieldList['percent']['sort'] = 'no';
-
-$config->execution->datatable->fieldList['attribute']['title'] = 'attribute';
-$config->execution->datatable->fieldList['attribute']['fixed'] = 'no';
-$config->execution->datatable->fieldList['attribute']['width'] = '80';
-$config->execution->datatable->fieldList['attribute']['required'] = 'no';
-$config->execution->datatable->fieldList['attribute']['sort'] = 'no';
-
$config->execution->datatable->fieldList['openedDate']['title'] = 'openedDate';
$config->execution->datatable->fieldList['openedDate']['fixed'] = 'no';
$config->execution->datatable->fieldList['openedDate']['width'] = '85';
@@ -249,9 +237,3 @@ $config->execution->datatable->fieldList['burn']['fixed'] = 'no';
$config->execution->datatable->fieldList['burn']['width'] = '80';
$config->execution->datatable->fieldList['burn']['required'] = 'no';
$config->execution->datatable->fieldList['burn']['sort'] = 'no';
-
-$config->execution->datatable->fieldList['actions']['title'] = 'actions';
-$config->execution->datatable->fieldList['actions']['fixed'] = 'right';
-$config->execution->datatable->fieldList['actions']['width'] = '180';
-$config->execution->datatable->fieldList['actions']['required'] = 'yes';
-$config->execution->datatable->fieldList['actions']['sort'] = 'no';
diff --git a/module/execution/view/all.html.php b/module/execution/view/all.html.php
index b1aa1a8181..2cca80f2ba 100644
--- a/module/execution/view/all.html.php
+++ b/module/execution/view/all.html.php
@@ -104,39 +104,11 @@ js::set('isCNLang', !$this->loadModel('common')->checkNotCN())
$value)
- {
- if($value->id == 'actions')
- {
- $hasActions = true;
- $value->show = true;
- }
- }
-
- if(!$hasActions)
- {
- $data = new stdclass();
- $data->id = 'actions';
- $data->order = $value->order + 1;
- $data->show = true;
- $data->width = '180px';
- $data->fixed = 'right';
- $data->title = $lang->actions;
- $data->sort = 'no';
-
- $setting[] = $data;
- }
- }
-
foreach($setting as $key => $value)
{
if($value->show)
{
- if(!$isStage and in_array($value->id, array('percent', 'attribute', 'actions'))) continue;
- if(($config->systemMode == 'classic' or ($config->systemMode == 'new' and $this->app->tab != 'execution')) and $value->id == 'project') continue;
+ if($config->systemMode == 'classic' and $value->id == 'project') continue;
$this->datatable->printHead($value, $orderBy, $vars, $canBatchEdit);
$columns ++;
diff --git a/module/project/control.php b/module/project/control.php
index 50dd26bc59..bc677940db 100644
--- a/module/project/control.php
+++ b/module/project/control.php
@@ -1835,16 +1835,17 @@ class project extends control
* Delete a project.
*
* @param int $projectID
- * @param string $from
+ * @param string $confirm
+ * @param string $from browse|view
* @access public
* @return void
*/
- public function delete($projectID, $confirm = 'no')
+ public function delete($projectID, $confirm = 'no', $from = 'browse')
{
if($confirm == 'no')
{
$project = $this->project->getByID($projectID);
- return print(js::confirm(sprintf($this->lang->project->confirmDelete, $project->name), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes")));
+ return print(js::confirm(sprintf($this->lang->project->confirmDelete, $project->name), $this->createLink('project', 'delete', "projectID=$projectID&confirm=yes&from=$from")));
}
else
{
@@ -1858,16 +1859,14 @@ class project extends control
/* Delete the execution under the project. */
$executionIdList = $this->loadModel('execution')->getByProject($projectID);
- $url = $this->createLink('project', 'browse');
- if($this->app->tab == 'program') $url = $this->createLink('program', 'browse');
-
$message = $this->executeHooks($projectID);
if($message) $this->lang->saveSuccess = $message;
if(empty($executionIdList))
{
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
- return print(js::locate($url, 'parent'));
+ if($from == 'view') return print(js::locate($this->createLink('project', 'browse'), 'parent'));
+ return print(js::reload('parent'));
}
$this->dao->update(TABLE_EXECUTION)->set('deleted')->eq(1)->where('id')->in(array_keys($executionIdList))->exec();
@@ -1877,7 +1876,8 @@ class project extends control
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess));
$this->session->set('project', '');
- return print(js::locate($url, 'parent'));
+ if($from == 'view') return print(js::locate($this->createLink('project', 'browse'), 'parent'));
+ return print(js::reload('parent'));
}
}
diff --git a/module/project/model.php b/module/project/model.php
index 845972b515..c51c9732fe 100644
--- a/module/project/model.php
+++ b/module/project/model.php
@@ -2751,8 +2751,8 @@ class projectModel extends model
$menu .= $this->buildFlowMenu('project', $project, 'view', 'direct');
$menu .= "";
- $menu .= $this->buildMenu('project', 'edit', "project=$project->id&from=view", $project, 'button', 'edit', '', '', '', '', $this->lang->edit);
- $menu .= $this->buildMenu('project', 'delete', "project=$project->id", $project, 'button', 'trash', 'hiddenwin', '', '', '', $this->lang->delete);
+ $menu .= $this->buildMenu('project', 'edit', "project=$project->id&from=view", $project, 'button', 'edit', '', '', '', '', $this->lang->edit);
+ $menu .= $this->buildMenu('project', 'delete', "project=$project->id&confirm=no&from=view", $project, 'button', 'trash', 'hiddenwin', '', '', '', $this->lang->delete);
return $menu;
}
diff --git a/module/task/model.php b/module/task/model.php
index 857e6eef83..6e4bbfd708 100644
--- a/module/task/model.php
+++ b/module/task/model.php
@@ -2517,6 +2517,7 @@ class taskModel extends model
->beginIF($type == 'assignedTo' and ($this->app->rawModule == 'my' or $this->app->rawModule == 'block'))->andWhere('t2.status', true)->ne('suspended')->orWhere('t4.status')->ne('suspended')->markRight(1)->fi()
->beginIF($type != 'all' and $type != 'finishedBy' and $type != 'assignedTo')->andWhere("t1.`$type`")->eq($account)->fi()
->beginIF($type == 'assignedTo')->andWhere("(t1.assignedTo = '{$account}' or (t1.mode = 'multi' and t5.`account` = '{$account}') )")->fi()
+ ->beginIF($type == 'assignedTo' and $this->app->rawModule == 'my' and $this->app->rawMethod == 'work')->andWhere('t1.status')->ne('closed')->fi()
->orderBy($orderBy)
->beginIF($limit > 0)->limit($limit)->fi()
->page($pager)
diff --git a/module/testcase/control.php b/module/testcase/control.php
index ce43238469..3af8e4fe59 100644
--- a/module/testcase/control.php
+++ b/module/testcase/control.php
@@ -910,13 +910,16 @@ class testcase extends control
$branchTagOption[$case->branch] = $case->branch == BRANCH_MAIN ? $caseBranch : ($caseBranch->name . ($caseBranch->status == 'closed' ? ' (' . $this->lang->branch->statusList['closed'] . ')' : ''));
}
+ $moduleIdList = $case->module;
+ if($case->module) $moduleIdList = $this->tree->getAllChildID($case->module);
+
$this->view->productID = $productID;
$this->view->product = $product;
$this->view->products = $this->products;
$this->view->branchTagOption = $branchTagOption;
$this->view->productName = $this->products[$productID];
$this->view->moduleOptionMenu = $moduleOptionMenu;
- $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch, 0, 'all','id_desc', 0, 'full', 'story', false);
+ $this->view->stories = $this->story->getProductStoryPairs($productID, $case->branch, $moduleIdList, 'all','id_desc', 0, 'full', 'story', false);
}
$forceNotReview = $this->testcase->forceNotReview();
if($forceNotReview) unset($this->lang->testcase->statusList['wait']);
diff --git a/module/testcase/js/batchedit.js b/module/testcase/js/batchedit.js
index e82c364e91..e934894af4 100644
--- a/module/testcase/js/batchedit.js
+++ b/module/testcase/js/batchedit.js
@@ -99,7 +99,7 @@ $(function()
var id = $(this).attr('id');
var num = id.substring(5);
var moduleID = $('#modules' + num).val();
- var branchID = $('#branches' + num).val();
+ var branchID = typeof($('#branches' + num).val()) == 'undefined' ? 0 : $('#branches' + num).val();
var storyID = $("#story" + num).val();
var storyLink = createLink('story', 'ajaxGetProductStories', 'productID=' + productID + '&branch=' + branchID + '&moduleID=' + moduleID + '&storyID=0&onlyOption=false&status=noclosed&limit=50&type=full&hasParent=1&executionID=0&number=' + num);
$.get(storyLink, function(stories)