From bb34dfe79b36cb495a266dc863851a3bcf8e67dc Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Tue, 17 Nov 2020 14:04:50 +0800 Subject: [PATCH] * Finish task #8378. --- module/bug/view/browse.html.php | 6 +++--- module/bug/view/view.html.php | 2 +- module/common/model.php | 4 ++-- module/custom/control.php | 4 ++-- module/custom/lang/de.php | 8 ++++---- module/custom/lang/en.php | 8 ++++---- module/custom/lang/fr.php | 8 ++++---- module/custom/lang/vi.php | 8 ++++---- module/custom/lang/zh-cn.php | 8 ++++---- module/custom/lang/zh-tw.php | 8 ++++---- module/custom/view/product.html.php | 4 ++-- module/custom/view/project.html.php | 4 ++-- module/doc/control.php | 8 ++++---- module/product/view/browse.html.php | 6 +++--- module/product/view/roadmap.html.php | 2 +- module/productplan/view/browse.html.php | 4 ++-- module/release/view/browse.html.php | 4 ++-- module/story/view/view.html.php | 2 +- module/testcase/view/browse.html.php | 2 +- module/testcase/view/caseheader.html.php | 4 ++-- module/testcase/view/groupcase.html.php | 2 +- module/testreport/control.php | 4 ++-- module/testsuite/view/browse.html.php | 4 ++-- module/testtask/view/browse.html.php | 4 ++-- module/testtask/view/browseunits.html.php | 2 +- module/tree/control.php | 4 ++-- 26 files changed, 62 insertions(+), 62 deletions(-) diff --git a/module/bug/view/browse.html.php b/module/bug/view/browse.html.php index 7b7d20c1df..150243cbfc 100644 --- a/module/bug/view/browse.html.php +++ b/module/bug/view/browse.html.php @@ -117,7 +117,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow ?> - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> " . $lang->bug->batchCreate, '', "class='btn btn-secondary'"); @@ -189,7 +189,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow

bug->noBug;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('bug', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('bug', 'create')):?> createLink('bug', 'create', "productID=$productID&branch=$branch&extra=moduleID=$moduleID"), " " . $lang->bug->create, '', "class='btn btn-info'");?>

