From e95ecf92448c87caf68f3e8fa3c150d78968d237 Mon Sep 17 00:00:00 2001 From: mayue Date: Wed, 17 Aug 2022 16:20:17 +0800 Subject: [PATCH] * Finish task #64939. --- module/common/lang/menu.php | 2 +- module/design/model.php | 14 +++++++++++++- module/stage/control.php | 13 ++++++++++--- module/stage/view/settype.html.php | 10 ++++++++-- 4 files changed, 32 insertions(+), 7 deletions(-) diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php index dda70b11b2..4acf69ede6 100644 --- a/module/common/lang/menu.php +++ b/module/common/lang/menu.php @@ -513,7 +513,7 @@ if($config->edition == 'max') $lang->admin->menu->model['dropMenu']->scrum = arr if($config->systemMode == 'new') { - $lang->admin->menu->model['dropMenu']->waterfall = array('link' => "{$lang->waterfallModel}|stage|setType|", 'subModule' => 'stage,auditcl,cmcl,process,activity,zoutput,classify,reviewcl,reviewsetting'); + $lang->admin->menu->model['dropMenu']->waterfall = array('link' => "{$lang->waterfallModel}|stage|setType|", 'subModule' => 'stage,auditcl,cmcl,process,activity,zoutput,classify,reviewcl,reviewsetting,design'); } $lang->admin->menu->allModel['subMenu'] = new stdclass(); diff --git a/module/design/model.php b/module/design/model.php index 05ecc5863f..206735868c 100644 --- a/module/design/model.php +++ b/module/design/model.php @@ -403,7 +403,19 @@ class designModel extends model */ public function setMenu($projectID, $products, $productID = 0) { - if($this->app->rawMethod != 'browse') unset($this->lang->waterfall->menu->design['subMenu']->bysearch); + /* Show custom design types. */ + $this->lang->waterfall->menu->design['subMenu'] = new stdclass(); + $this->lang->waterfall->menu->design['subMenu']->other = array('link' => "更多|design|other|", 'class' => 'dropdown dropdown-hover'); + $this->lang->waterfall->menu->design['subMenu']->other['dropMenu'] = new stdclass(); + $this->lang->waterfall->menu->design['subMenu']->all = array('link' => "{$this->lang->all}|design|browse|projectID=%s&productID=0&browseType=all"); + $count = 1; + foreach(array_filter($this->lang->design->typeList) as $key => $value) + { + $this->lang->waterfall->menu->design['subMenu']->$key = array('link' => "{$value}|design|browse|projectID=%s&productID=0&browseType={$key}"); + } + + if($this->app->rawMethod == 'browse') $this->lang->waterfall->menu->design['subMenu']->bysearch = array('link' => ' ' . $this->lang->searchAB . ''); + if(empty($products) || !$productID) return ''; $currentProduct = $this->loadModel('product')->getById($productID); setCookie("lastProduct", $productID, $this->config->cookieLife, $this->config->webRoot, '', false, true); diff --git a/module/stage/control.php b/module/stage/control.php index 52090d22ff..1def3643a0 100644 --- a/module/stage/control.php +++ b/module/stage/control.php @@ -141,10 +141,13 @@ class stage extends control public function setType() { $this->loadModel('custom'); + $lang = $this->app->getClientLang(); if($_POST) { $data = fixer::input('post')->get(); - $this->custom->deleteItems("lang=all&module=stage§ion=typeList"); + if($data->lang != 'all') $this->custom->deleteItems("lang=all&module=stage§ion=typeList"); + $this->custom->deleteItems("lang={$data->lang}&module=stage§ion=typeList"); + foreach($data->keys as $index => $key) { $value = $data->values[$index]; @@ -154,9 +157,13 @@ class stage extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'locate' => $this->createLink('stage', 'settype'))); } + /* Check whether the current language has been customized. */ + $customLang = $this->custom->getItems("lang=all&module=stage§ion=typeList&vision={$this->config->vision}"); + if($customLang) $lang2Set = 'all'; + $this->view->title = $this->lang->stage->common . $this->lang->colon . $this->lang->stage->setType; - $this->view->position[] = $this->lang->stage->common; - $this->view->position[] = $this->lang->stage->setType; + $this->view->currentLang = $lang; + $this->view->lang2Set = isset($lang2Set) ? $lang2Set : $lang; $this->display(); } diff --git a/module/stage/view/settype.html.php b/module/stage/view/settype.html.php index eceaac8dd0..0b8206bde9 100644 --- a/module/stage/view/settype.html.php +++ b/module/stage/view/settype.html.php @@ -64,8 +64,14 @@ EOT; - - + + $lang->custom->currentLang, 'all' => $lang->custom->allLang); + echo html::radio('lang', $appliedTo, $lang2Set); + echo html::submitButton(); + if(common::hasPriv('custom', 'restore')) echo html::linkButton($lang->custom->restore, $this->createLink('custom', 'restore', "module=stage&field=typeList"), 'hiddenwin', '', 'btn btn-wide'); + ?> +