From a7533f722defad02952c5b86b0a95b7a533d9ac6 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Thu, 12 Nov 2020 10:09:16 +0800 Subject: [PATCH] * Finish task #8194. --- module/bug/model.php | 6 ++--- module/bug/view/view.html.php | 2 +- module/build/control.php | 2 +- module/common/model.php | 10 ++++---- module/doc/view/browse.html.php | 4 +-- module/doc/view/objectlibs.html.php | 2 +- module/my/view/bug.html.php | 6 ++--- module/my/view/story.html.php | 12 ++++----- module/my/view/task.html.php | 6 ++--- module/my/view/testcase.html.php | 10 ++++---- module/productplan/control.php | 2 +- module/productplan/view/browse.html.php | 4 +-- module/project/view/bug.html.php | 6 ++--- module/project/view/build.html.php | 2 +- module/project/view/story.html.php | 6 ++--- module/project/view/testtask.html.php | 6 ++--- module/release/view/browse.html.php | 4 +-- module/release/view/view.html.php | 34 ++++++++++++------------- module/story/model.php | 6 ++--- module/story/view/view.html.php | 2 +- module/task/view/view.html.php | 2 +- module/testcase/model.php | 6 ++--- module/testreport/view/browse.html.php | 2 +- module/testreport/view/view.html.php | 2 +- module/testsuite/control.php | 2 +- module/testtask/control.php | 4 +-- module/testtask/view/view.html.php | 2 +- 27 files changed, 76 insertions(+), 76 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 57fee78580..591ae77458 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2501,7 +2501,7 @@ class bugModel extends model public function printCell($col, $bug, $users, $builds, $branches, $modulePairs, $projects = array(), $plans = array(), $stories = array(), $tasks = array(), $mode = 'datatable') { /* Check the product is closed. */ - $isClosedProject = common::checkParentObjectClosed('bug', $bug); + $changeAllowed = common::checkObjectChangeAllowed('bug', $bug); $canBatchEdit = common::hasPriv('bug', 'batchEdit'); $canBatchConfirm = common::hasPriv('bug', 'batchConfirm'); @@ -2572,7 +2572,7 @@ class bugModel extends model case 'id': if($canBatchAction) { - $disabled = $isClosedProject ? 'disabled' : ''; + $disabled = $changeAllowed ? '' : 'disabled'; echo html::checkbox('bugIDList', array($bug->id => ''), '', $disabled) . html::a(helper::createLink('bug', 'view', "bugID=$bug->id"), sprintf('%03d', $bug->id)); } else @@ -2724,7 +2724,7 @@ class bugModel extends model echo substr($bug->lastEditedDate, 5, 11); break; case 'actions': - if(!$isClosedProject) + if($changeAllowed) { $params = "bugID=$bug->id"; common::printIcon('bug', 'confirmBug', $params, $bug, 'list', 'confirm', '', 'iframe', true); diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 3cee72fc05..a79713b707 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -58,7 +58,7 @@ fetch('file', 'printFiles', array('files' => $bug->files, 'fieldset' => 'true', 'object' => $bug));?> - createLink('action', 'comment', "objectType=bug&objectID=$bug->id");?> + createLink('action', 'comment', "objectType=bug&objectID=$bug->id");?> printExtendFields($bug, 'div', "position=left&inForm=0&inCell=1");?>
diff --git a/module/build/control.php b/module/build/control.php index 36f4ea9d61..ee60eb135f 100644 --- a/module/build/control.php +++ b/module/build/control.php @@ -213,7 +213,7 @@ class build extends control if(!$build) die(js::error($this->lang->notFound) . js::locate('back')); /* Determines whether an object is editable. */ - $changeAllowed = !common::checkParentObjectClosed('build', $build); + $changeAllowed = common::checkObjectChangeAllowed('build', $build); $product = $this->loadModel('product')->getById($build->product); if($product->type != 'normal') $this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$product->type]); diff --git a/module/common/model.php b/module/common/model.php index 1c3f7efca3..afc4e7fee6 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1490,7 +1490,7 @@ EOD; global $app, $lang; /* Check the parent object is closed. */ - if(commonModel::checkParentObjectClosed($module, $object)) return false; + if(commonModel::checkObjectChangeAllowed($module, $object)) return true; /* Check is the super admin or not. */ if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true; @@ -1850,7 +1850,7 @@ EOD; * @access public * @return bool */ - public static function checkParentObjectClosed($module, $object = null) + public static function checkObjectChangeAllowed($module, $object = null) { global $app, $config; @@ -1859,7 +1859,7 @@ EOD; { $productID = trim($object->product, ','); $product = $app->control->loadModel('product')->getByID($productID); - if($product->status == 'closed') return true; + if($product->status == 'closed') return false; /* Get the projects associated with the story. */ if($module == 'story' and empty($object->project)) @@ -1879,11 +1879,11 @@ EOD; $projects = $app->control->loadModel('project')->getByIDList($projectIDList); foreach($projects as $project) { - if($project->status == 'closed') return true; + if($project->status == 'closed') return false; } } - return false; + return true; } /** diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 599d5c4418..67417d0e2e 100644 --- a/module/doc/view/browse.html.php +++ b/module/doc/view/browse.html.php @@ -42,7 +42,7 @@ var browseType = ''; ", '', "title='{$lang->doc->browseTypeList['grid']}' class='btn btn-icon'");?> ", '', "title='{$lang->doc->browseTypeList['list']}' class='btn btn-icon text-primary'");?> - +