@@ -211,7 +211,7 @@ $currentBrowseType = isset($lang->bug->mySelects[$browseType]) && in_array($brow $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBeChanged = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBeChanged = (!empty($config->CRProduct) or $product->status != 'closed'); $canBatchEdit = ($canBeChanged and common::hasPriv('bug', 'batchEdit')); $canBatchConfirm = ($canBeChanged and common::hasPriv('bug', 'batchConfirm')); $canBatchClose = common::hasPriv('bug', 'batchClose'); diff --git a/module/bug/view/view.html.php b/module/bug/view/view.html.php index a79713b707..540516b9cb 100644 --- a/module/bug/view/view.html.php +++ b/module/bug/view/view.html.php @@ -30,7 +30,7 @@
- config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> product}&branch={$bug->branch}&extra=moduleID={$bug->module}", "" . $lang->bug->create, '', "class='btn btn-primary'"); ?>
diff --git a/module/common/model.php b/module/common/model.php index ca78684739..aed653968a 100644 --- a/module/common/model.php +++ b/module/common/model.php @@ -1855,7 +1855,7 @@ EOD; global $app, $config; /* Check the product is closed. */ - if(!empty($object->product) and is_numeric($object->product) and !empty($config->global->closedProductStatus)) + if(!empty($object->product) and is_numeric($object->product) and empty($config->CRProduct)) { $productID = trim($object->product, ','); $product = $app->control->loadModel('product')->getByID($productID); @@ -1864,7 +1864,7 @@ EOD; /* Check the project is closed. */ $productModuleList = array('story', 'bug', 'testtask'); - if(!in_array($module, $productModuleList) and !empty($object->project) and is_numeric($object->project) and !empty($config->global->closedProjectStatus)) + if(!in_array($module, $productModuleList) and !empty($object->project) and is_numeric($object->project) and empty($config->CRProject)) { $project = $app->control->loadModel('project')->getByID($object->project); if($project->status == 'closed') return false; diff --git a/module/custom/control.php b/module/custom/control.php index 903b0edf79..0d1ce6e3b9 100644 --- a/module/custom/control.php +++ b/module/custom/control.php @@ -357,7 +357,7 @@ class custom extends control { if($_POST) { - $this->loadModel('setting')->setItem('system.common.global.closedProjectStatus', $this->post->project); + $this->loadModel('setting')->setItem('system.common.CRProject', $this->post->project); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); } @@ -377,7 +377,7 @@ class custom extends control { if($_POST) { - $this->loadModel('setting')->setItem('system.common.global.closedProductStatus', $this->post->product); + $this->loadModel('setting')->setItem('system.common.CRProduct', $this->post->product); $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => 'reload')); } diff --git a/module/custom/lang/de.php b/module/custom/lang/de.php index 6cf9a0d17f..00ca85b3c4 100644 --- a/module/custom/lang/de.php +++ b/module/custom/lang/de.php @@ -153,11 +153,11 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; diff --git a/module/custom/lang/en.php b/module/custom/lang/en.php index d46abe9390..b498f8c401 100644 --- a/module/custom/lang/en.php +++ b/module/custom/lang/en.php @@ -153,11 +153,11 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; diff --git a/module/custom/lang/fr.php b/module/custom/lang/fr.php index 1a3dc44bd5..8553c5fe0e 100644 --- a/module/custom/lang/fr.php +++ b/module/custom/lang/fr.php @@ -153,11 +153,11 @@ $lang->custom->page = ' Page'; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Plan'; diff --git a/module/custom/lang/vi.php b/module/custom/lang/vi.php index 701bf485e0..2bb76b482d 100644 --- a/module/custom/lang/vi.php +++ b/module/custom/lang/vi.php @@ -153,11 +153,11 @@ $lang->custom->page = ''; $lang->custom->scoreStatus[1] = 'On'; $lang->custom->scoreStatus[0] = 'Off'; -$lang->custom->closedProjectStatus[1] = 'Change Forbidden'; -$lang->custom->closedProjectStatus[0] = 'Change Allowed'; +$lang->custom->CRProject[1] = 'Change Forbidden'; +$lang->custom->CRProject[0] = 'Change Allowed'; -$lang->custom->closedProductStatus[1] = 'Change Forbidden'; -$lang->custom->closedProductStatus[0] = 'Change Allowed'; +$lang->custom->CRProduct[1] = 'Change Forbidden'; +$lang->custom->CRProduct[0] = 'Change Allowed'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = 'Kế hoạch'; diff --git a/module/custom/lang/zh-cn.php b/module/custom/lang/zh-cn.php index 86bbbe20d4..7b492bc642 100644 --- a/module/custom/lang/zh-cn.php +++ b/module/custom/lang/zh-cn.php @@ -153,11 +153,11 @@ $lang->custom->page = '页面'; $lang->custom->scoreStatus[1] = '开启'; $lang->custom->scoreStatus[0] = '关闭'; -$lang->custom->closedProjectStatus[1] = '禁止修改'; -$lang->custom->closedProjectStatus[0] = '允许修改'; +$lang->custom->CRProject[1] = '禁止修改'; +$lang->custom->CRProject[0] = '允许修改'; -$lang->custom->closedProductStatus[1] = '禁止修改'; -$lang->custom->closedProductStatus[0] = '允许修改'; +$lang->custom->CRProduct[1] = '禁止修改'; +$lang->custom->CRProduct[0] = '允许修改'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = '计划'; diff --git a/module/custom/lang/zh-tw.php b/module/custom/lang/zh-tw.php index f08b4a3b39..edf42f5035 100644 --- a/module/custom/lang/zh-tw.php +++ b/module/custom/lang/zh-tw.php @@ -153,11 +153,11 @@ $lang->custom->page = '頁面'; $lang->custom->scoreStatus[1] = '開啟'; $lang->custom->scoreStatus[0] = '關閉'; -$lang->custom->closedProjectStatus[1] = '禁止修改'; -$lang->custom->closedProjectStatus[0] = '允許修改'; +$lang->custom->CRProject[1] = '禁止修改'; +$lang->custom->CRProject[0] = '允許修改'; -$lang->custom->closedProductStatus[1] = '禁止修改'; -$lang->custom->closedProductStatus[0] = '允許修改'; +$lang->custom->CRProduct[1] = '禁止修改'; +$lang->custom->CRProduct[0] = '允許修改'; $lang->custom->moduleName['product'] = $lang->productCommon; $lang->custom->moduleName['productplan'] = '計劃'; diff --git a/module/custom/view/product.html.php b/module/custom/view/product.html.php index 716c377e09..b1c064d45b 100644 --- a/module/custom/view/product.html.php +++ b/module/custom/view/product.html.php @@ -21,8 +21,8 @@ custom->closedProduct;?> - global->closedProductStatus) ? $config->global->closedProductStatus : 0;?> - custom->closedProductStatus as $key => $value):?> + global->CRProduct) ? $config->global->CRProduct : 0;?> + custom->CRProduct as $key => $value):?> diff --git a/module/custom/view/project.html.php b/module/custom/view/project.html.php index 735bc35510..73b00ed52e 100644 --- a/module/custom/view/project.html.php +++ b/module/custom/view/project.html.php @@ -21,8 +21,8 @@ custom->closedProject;?> - global->closedProjectStatus) ? $config->global->closedProjectStatus : 0;?> - custom->closedProjectStatus as $key => $value):?> + global->CRProject) ? $config->global->CRProject : 0;?> + custom->CRProject as $key => $value):?> diff --git a/module/doc/control.php b/module/doc/control.php index 1199c0d555..5f0cdc16e9 100644 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -756,8 +756,8 @@ class doc extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $canBeChanged = false; - if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $canBeChanged = false; + if($type == 'product' and empty($this->config->CRProduct) and $object->status == 'closed') $canBeChanged = false; + if($type == 'project' and empty($this->config->CRProject) and $object->status == 'closed') $canBeChanged = false; /* According the from, set menus. */ if($this->from == 'product') @@ -856,8 +856,8 @@ class doc extends control /* Determines whether an object is editable. */ $canBeChanged = true; - if($type == 'product' and !empty($this->config->global->closedProductStatus) and $object->status == 'closed') $canBeChanged = false; - if($type == 'project' and !empty($this->config->global->closedProjectStatus) and $object->status == 'closed') $canBeChanged = false; + if($type == 'product' and empty($this->config->CRProduct) and $object->status == 'closed') $canBeChanged = false; + if($type == 'project' and empty($this->config->CRProject) and $object->status == 'closed') $canBeChanged = false; if($from == 'product') { diff --git a/module/product/view/browse.html.php b/module/product/view/browse.html.php index 8a4d07e12f..5b30688c39 100644 --- a/module/product/view/browse.html.php +++ b/module/product/view/browse.html.php @@ -94,7 +94,7 @@ js::set('foldAll', $lang->project->treeLevel['root']); ?> - config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> createLink('story', 'batchCreate', "productID=$productID&branch=$branch&moduleID=$moduleID"), " {$lang->story->batchCreate}", '', "class='btn btn btn-secondary'");?> project->treeLevel['root']);

story->noStory;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('story', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('story', 'create')):?> createLink('story', 'create', "productID={$productID}&branch={$branch}&moduleID={$moduleID}"), " " . $lang->story->create, '', "class='btn btn-info'");?>

