diff --git a/module/block/config/projectstatisticblock.php b/module/block/config/projectstatisticblock.php index bca7a54222..6b0a89876a 100644 --- a/module/block/config/projectstatisticblock.php +++ b/module/block/config/projectstatisticblock.php @@ -5,7 +5,7 @@ $config->block->projectstatistic->dtable['story'][] = array('field' => 'storyPoi $config->block->projectstatistic->dtable['story'][] = array('field' => 'done' , 'unit' => 'unit'); $config->block->projectstatistic->dtable['story'][] = array('field' => 'undone' , 'unit' => 'unit'); -$config->block->projectstatistic->dtable['cost'][] = array('field' => 'personDay' , 'unit' => 'personDay'); +$config->block->projectstatistic->dtable['cost'][] = array('field' => 'costs' , 'unit' => 'personDay'); $config->block->projectstatistic->dtable['cost'][] = array('field' => 'consumed' , 'unit' => 'hour'); $config->block->projectstatistic->dtable['cost'][] = array('field' => 'remainder' , 'unit' => 'hour'); diff --git a/module/block/control.php b/module/block/control.php index b4d7d8f5e4..f8a3d8cdc3 100755 --- a/module/block/control.php +++ b/module/block/control.php @@ -85,6 +85,8 @@ class block extends control return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'load' => true, 'closeModal' => true)); } + /* 如果没传code说明是首次进入页面,直接使用待编辑block的code。*/ + /* If no code is passed, it indicates that you are entering the page for the first time, and you can directly use the code of the block to be edited.*/ $block = $this->block->getByID($blockID); $code = $code ? $code : $block->code; @@ -94,6 +96,8 @@ class block extends control $this->view->module = $module ? $module : $block->module; $this->view->modules = $this->blockZen->getAvailableModules($block->dashboard); $this->view->codes = $this->blockZen->getAvailableCodes($block->dashboard, $this->view->module); + /* codes有值且包含code时,页面才选中对应的code,否则为空。*/ + /* Only when codes have a value and contain codes, the corresponding code is selected on the page, otherwise it is blank.*/ $this->view->code = $this->view->codes ? (in_array($code, array_keys($this->view->codes)) ? $code : '') : $code; $this->view->params = $this->blockZen->getAvailableParams($block->dashboard, $this->view->module, $this->view->code); $this->display(); diff --git a/module/block/lang/zh-cn.php b/module/block/lang/zh-cn.php index 7684de7b6d..2a8b921da9 100644 --- a/module/block/lang/zh-cn.php +++ b/module/block/lang/zh-cn.php @@ -712,7 +712,7 @@ $lang->block->projectstatistic->bug = 'Bug'; $lang->block->projectstatistic->storyPoints = '总规模'; $lang->block->projectstatistic->done = '已完成'; $lang->block->projectstatistic->undone = '剩余'; -$lang->block->projectstatistic->personDay = '总投入'; +$lang->block->projectstatistic->costs = '总投入'; $lang->block->projectstatistic->consumed = '消耗工时'; $lang->block->projectstatistic->remainder = '预计剩余'; $lang->block->projectstatistic->number = '总数量'; diff --git a/module/block/ui/dashboard.html.php b/module/block/ui/dashboard.html.php index 62b02dd635..91f7e40fdd 100644 --- a/module/block/ui/dashboard.html.php +++ b/module/block/ui/dashboard.html.php @@ -30,7 +30,7 @@ foreach($longBlocks as $index => $block) ([ ['text' => $lang->block->refresh, 'url' => ''], ['text' => $lang->edit, 'url' => $this->createLink("block", "edit", "blockID=$block->id"), 'data-toggle' => 'modal'], - ['text' => $lang->block->hidden, 'url' => $this->createLink("block", "delete", "blockID=$block->id&type=hidden")], + ['text' => $lang->block->hidden, 'url' => $this->createLink("block", "delete", "blockID=$block->id")], ['text' => $lang->block->createBlock, 'url' => $this->createLink("block", "create", "dashboard=$dashboard"), 'data-toggle' => 'modal'], ['text' => $lang->block->reset, 'url' => $this->createLink("block", "reset", "dashboard=$dashboard")], ]), diff --git a/module/block/ui/projectstatisticblock.html.php b/module/block/ui/projectstatisticblock.html.php index 0f69be4fc6..c38ce084a5 100644 --- a/module/block/ui/projectstatisticblock.html.php +++ b/module/block/ui/projectstatisticblock.html.php @@ -51,18 +51,20 @@ foreach($projects as $project) foreach($items as $item) { $field = $item['field']; - $unit = $item['field']; + $unit = $item['unit']; $cellItems[] = div ( set('class', 'flex py-4'), cell ( - set('class', 'flex-1 text-right text-gray'), - span($lang->block->projectstatistic->{$field}) + set('width', '50%'), + set('class', 'text-right text-gray'), + span($lang->block->projectstatistic->{$field} . ' :') ), cell ( - set('class', 'flex-1 text-left ml-1'), + set('width', '50%'), + set('class', 'text-left'), span ( set('class', 'font-bold text-black'), diff --git a/module/block/zen.php b/module/block/zen.php index 1313e15e08..447873f998 100644 --- a/module/block/zen.php +++ b/module/block/zen.php @@ -11,11 +11,16 @@ class blockZen extends block */ protected function getAvailableModules(string $dashboard): array { + /* 只有在我的地盘仪表盘中添加区块才会选择对应模块,否则直接使用对应仪表盘所在的模块。*/ + /* Only when adding blocks to my dashboard can I select the corresponding module, otherwise I will directly use the module where the corresponding dashboard is located.*/ if($dashboard != 'my') return array(); $modules = $this->lang->block->moduleList; + /* Unable to display the doc module on my dashboard. */ unset($modules['doc']); + /* 从配置项中取出不同模块的首页对应的控制器方法。*/ + /* Retrieve the controller method corresponding to the homepage of different modules from the configuration item.*/ list($programModule, $programMethod) = explode('-', $this->config->programLink); list($productModule, $productMethod) = explode('-', $this->config->productLink); list($projectModule, $projectMethod) = explode('-', $this->config->projectLink); @@ -24,6 +29,7 @@ class blockZen extends block foreach($modules as $moduleKey => $moduleName) { if($moduleKey == 'todo') continue; + /* Determine if the user has permission for the current module. */ if(in_array($moduleKey, $this->app->user->rights['acls'])) unset($modules[$moduleKey]); $method = 'index'; @@ -32,9 +38,12 @@ class blockZen extends block if($moduleKey == 'project') $method = $projectMethod; if($moduleKey == 'execution') $method = $executionMethod; + /* After obtaining module permissions, it is necessary to verify whether there is permission for the module homepage. */ if(!common::hasPriv($moduleKey, $method)) unset($modules[$moduleKey]); } + /* 判断区块是否被永久关闭,如果未被永久关闭则添加相应选项。*/ + /* Determine whether the block has been permanently closed, and add corresponding options if it has not been permanently closed.*/ $closedBlock = isset($this->config->block->closed) ? $this->config->block->closed : ''; if(strpos(",$closedBlock,", ",|assigntome,") === false) $modules['assigntome'] = $this->lang->block->assignToMe; if(strpos(",$closedBlock,", ",|dynamic,") === false) $modules['dynamic'] = $this->lang->block->dynamic; @@ -42,12 +51,8 @@ class blockZen extends block if(strpos(",$closedBlock,", ",|welcome,") === false and $this->config->global->flow == 'full') $modules['welcome'] = $this->lang->block->welcome; if(strpos(",$closedBlock,", ",|html,") === false) $modules['html'] = 'HTML'; if(strpos(",$closedBlock,", ",|contribute,") === false and $this->config->vision == 'rnd') $modules['contribute'] = $this->lang->block->contribute; - $modules = array('' => '') + $modules; - $hiddenBlocks = $this->block->getMyHiddenBlocks('my'); - foreach($hiddenBlocks as $block) $modules['hiddenBlock' . $block->id] = $block->title; - - return $modules; + return array('' => '') + $modules; } /**