From e9750cfe2661a1a4f068bc18efa27194683a6975 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 16 Nov 2020 11:00:05 +0800 Subject: [PATCH] * Finish task #8194. --- module/project/control.php | 5 +++++ module/project/view/task.html.php | 12 ++++-------- 2 files changed, 9 insertions(+), 8 deletions(-) diff --git a/module/project/control.php b/module/project/control.php index 18b28157d9..70a3bac44c 100644 --- a/module/project/control.php +++ b/module/project/control.php @@ -128,6 +128,10 @@ class project extends control $products = $this->config->global->flow == 'onlyTask' ? array() : $this->loadModel('product')->getProductsByProject($projectID); setcookie('preProjectID', $projectID, $this->config->cookieLife, $this->config->webRoot, '', false, true); + /* Determines whether an object is editable. */ + $changeAllowed = true; + if(!empty($this->config->global->closedProjectStatus) and $project->status == 'closed') $changeAllowed = false; + if($this->cookie->preProjectID != $projectID) { $_COOKIE['moduleBrowseParam'] = $_COOKIE['productBrowseParam'] = 0; @@ -217,6 +221,7 @@ class project extends control $this->view->memberPairs = $memberPairs; $this->view->branchGroups = $this->loadModel('branch')->getByProducts(array_keys($products), 'noempty'); $this->view->setModule = true; + $this->view->changeAllowed = $changeAllowed; $this->display(); } diff --git a/module/project/view/task.html.php b/module/project/view/task.html.php index 1d3a45b21c..3671a0d335 100644 --- a/module/project/view/task.html.php +++ b/module/project/view/task.html.php @@ -136,23 +136,19 @@ js::set('foldAll', $lang->project->treeLevel['root']); - project = $projectID; - ?> createLink('task', 'batchCreate', "project=$projectID" . (isset($moduleID) ? "&storyID=&moduleID=$moduleID" : '')); - if(common::hasPriv('task', 'batchCreate', $checkObject)) echo html::a($link, " {$lang->task->batchCreate}", '', "class='btn btn btn-secondary'"); + if($changeAllowed and common::hasPriv('task', 'batchCreate')) echo html::a($link, " {$lang->task->batchCreate}", '', "class='btn btn btn-secondary'"); $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")); - if(common::hasPriv('task', 'create', $checkObject)) echo html::a($link, " {$lang->task->create}", '', "class='btn btn-primary'"); + if($changeAllowed and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create}", '', "class='btn btn-primary'"); ?> "; $link = $this->createLink('task', 'create', "project=$projectID" . (isset($moduleID) ? "&storyID=0&moduleID=$moduleID" : "")); - if(common::hasPriv('task', 'create', $checkObject)) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); + if($changeAllowed and common::hasPriv('task', 'create')) echo html::a($link, " {$lang->task->create} ", '', "class='btn btn-primary'"); ?>