From 244917f11142ed2662c30cd2968b8f83e2bc245c Mon Sep 17 00:00:00 2001 From: holan20180123 <56391770@qq.com> Date: Mon, 8 Mar 2021 16:17:30 +0800 Subject: [PATCH 1/6] * Modify PGM to program at product module. --- module/product/control.php | 28 ++++++++++++++-------------- module/product/js/edit.js | 4 ++-- module/product/lang/de.php | 14 +++++++------- module/product/lang/en.php | 14 +++++++------- module/product/lang/fr.php | 14 +++++++------- module/product/lang/vi.php | 14 +++++++------- module/product/lang/zh-cn.php | 14 +++++++------- module/product/model.php | 10 +++++----- module/product/view/create.html.php | 4 ++-- module/product/view/edit.html.php | 16 ++++++++-------- 10 files changed, 66 insertions(+), 66 deletions(-) diff --git a/module/product/control.php b/module/product/control.php index 02db4712ca..54254ebd8a 100644 --- a/module/product/control.php +++ b/module/product/control.php @@ -311,9 +311,9 @@ class product extends control $this->app->rawModule = 'program'; $this->app->rawMethod = 'product'; $this->lang->navGroup->program = 'program'; - $this->loadModel('program')->setPGMViewMenu($programID); - $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); - $this->lang->program->mainMenuAction = $this->program->getPGMMainAction(); + $this->loadModel('program')->setViewMenu($programID); + $this->lang->program->switcherMenu = $this->program->getSwitcher($programID, true); + $this->lang->program->mainMenuAction = $this->program->getMainAction(); } $this->loadModel('user'); @@ -362,7 +362,7 @@ class product extends control /* Init vars. */ $product = $this->product->getById($productID); $unmodifiableProjects = array(); - $canChangePGM = true; + $canChangeProgram = true; $singleLinkProjects = array(); $multipleLinkProjects = array(); $linkStoriesProjects = array(); @@ -375,7 +375,7 @@ class product extends control ->andWhere('t2.deleted')->eq('0') ->fetchPairs('project', 'product'); - if(!empty($unmodifiableProjects)) $canChangePGM = false; + if(!empty($unmodifiableProjects)) $canChangeProgram = false; /* Get the projects linked with this product. */ $projectPairs = $this->dao->select('t2.id,t2.name')->from(TABLE_PROJECTPRODUCT)->alias('t1') @@ -389,7 +389,7 @@ class product extends control { foreach($projectPairs as $projectID => $projectName) { - if($canChangePGM) + if($canChangeProgram) { $products = $this->dao->select('product')->from(TABLE_PROJECTPRODUCT)->where('project')->eq($projectID)->fetchPairs(); if(count($products) == 1) @@ -453,9 +453,9 @@ class product extends control $this->app->rawModule = 'program'; $this->app->rawMethod = 'product'; $this->lang->navGroup->program = 'program'; - $this->loadModel('program')->setPGMViewMenu($programID); - $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); - $this->lang->program->mainMenuAction = $this->program->getPGMMainAction(); + $this->loadModel('program')->setViewMenu($programID); + $this->lang->program->switcherMenu = $this->program->getSwitcher($programID, true); + $this->lang->program->mainMenuAction = $this->program->getMainAction(); } /* Get the relevant person in charge. */ @@ -488,7 +488,7 @@ class product extends control $this->view->programs = array('') + $this->loadModel('program')->getTopPairs(); $this->view->lines = $lines; $this->view->URSRPairs = $this->loadModel('custom')->getURSRPairs(); - $this->view->canChangePGM = $canChangePGM; + $this->view->canChangeProgram = $canChangeProgram; $this->view->singleLinkProjects = $singleLinkProjects; $this->view->multipleLinkProjects = $multipleLinkProjects; $this->view->linkStoriesProjects = $linkStoriesProjects; @@ -545,9 +545,9 @@ class product extends control $this->app->rawModule = 'program'; $this->app->rawMethod = 'product'; $this->lang->navGroup->program = 'program'; - $this->loadModel('program')->setPGMViewMenu($programID); - $this->lang->program->switcherMenu = $this->program->getPGMSwitcher($programID, true); - $this->lang->program->mainMenuAction = $this->program->getPGMMainAction(); + $this->loadModel('program')->setViewMenu($programID); + $this->lang->program->switcherMenu = $this->program->getSwitcher($programID, true); + $this->lang->program->mainMenuAction = $this->program->getMainAction(); $this->loadModel('user'); $poUsers = $this->user->getPairs('nodeleted|pofirst', $appendPoUsers); @@ -909,7 +909,7 @@ class product extends control $this->view->extra = $extra; $this->view->products = $products; $this->view->projectID = $moduleGroup == 'project' ? $this->session->project : 0; - $this->view->programs = $this->loadModel('program')->getPGMPairs(true); + $this->view->programs = $this->loadModel('program')->getPairs(true); $this->view->openApp = $moduleGroup; $this->display(); } diff --git a/module/product/js/edit.js b/module/product/js/edit.js index 9b7015931a..8cc74a545b 100644 --- a/module/product/js/edit.js +++ b/module/product/js/edit.js @@ -3,10 +3,10 @@ $(function() $('#program').change(function() { var programID = $(this).val(); - if(!canChangePGM || singleLinkProjects.length !== 0 || multipleLinkProjects.length !== 0) + if(!canChangeProgram || singleLinkProjects.length !== 0 || multipleLinkProjects.length !== 0) { $('#changeProgram').modal({show: true}); - if(!canChangePGM) + if(!canChangeProgram) { $('#program').val(oldProgramID); $('#program').trigger("chosen:updated"); diff --git a/module/product/lang/de.php b/module/product/lang/de.php index 1a2c6e5958..dca39a99b2 100644 --- a/module/product/lang/de.php +++ b/module/product/lang/de.php @@ -65,13 +65,13 @@ $lang->product->unResolvedBugsTitle = 'Active Bugs'; $lang->product->assignToNullBugs = 'Nicht zugewiesene [B]'; $lang->product->assignToNullBugsTitle = 'Unassigned Bugs'; -$lang->product->confirmDelete = " Möchten Sie {$lang->productCommon} löschen?"; -$lang->product->errorNoProduct = "Kein {$lang->productCommon} erstellt!"; -$lang->product->accessDenied = "Sie haben keinen Zugriff auf {$lang->productCommon}."; -$lang->product->PGMChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; -$lang->product->notChangePGMTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; -$lang->product->confirmChangePGM = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; -$lang->product->changePGMError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; +$lang->product->confirmDelete = " Möchten Sie {$lang->productCommon} löschen?"; +$lang->product->errorNoProduct = "Kein {$lang->productCommon} erstellt!"; +$lang->product->accessDenied = "Sie haben keinen Zugriff auf {$lang->productCommon}."; +$lang->product->programChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; +$lang->product->notChangeProgramTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; +$lang->product->confirmChangeProgram = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; +$lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; $lang->product->id = 'ID'; $lang->product->program = "Program"; diff --git a/module/product/lang/en.php b/module/product/lang/en.php index 7d05e23914..a0606c730d 100644 --- a/module/product/lang/en.php +++ b/module/product/lang/en.php @@ -65,13 +65,13 @@ $lang->product->unResolvedBugsTitle = 'Active Bugs'; $lang->product->assignToNullBugs = 'Unassigned [B]'; $lang->product->assignToNullBugsTitle = 'Unassigned Bugs'; -$lang->product->confirmDelete = " Do you want to delete the {$lang->productCommon}?"; -$lang->product->errorNoProduct = "No {$lang->productCommon} is created yet!"; -$lang->product->accessDenied = "You have no access to the {$lang->productCommon}."; -$lang->product->PGMChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; -$lang->product->notChangePGMTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; -$lang->product->confirmChangePGM = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; -$lang->product->changePGMError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; +$lang->product->confirmDelete = " Do you want to delete the {$lang->productCommon}?"; +$lang->product->errorNoProduct = "No {$lang->productCommon} is created yet!"; +$lang->product->accessDenied = "You have no access to the {$lang->productCommon}."; +$lang->product->programChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; +$lang->product->notChangeProgramTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; +$lang->product->confirmChangeProgram = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; +$lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; $lang->product->id = 'ID'; $lang->product->program = "Program"; diff --git a/module/product/lang/fr.php b/module/product/lang/fr.php index 392420f382..e8eadd80d6 100644 --- a/module/product/lang/fr.php +++ b/module/product/lang/fr.php @@ -65,13 +65,13 @@ $lang->product->unResolvedBugsTitle = 'Bugs Ouverts'; $lang->product->assignToNullBugs = 'Orphelins [B]'; $lang->product->assignToNullBugsTitle = 'Bugs non assignés'; -$lang->product->confirmDelete = "Voulez-vous vraiment supprimer le {$lang->productCommon} ?"; -$lang->product->errorNoProduct = "Aucun {$lang->productCommon} n'est créé pour l'instant !"; -$lang->product->accessDenied = "Vous n'avez pas accès au {$lang->productCommon}."; -$lang->product->PGMChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; -$lang->product->notChangePGMTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; -$lang->product->confirmChangePGM = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; -$lang->product->changePGMError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; +$lang->product->confirmDelete = "Voulez-vous vraiment supprimer le {$lang->productCommon} ?"; +$lang->product->errorNoProduct = "Aucun {$lang->productCommon} n'est créé pour l'instant !"; +$lang->product->accessDenied = "Vous n'avez pas accès au {$lang->productCommon}."; +$lang->product->programChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; +$lang->product->notChangeProgramTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; +$lang->product->confirmChangeProgram = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; +$lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; $lang->product->id = 'ID'; $lang->product->program = "Program"; diff --git a/module/product/lang/vi.php b/module/product/lang/vi.php index 49b81c8cb9..fb5686e99d 100644 --- a/module/product/lang/vi.php +++ b/module/product/lang/vi.php @@ -65,13 +65,13 @@ $lang->product->unResolvedBugsTitle = 'Kích hoạt Bugs'; $lang->product->assignToNullBugs = 'Chưa giao [B]'; $lang->product->assignToNullBugsTitle = 'Chưa giao Bugs'; -$lang->product->confirmDelete = " Bạn có muốn xóa {$lang->productCommon} này?"; -$lang->product->errorNoProduct = "Không có {$lang->productCommon} được tạo!"; -$lang->product->accessDenied = "Bạn không có quyền truy cập tới {$lang->productCommon} này."; -$lang->product->PGMChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; -$lang->product->notChangePGMTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; -$lang->product->confirmChangePGM = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; -$lang->product->changePGMError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; +$lang->product->confirmDelete = " Bạn có muốn xóa {$lang->productCommon} này?"; +$lang->product->errorNoProduct = "Không có {$lang->productCommon} được tạo!"; +$lang->product->accessDenied = "Bạn không có quyền truy cập tới {$lang->productCommon} này."; +$lang->product->programChangeTip = "The projects linked with this {$lang->productCommon}: %s will be transferred to the modified program set together."; +$lang->product->notChangeProgramTip = "The {$lang->SRCommon} of {$lang->productCommon} has been linked to the following projects, please cancel the link before proceeding"; +$lang->product->confirmChangeProgram = "The projects linked with this {$lang->productCommon}: %s is also linked with other products, whether to transfer projects to the modified program set."; +$lang->product->changeProgramError = "The {$lang->SRCommon} of this {$lang->productCommon} has been linked to the project, please unlink it before proceeding"; $lang->product->id = 'ID'; $lang->product->program = "Program"; diff --git a/module/product/lang/zh-cn.php b/module/product/lang/zh-cn.php index 1c7267ed80..b23632362e 100644 --- a/module/product/lang/zh-cn.php +++ b/module/product/lang/zh-cn.php @@ -65,13 +65,13 @@ $lang->product->unResolvedBugsTitle = '未解决Bug'; $lang->product->assignToNullBugs = '未指派Bug'; $lang->product->assignToNullBugsTitle = '未指派Bug'; -$lang->product->confirmDelete = " 您确定删除该{$lang->productCommon}吗?"; -$lang->product->errorNoProduct = "还没有创建{$lang->productCommon}!"; -$lang->product->accessDenied = "您无权访问该{$lang->productCommon}"; -$lang->product->PGMChangeTip = "如下项目只关联了该{$lang->productCommon}, 将直接转移至新项目集下。"; -$lang->product->notChangePGMTip = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到如下项目,请取消关联后再操作"; -$lang->product->confirmChangePGM = "如下项目既关联了该{$lang->productCommon}又关联了其他{$lang->productCommon},请确认是否继续关联该{$lang->productCommon},勾选后将取消与其他{$lang->productCommon}的关联关系,同时转移至新项目集下。"; -$lang->product->changePGMError = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到项目,请取消关联后再操作"; +$lang->product->confirmDelete = " 您确定删除该{$lang->productCommon}吗?"; +$lang->product->errorNoProduct = "还没有创建{$lang->productCommon}!"; +$lang->product->accessDenied = "您无权访问该{$lang->productCommon}"; +$lang->product->programChangeTip = "如下项目只关联了该{$lang->productCommon}, 将直接转移至新项目集下。"; +$lang->product->notChangeProgramTip = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到如下项目,请取消关联后再操作"; +$lang->product->confirmChangeProgram = "如下项目既关联了该{$lang->productCommon}又关联了其他{$lang->productCommon},请确认是否继续关联该{$lang->productCommon},勾选后将取消与其他{$lang->productCommon}的关联关系,同时转移至新项目集下。"; +$lang->product->changeProgramError = "该{$lang->productCommon}的{$lang->SRCommon}已经关联到项目,请取消关联后再操作"; $lang->product->id = '编号'; $lang->product->program = "所属项目集"; diff --git a/module/product/model.php b/module/product/model.php index 2c51361194..1879b36110 100644 --- a/module/product/model.php +++ b/module/product/model.php @@ -444,11 +444,11 @@ class productModel extends model /* init currentModule and currentMethod for report and story. */ if($currentModule == 'story') - { + { $storyMethods = ",track,create,batchcreate,batchclose,"; if(strpos($storyMethods, "," . $currentMethod . ",") === false) $currentModule = 'product'; if($currentMethod == 'view' || $currentMethod == 'change' || $currentMethod == 'review') $currentMethod = 'browse'; - } + } if($currentMethod == 'report') $currentMethod = 'browse'; $this->app->loadLang('project'); @@ -576,7 +576,7 @@ class productModel extends model ->fetchPairs('project', 'product'); if(!empty($unmodifiableProjects)) { - dao::$errors[] = $this->lang->product->changePGMError; + dao::$errors[] = $this->lang->product->changeProgramError; return false; } } @@ -698,8 +698,8 @@ class productModel extends model foreach($data->modules as $id => $name) { if(!$name) continue; - $line->name = strip_tags(trim($name)); - $line->root = $data->programs[$id]; + $line->name = strip_tags(trim($name)); + $line->root = $data->programs[$id]; if(is_numeric($id)) { diff --git a/module/product/view/create.html.php b/module/product/view/create.html.php index e9469aeed3..4c3980a0cc 100644 --- a/module/product/view/create.html.php +++ b/module/product/view/create.html.php @@ -23,7 +23,7 @@
config->systemMode == 'new'):?>