diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index 3a4c9ba8be..def7c07de0 100755 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -197,6 +197,8 @@ $lang->action->label->changestatus = '修改状态'; $lang->action->label->marked = '编辑了'; $lang->action->label->linked2project = "关联{$lang->executionCommon}"; $lang->action->label->unlinkedfromproject = "移除{$lang->executionCommon}"; +$lang->action->label->linked2prj = "关联项目"; +$lang->action->label->unlinkedfromprj = "移除项目"; $lang->action->label->unlinkedfrombuild = "移除版本"; $lang->action->label->linked2release = "关联发布"; $lang->action->label->unlinkedfromrelease = "移除发布"; @@ -492,6 +494,8 @@ $lang->action->search->label['changestatus'] = $lang->action->label->chan $lang->action->search->label['marked'] = $lang->action->label->marked; $lang->action->search->label['linked2project'] = $lang->action->label->linked2project; $lang->action->search->label['unlinkedfromproject'] = $lang->action->label->unlinkedfromproject; +$lang->action->search->label['linked2prj'] = $lang->action->label->linked2prj; +$lang->action->search->label['unlinkedfromprj'] = $lang->action->label->unlinkedfromprj; $lang->action->search->label['started'] = $lang->action->label->started; $lang->action->search->label['restarted'] = $lang->action->label->restarted; $lang->action->search->label['recordestimate'] = $lang->action->label->recordestimate; diff --git a/module/action/model.php b/module/action/model.php index f8b735abb6..5c1dc4bbb5 100755 --- a/module/action/model.php +++ b/module/action/model.php @@ -243,6 +243,12 @@ class actionModel extends model $name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('project', 'story', "projectID=$action->extra"), $name) : $name; } + elseif($actionName == 'linked2prj') + { + $name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); + $productID = trim($action->product, ','); + if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('projectstory', 'story', "productID=$productID"), $name) : $name; + } elseif($actionName == 'linked2plan') { $title = $this->dao->select('title')->from(TABLE_PRODUCTPLAN)->where('id')->eq($action->extra)->fetch('title'); @@ -277,6 +283,12 @@ class actionModel extends model $name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('project', 'story', "projectID=$action->extra"), "#$action->extra " . $name) : "#$action->extra " . $name; } + elseif($actionName == 'unlinkedfromprj') + { + $name = $this->dao->select('name')->from(TABLE_PROJECT)->where('id')->eq($action->extra)->fetch('name'); + $productID = trim($action->product, ','); + if($name) $action->extra = common::hasPriv('project', 'story') ? html::a(helper::createLink('projectstory', 'story', "productID=$productID"), "#$action->extra " . $name) : "#$action->extra " . $name; + } elseif($actionName == 'unlinkedfrombuild') { $name = $this->dao->select('name')->from(TABLE_BUILD)->where('id')->eq($action->extra)->fetch('name'); diff --git a/module/project/control.php b/module/project/control.php index 52ccbcb04c..eba62473fe 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -2756,6 +2756,7 @@ class project extends control } $planStories = array_keys($planStory); $this->project->linkStory($projectID, $planStories, $planProducts); + if($projectID != $this->session->PRJ) $this->project->linkStory($this->session->PRJ, $planStories, $planProducts); } $moduleName = 'project'; diff --git a/module/project/model.php b/module/project/model.php index db1dca2336..e4464fcaa3 100644 --- a/module/project/model.php +++ b/module/project/model.php @@ -2115,7 +2115,8 @@ class projectModel extends model $data->order = ++$lastOrder; $this->dao->insert(TABLE_PROJECTSTORY)->data($data)->exec(); $this->story->setStage($storyID); - $this->action->create('story', $storyID, 'linked2project', '', $projectID); + $action = $projectID == $this->session->PRJ ? 'linked2prj' : 'linked2project'; + $this->action->create('story', $storyID, $action, '', $projectID); } } diff --git a/module/story/control.php b/module/story/control.php index 0c1a6748b0..2eb271a05b 100644 --- a/module/story/control.php +++ b/module/story/control.php @@ -134,6 +134,12 @@ class story extends control } $actionID = $this->action->create('story', $storyID, $action, '', $extra); + if($projectID != 0) + { + if($projectID != $this->session->PRJ) $this->loadModel('action')->create('story', $storyID, 'linked2project', '', $projectID); + $this->loadModel('action')->create('story', $storyID, 'linked2prj', '', $this->session->PRJ); + } + if($todoID > 0) { $this->dao->update(TABLE_TODO)->set('status')->eq('done')->where('id')->eq($todoID)->exec(); @@ -169,7 +175,7 @@ class story extends control setcookie('storyModuleParam', 0, 0, $this->config->webRoot, '', false, true); $project = $this->dao->findById((int)$projectID)->from(TABLE_PROJECT)->fetch(); $moduleName = $project->type == 'project' ? 'projectstory' : 'project'; - $param = $project->type == 'project' ? "PRJ=$projectID" : "projectID=$projectID&orderBy=id_desc&browseType=unclosed"; + $param = $project->type == 'project' ? "productID=$productID" : "projectID=$projectID&orderBy=id_desc&browseType=unclosed"; $response['locate'] = $this->createLink($moduleName, 'story', $param); } if($this->app->getViewType() == 'xhtml') $response['locate'] = $this->createLink('story', 'view', "storyID=$storyID"); diff --git a/module/story/lang/zh-cn.php b/module/story/lang/zh-cn.php index fb853a5f34..4f406a6180 100644 --- a/module/story/lang/zh-cn.php +++ b/module/story/lang/zh-cn.php @@ -279,6 +279,8 @@ $lang->story->action->linked2plan = array('main' => '$date, 由 $lang->story->action->unlinkedfromplan = array('main' => '$date, 由 $actor 从计划 $extra 移除。'); $lang->story->action->linked2project = array('main' => '$date, 由 $actor 关联到' . $lang->executionCommon . ' $extra。'); $lang->story->action->unlinkedfromproject = array('main' => '$date, 由 $actor 从' . $lang->executionCommon . ' $extra 移除。'); +$lang->story->action->linked2prj = array('main' => '$date, 由 $actor 关联到项目 $extra。'); +$lang->story->action->unlinkedfromprj = array('main' => '$date, 由 $actor 从项目 $extra 移除。'); $lang->story->action->linked2build = array('main' => '$date, 由 $actor 关联到版本 $extra。'); $lang->story->action->unlinkedfrombuild = array('main' => '$date, 由 $actor 从版本 $extra 移除。'); $lang->story->action->linked2release = array('main' => '$date, 由 $actor 关联到发布 $extra。');