diff --git a/module/bug/control.php b/module/bug/control.php
index 65a3f1e459..528b8d46b5 100644
--- a/module/bug/control.php
+++ b/module/bug/control.php
@@ -455,6 +455,7 @@ class bug extends control
{
$builds = $this->loadModel('build')->getExecutionBuildPairs($executionID, $productID, $branch, 'noempty,noterminate,nodone');
$stories = $this->story->getExecutionStoryPairs($executionID);
+ if(!$projectID) $projectID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($executionID)->fetch('project');
}
else
{
@@ -496,6 +497,18 @@ class bug extends control
$projects += $this->product->getProjectPairsByProduct($productID, $branch);
}
+ /* Get block id of assinge to me. */
+ $blockID = 0;
+ if(isonlybody())
+ {
+ $blockID = $this->dao->select('id')->from(TABLE_BLOCK)
+ ->where('block')->eq('assingtome')
+ ->andWhere('module')->eq('my')
+ ->andWhere('account')->eq($this->app->user->account)
+ ->orderBy('order_desc')
+ ->fetch('id');
+ }
+
/* Get executions. */
$executions = array('' => '');
if(isset($projects[$projectID])) $executions += $this->product->getExecutionPairsByProduct($productID, $branch ? "0,$branch" : 0, 'id_desc', $projectID);
@@ -541,6 +554,7 @@ class bug extends control
$this->view->type = $type;
$this->view->branch = $branch;
$this->view->branches = $branches;
+ $this->view->blockID = $blockID;
$this->view->color = $color;
$this->view->stepsRequired = strpos($this->config->bug->create->requiredFields, 'steps');
$this->view->isStepsTemplate = $steps == $this->lang->bug->tplStep . $this->lang->bug->tplResult . $this->lang->bug->tplExpect ? true : false;
diff --git a/module/bug/js/create.js b/module/bug/js/create.js
index aa402fd61a..1e6ce04b0c 100644
--- a/module/bug/js/create.js
+++ b/module/bug/js/create.js
@@ -144,3 +144,7 @@ $(function()
}
});
});
+
+$(window).unload(function(){
+ if(blockID) window.parent.refreshBlock($('#block' + blockID));
+});
diff --git a/module/bug/view/create.html.php b/module/bug/view/create.html.php
index d42be5ddbd..ec63fba5a6 100644
--- a/module/bug/view/create.html.php
+++ b/module/bug/view/create.html.php
@@ -24,6 +24,7 @@ js::set('stepsRequired', $stepsRequired);
js::set('stepsNotEmpty', $lang->bug->stepsNotEmpty);
js::set('isStepsTemplate', $isStepsTemplate);
js::set('oldProjectID', $projectID);
+js::set('blockID', $blockID);
?>
diff --git a/module/story/control.php b/module/story/control.php
index bef59542f5..b458382484 100644
--- a/module/story/control.php
+++ b/module/story/control.php
@@ -267,6 +267,18 @@ class story extends control
}
}
+ /* Get block id of assinge to me. */
+ $blockID = 0;
+ if(isonlybody())
+ {
+ $blockID = $this->dao->select('id')->from(TABLE_BLOCK)
+ ->where('block')->eq('assingtome')
+ ->andWhere('module')->eq('my')
+ ->andWhere('account')->eq($this->app->user->account)
+ ->orderBy('order_desc')
+ ->fetch('id');
+ }
+
/* Set Custom. */
foreach(explode(',', $this->config->story->list->customCreateFields) as $field) $customFields[$field] = $this->lang->story->$field;
$this->view->customFields = $customFields;
@@ -297,6 +309,7 @@ class story extends control
$this->view->verify = $verify;
$this->view->keywords = $keywords;
$this->view->mailto = $mailto;
+ $this->view->blockID = $blockID;
$this->view->URS = $type == 'story' ? $this->story->getRequierements($productID) : '';
$this->view->needReview = ($this->app->user->account == $product->PO || $executionID > 0 || $this->config->story->needReview == 0) ? "checked='checked'" : "";
$this->view->type = $type;
diff --git a/module/story/js/create.js b/module/story/js/create.js
index 22cce69ff6..dcd3dd2c56 100644
--- a/module/story/js/create.js
+++ b/module/story/js/create.js
@@ -21,3 +21,7 @@ function refreshPlan()
{
$('a.refresh').click();
}
+
+$(window).unload(function(){
+ if(blockID) window.parent.refreshBlock($('#block' + blockID));
+});
diff --git a/module/story/view/create.html.php b/module/story/view/create.html.php
index 04fdee8ca2..8e367acfbe 100644
--- a/module/story/view/create.html.php
+++ b/module/story/view/create.html.php
@@ -12,6 +12,7 @@
?>
story->placeholder); ?>
+
diff --git a/module/task/control.php b/module/task/control.php
index 716aa93ec3..8b03e21a5a 100644
--- a/module/task/control.php
+++ b/module/task/control.php
@@ -192,6 +192,18 @@ class task extends control
}
$stories = $this->story->getExecutionStoryPairs($executionID, 0, 0, $moduleIdList, 'full', 'unclosed');
+ /* Get block id of assinge to me. */
+ $blockID = 0;
+ if(isonlybody())
+ {
+ $blockID = $this->dao->select('id')->from(TABLE_BLOCK)
+ ->where('block')->eq('assingtome')
+ ->andWhere('module')->eq('my')
+ ->andWhere('account')->eq($this->app->user->account)
+ ->orderBy('order_desc')
+ ->fetch('id');
+ }
+
$title = $execution->name . $this->lang->colon . $this->lang->task->create;
$position[] = html::a($taskLink, $execution->name);
$position[] = $this->lang->task->common;
@@ -214,6 +226,7 @@ class task extends control
$this->view->stories = $stories;
$this->view->testStoryIdList = $this->loadModel('story')->getTestStories(array_keys($stories), $execution->id);
$this->view->members = $members;
+ $this->view->blockID = $blockID;
$this->view->moduleOptionMenu = $moduleOptionMenu;
$this->display();
}
diff --git a/module/task/js/create.js b/module/task/js/create.js
index 84453be652..3eaad47266 100644
--- a/module/task/js/create.js
+++ b/module/task/js/create.js
@@ -474,3 +474,7 @@ $('#modalTeam .btn').click(function()
$('#estimate').val(time);
})
});
+
+$(window).unload(function(){
+ if(blockID) window.parent.refreshBlock($('#block' + blockID));
+});
diff --git a/module/task/view/create.html.php b/module/task/view/create.html.php
index 90ed3392ba..4786cb8a30 100644
--- a/module/task/view/create.html.php
+++ b/module/task/view/create.html.php
@@ -14,6 +14,7 @@
id));?>
+