diff --git a/module/execution/control.php b/module/execution/control.php index 27f9374975..60c0aef0dc 100644 --- a/module/execution/control.php +++ b/module/execution/control.php @@ -2552,21 +2552,26 @@ class execution extends control $userList['closed']->realname = 'Closed'; $userList['closed']->avatar = ''; - $this->view->title = $this->lang->execution->kanban; - $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); - $this->view->storyOrder = $orderBy; - $this->view->orderBy = 'id_asc'; - $this->view->executionID = $executionID; - $this->view->productID = $productID; - $this->view->productNames = $productNames; - $this->view->productNum = count($products); - $this->view->allPlans = $allPlans; - $this->view->browseType = $browseType; - $this->view->kanbanGroup = $kanbanGroup; - $this->view->execution = $execution; - $this->view->groupBy = $groupBy; - $this->view->canBeChanged = $canBeChanged; - $this->view->userList = $userList; + $projectID = $execution->project; + $project = $this->dao->findByID($projectID)->from(TABLE_PROJECT)->fetch(); + $hiddenPlan = $project->model !== 'scrum'; + + $this->view->title = $this->lang->execution->kanban; + $this->view->realnames = $this->loadModel('user')->getPairs('noletter'); + $this->view->storyOrder = $orderBy; + $this->view->orderBy = 'id_asc'; + $this->view->executionID = $executionID; + $this->view->productID = $productID; + $this->view->productNames = $productNames; + $this->view->productNum = count($products); + $this->view->allPlans = $allPlans; + $this->view->browseType = $browseType; + $this->view->kanbanGroup = $kanbanGroup; + $this->view->execution = $execution; + $this->view->groupBy = $groupBy; + $this->view->canBeChanged = $canBeChanged; + $this->view->userList = $userList; + $this->view->hiddenPlan = $hiddenPlan; $this->display(); } diff --git a/module/execution/view/taskkanban.html.php b/module/execution/view/taskkanban.html.php index 82b86be94a..60a3213974 100644 --- a/module/execution/view/taskkanban.html.php +++ b/module/execution/view/taskkanban.html.php @@ -91,7 +91,7 @@ $canCreateStory = ($productID and common::hasPriv('story', 'create')); $canBatchCreateStory = ($productID and common::hasPriv('story', 'batchCreate')); $canLinkStory = ($productID and common::hasPriv('execution', 'linkStory')); - $canLinkStoryByPlan = ($productID and common::hasPriv('execution', 'importplanstories') and !empty($execution->hasProduct)); + $canLinkStoryByPlan = ($productID and common::hasPriv('execution', 'importplanstories') and !$hiddenPlan); $hasStoryButton = ($canCreateStory or $canBatchCreateStory or $canLinkStory or $canLinkStoryByPlan); $hasTaskButton = ($canCreateTask or $canBatchCreateTask or $canImportBug); $hasBugButton = ($canCreateBug or $canBatchCreateBug); diff --git a/module/story/control.php b/module/story/control.php index 1c156248e9..adcc031930 100755 --- a/module/story/control.php +++ b/module/story/control.php @@ -393,6 +393,7 @@ class story extends control if($this->app->tab === 'project' || $this->app->tab === 'execution') { $project = $this->dao->findById((int)$objectID)->from(TABLE_PROJECT)->fetch(); + if(!empty($project->project)) $project = $this->dao->findById((int)$project->project)->from(TABLE_PROJECT)->fetch(); if(empty($project->hasProduct)) { @@ -502,6 +503,7 @@ class story extends control if(in_array($execution->type, array('project', 'kanban', 'stage'), true)) { $project = $this->dao->findById((int)$executionID)->from(TABLE_PROJECT)->fetch(); + if(!empty($project->project)) $project = $this->dao->findById((int)$project->project)->from(TABLE_PROJECT)->fetch(); if(empty($project->hasProduct)) { @@ -862,6 +864,7 @@ class story extends control if($this->app->tab === 'project' || $this->app->tab === 'execution') { $project = $this->dao->findById((int)$objectID)->from(TABLE_PROJECT)->fetch(); + if(!empty($project->project)) $project = $this->dao->findById((int)$project->project)->from(TABLE_PROJECT)->fetch(); if(empty($project->hasProduct)) {