@@ -189,7 +189,7 @@ js::set('foldAll', $lang->project->treeLevel['root']); $widths = $this->datatable->setFixedFieldWidth($setting); $columns = 0; - $canBeChanged = (empty($config->global->closedProductStatus) or $product->status != 'closed'); + $canBeChanged = (!empty($config->CRProduct) or $product->status != 'closed'); $canBatchEdit = ($canBeChanged and common::hasPriv('story', 'batchEdit')); $canBatchClose = (common::hasPriv('story', 'batchClose') and strtolower($browseType) != 'closedbyme' and strtolower($browseType) != 'closedstory'); $canBatchReview = ($canBeChanged and common::hasPriv('story', 'batchReview')); diff --git a/module/product/view/roadmap.html.php b/module/product/view/roadmap.html.php index 4fdeee1b9c..90ebd428d0 100644 --- a/module/product/view/roadmap.html.php +++ b/module/product/view/roadmap.html.php @@ -41,7 +41,7 @@

release->noRelease;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> createLink('release', 'create', "productID=$product->id&branch=$branchKey"), " " . $lang->release->create, '', "class='btn btn-info'");?>

diff --git a/module/productplan/view/browse.html.php b/module/productplan/view/browse.html.php index 242a8cd17e..68e197cac0 100644 --- a/module/productplan/view/browse.html.php +++ b/module/productplan/view/browse.html.php @@ -24,7 +24,7 @@
- config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> id&branch=$branch", " {$lang->productplan->create}", '', "class='btn btn-primary'");?>
@@ -34,7 +34,7 @@

productplan->noPlan;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('productplan', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('productplan', 'create')):?> createLink('productplan', 'create', "productID=$product->id&branch=$branch"), " " . $lang->productplan->create, '', "class='btn btn-info'");?>

