From 4943ce7bbe7fe7bd7e23d9f802716b6886cb0113 Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 17 Nov 2020 15:25:16 +0800 Subject: [PATCH] * Finish task #8387. --- module/bug/model.php | 2 +- module/bug/view/view.html.php | 2 +- module/build/control.php | 2 +- module/common/model.php | 6 +++--- module/doc/model.php | 2 +- module/doc/view/browse.html.php | 6 +++--- module/doc/view/browsebygrid.html.php | 4 ++-- module/doc/view/view.html.php | 2 +- module/my/view/bug.html.php | 2 +- module/my/view/story.html.php | 2 +- module/my/view/task.html.php | 2 +- module/my/view/testcase.html.php | 2 +- module/productplan/control.php | 2 +- module/productplan/view/browse.html.php | 2 +- module/project/view/bug.html.php | 2 +- module/project/view/build.html.php | 2 +- module/project/view/treestory.html.php | 2 +- module/project/view/treetask.html.php | 2 +- module/release/view/browse.html.php | 2 +- module/release/view/view.html.php | 2 +- module/story/model.php | 2 +- module/story/view/view.html.php | 2 +- module/task/view/view.html.php | 2 +- module/testcase/model.php | 2 +- module/testcase/view/view.html.php | 2 +- 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 +- 30 files changed, 36 insertions(+), 36 deletions(-) diff --git a/module/bug/model.php b/module/bug/model.php index 887dd0ef67..847b1eac10 100644 --- a/module/bug/model.php +++ b/module/bug/model.php @@ -2508,7 +2508,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. */ - $canBeChanged = common::checkObjectChangeAllowed('bug', $bug); + $canBeChanged = common::canBeChanged('bug', $bug); $canBatchEdit = ($canBeChanged and common::hasPriv('bug', 'batchEdit')); $canBatchConfirm = ($canBeChanged and common::hasPriv('bug', 'batchConfirm')); diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index 540516b9cb..d17743d7d6 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 329160c247..eb8f4f6a2a 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. */ - $canBeChanged = common::checkObjectChangeAllowed('build', $build); + $canBeChanged = common::canBeChanged('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 aed653968a..d26cc7001f 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(strpos('close|batchClose', $method) === false and !commonModel::checkObjectChangeAllowed($module, $object)) return false; + if(strpos('close|batchClose', $method) === false and !commonModel::canBeChanged($module, $object)) return false; /* Check is the super admin or not. */ if(!empty($app->user->admin) || strpos($app->company->admins, ",{$app->user->account},") !== false) return true; @@ -1842,7 +1842,7 @@ EOD; } /** - * Check the parent object is closed. + * Check the object can be changed. * * @param string $module * @param object $object @@ -1850,7 +1850,7 @@ EOD; * @access public * @return bool */ - public static function checkObjectChangeAllowed($module, $object = null) + public static function canBeChanged($module, $object = null) { global $app, $config; diff --git a/module/doc/model.php b/module/doc/model.php index 69c52605e0..c334b329f7 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -111,7 +111,7 @@ class docModel extends model $docLib = new stdClass(); $docLib->product = $productID; $docLib->project = $projectID; - $canBeChanged = common::checkObjectChangeAllowed('doc', $docLib); + $canBeChanged = common::canBeChanged('doc', $docLib); $lib = isset($lib) ? $lib : new stdClass(); $actions = $this->setFastMenu($fastLib); diff --git a/module/doc/view/browse.html.php b/module/doc/view/browse.html.php index 4c0978103c..77a774f54f 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'");?> - +