diff --git a/module/release/view/browse.html.php b/module/release/view/browse.html.php index ff8213e84f..48ddcbc5fd 100644 --- a/module/release/view/browse.html.php +++ b/module/release/view/browse.html.php @@ -22,7 +22,7 @@ ?>
- config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?> id&branch=$branch", " {$lang->release->create}", '', "class='btn btn-primary'");?>
@@ -32,7 +32,7 @@

release->noRelease;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('release', 'create')):?> createLink('release', 'create', "productID=$product->id&branch=$branch"), " " . $lang->release->create, '', "class='btn btn-info'");?>

diff --git a/module/story/view/view.html.php b/module/story/view/view.html.php index a29b2054d7..19a9a8a205 100644 --- a/module/story/view/view.html.php +++ b/module/story/view/view.html.php @@ -47,7 +47,7 @@
- config->global->closedProductStatus) or $product->status != 'closed'): ?> + config->CRProduct) or $product->status != 'closed'): ?> product}&branch={$story->branch}&moduleID={$story->module}", "" . $lang->story->create, '', "class='btn btn-primary'"); ?>
diff --git a/module/testcase/view/browse.html.php b/module/testcase/view/browse.html.php index 8ab3aa076c..ac5cdc8183 100644 --- a/module/testcase/view/browse.html.php +++ b/module/testcase/view/browse.html.php @@ -47,7 +47,7 @@ js::set('suiteID', $suiteID);

testcase->noCase;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('testcase', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('testcase', 'create')):?> createLink('testcase', 'create', "productID=$productID&branch=$branch&moduleID=$initModule"), " " . $lang->testcase->create, '', "class='btn btn-info'");?> diff --git a/module/testcase/view/caseheader.html.php b/module/testcase/view/caseheader.html.php index e16a07caf6..418d056822 100644 --- a/module/testcase/view/caseheader.html.php +++ b/module/testcase/view/caseheader.html.php @@ -44,7 +44,7 @@ echo "

"; echo html::a('javascript:;', $currentLable . " ", '', "class='btn btn-link' data-toggle='dropdown'"); - if(empty($this->config->global->closedProductStatus) or $product->status != 'closed') + if(!empty($this->config->CRProduct) or $product->status != 'closed') { echo "
- config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?>
- config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?>
" . $lang->testtask->create, '', "class='btn btn-primary'");?>
@@ -58,7 +58,7 @@ $status = $this->session->testTaskVersionStatus;

testtask->noTesttask;?> - config->global->closedProductStatus) or $product->status != 'closed') and common::hasPriv('testtask', 'create')):?> + config->CRProduct) or $product->status != 'closed') and common::hasPriv('testtask', 'create')):?> createLink('testtask', 'create', "product=$productID"), " " . $lang->testtask->create, '', "class='btn btn-info'");?>

diff --git a/module/testtask/view/browseunits.html.php b/module/testtask/view/browseunits.html.php index 8b7840730f..fa234495f6 100644 --- a/module/testtask/view/browseunits.html.php +++ b/module/testtask/view/browseunits.html.php @@ -23,7 +23,7 @@ $label", '', "id='{$key}Tab' class='btn btn-link'");?>
- config->global->closedProductStatus) or $product->status != 'closed'):?> + config->CRProduct) or $product->status != 'closed'):?>
" . $lang->testtask->importUnitResult, '', "class='btn btn-primary'");?>
diff --git a/module/tree/control.php b/module/tree/control.php index 26850600ae..c92dfdc9b5 100644 --- a/module/tree/control.php +++ b/module/tree/control.php @@ -45,7 +45,7 @@ class tree extends control $this->view->root = $product; /* Determines whether an object is editable. */ - $canBeChanged = (empty($this->config->global->closedProductStatus) or $product->status != 'closed') ? true : false; + $canBeChanged = (!empty($this->config->CRProduct) or $product->status != 'closed') ? true : false; } elseif(strpos($viewType, 'doc') !== false) { @@ -219,7 +219,7 @@ class tree extends control $this->view->products = $products; /* Determines whether an object is editable. */ - $canBeChanged = (empty($this->config->global->closedProjectStatus) or $project->status != 'closed') ? true : false; + $canBeChanged = (!empty($this->config->CRProject) or $project->status != 'closed') ? true : false; /* Set menu. */ $this->lang->set('menugroup.tree', 'project');