* Finish task #96932.

This commit is contained in:
sunguangming
2023-07-08 10:23:03 +08:00
parent fc501200d3
commit 2aef10366c
13 changed files with 21 additions and 31 deletions
+1 -1
View File
@@ -27,7 +27,7 @@ class form extends formBase
global $app, $lang;
$module = $app->getModuleName();
$method = $app->getMethodName();
$text = !empty($lang->$module->$method) ? $lang->$module->$method : zget($lang, $method);
$text = !empty($lang->$module->$method) ? $lang->$module->$method : zget($lang, $method, '');
$defaultProps = array();
$defaultProps['submitBtnText'] = $text;
+1 -3
View File
@@ -11,7 +11,6 @@ class moduleMenu extends wg
'activeKey?: int',
'settingLink?: string',
'closeLink: string',
'branchType?: string=""',
'showDisplay?: bool=true',
'allText?: string'
);
@@ -80,7 +79,6 @@ class moduleMenu extends wg
{
$settingLink = $this->prop('settingLink');
$showDisplay = $this->prop('showDisplay');
$branchType = $this->prop('branchType');
if(!$settingLink && !$showDisplay) return null;
global $app;
@@ -108,7 +106,7 @@ class moduleMenu extends wg
(
setClass('btn white'),
set('data-toggle', 'modal'),
set::href(helper::createLink('datatable', 'ajaxDisplay', "datatableId=$datatableId&moduleName=$app->moduleName&methodName=$app->methodName&currentModule=$currentModule&currentMethod=$currentMethod&branchType=$branchType")),
set::href(helper::createLink('datatable', 'ajaxDisplay', "datatableId=$datatableId&moduleName=$app->moduleName&methodName=$app->methodName&currentModule=$currentModule&currentMethod=$currentMethod")),
$lang->displaySetting
)
: null,
+1
View File
@@ -95,6 +95,7 @@ $lang->waterfallPlusModel = 'Waterfall Plus';
$lang->all = 'All';
$lang->viewDetails = 'View Details';
$lang->childrenAB = 'C';
$lang->branchName = 'Branch/Platform';
$lang->actions = 'Aktionen';
$lang->restore = 'Wiederherstellen';
+1
View File
@@ -95,6 +95,7 @@ $lang->waterfallPlusModel = 'Waterfall Plus';
$lang->all = 'All';
$lang->viewDetails = 'View Details';
$lang->childrenAB = 'C';
$lang->branchName = 'Branch/Platform';
$lang->actions = 'Action';
$lang->restore = 'Reset';
+1
View File
@@ -95,6 +95,7 @@ $lang->waterfallPlusModel = 'Waterfall Plus';
$lang->all = 'All';
$lang->viewDetails = 'View Details';
$lang->childrenAB = 'C';
$lang->branchName = 'Branch/Platform';
$lang->actions = 'Action';
$lang->restore = 'Réinitialiser';
+1
View File
@@ -95,6 +95,7 @@ $lang->waterfallPlusModel = '融合瀑布模型';
$lang->all = '全部';
$lang->viewDetails = '查看详情';
$lang->childrenAB = '子';
$lang->branchName = '分支/平台';
$lang->actions = '操作';
$lang->restore = '恢复默认';
+1 -6
View File
@@ -30,14 +30,11 @@ class datatable extends control
* @param string $methodName
* @param string $currentModule
* @param string $currentMethod
* @param string $branchType
* @access public
* @return void
*/
public function ajaxDisplay(string $datatableId, string $moduleName, string $methodName, string $currentModule, string $currentMethod, string $branchType)
public function ajaxDisplay(string $datatableId, string $moduleName, string $methodName, string $currentModule, string $currentMethod)
{
if($branchType) $this->lang->datatable->showBranch = sprintf($this->lang->datatable->showBranch, isset($this->lang->datatable->$branchType) ? $this->lang->datatable->$branchType : $this->lang->datatable->branch);
$this->app->loadLang($currentModule);
$this->app->loadConfig($currentModule);
@@ -46,8 +43,6 @@ class datatable extends control
$this->view->methodName = $methodName;
$this->view->currentModule = $currentModule;
$this->view->currentMethod = $currentMethod;
$this->view->isShowBranch = $branchType && $branchType != 'normal';
$this->view->showBranch = isset($this->config->$currentModule->$currentMethod->showBranch) ? $this->config->$currentModule->$currentMethod->showBranch : 1;
$this->render();
}
-7
View File
@@ -43,13 +43,6 @@ class datatableModel extends model
foreach($fieldList as $fieldName => $items)
{
if($fieldName === 'branch')
{
if($this->session->currentProductType === 'branch') $fieldList[$fieldName]['title'] = $this->lang->datatable->branch;
if($this->session->currentProductType === 'platform') $fieldList[$fieldName]['title'] = $this->lang->datatable->platform;
continue;
}
/* Translate field title. */
if(!isset($items['title'])) $items['title'] = $fieldName;
$title = zget($this->lang->$module, $items['title'], zget($this->lang, $items['title'], $items['title']));
+1 -12
View File
@@ -16,7 +16,7 @@ global $lang, $app;
$app->loadLang('datatable');
$showModule = isset($config->$currentModule->$currentMethod->showModule) ? $config->$currentModule->$currentMethod->showModule : '0';
$showBranch = isset($config->$currentModule->$currentMethod->showBranch) ? $config->$currentModule->$currentMethod->showBranch : '0';
$showAllModule = isset($config->execution->task->allModule) ? $config->execution->task->allModule : 0;
$showAllModule = isset($config->execution->task->allModule) ? $config->execution->task->allModule : 0;
set::title($lang->datatable->displaySetting);
form
@@ -57,17 +57,6 @@ form
set::value($showAllModule),
),
) : null,
$isShowBranch ? formGroup
(
set::label($lang->datatable->showBranch),
radiolist
(
set::name('showBranch'),
set::inline(true),
set::items($lang->datatable->showBranchList),
set::value($showBranch),
),
) : null,
input
(
set('class', 'hidden'),
+7
View File
@@ -204,6 +204,13 @@ class execution extends control
$showAllModule = isset($this->config->execution->task->allModule) ? $this->config->execution->task->allModule : '';
$extra = $showAllModule ? 'allModule' : '';
/* Append branches to task. */
$branchGroups = $this->loadModel('branch')->getByProducts(array_keys($this->view->products));
foreach($tasks as $id => $task)
{
if(!empty($task->product) and isset($branchGroups[$task->product][$task->branch])) $task->branch = $branchGroups[$task->product][$task->branch];
}
/* Assign. */
$this->view->tasks = $tasks;
$this->view->pager = $pager;
-1
View File
@@ -97,7 +97,6 @@ sidebar
'activeKey' => $moduleID,
'settingLink' => $this->createLink('tree', 'browsetask', "rootID=$execution->id&productID=0"),
'closeLink' => $this->createLink('execution', 'task'),
'branchType' => $showBranch ? 'branch' : ''
)))
);
-1
View File
@@ -36,7 +36,6 @@ $fnGenerateSideBar = function() use ($moduleTree, $moduleID, $productID, $branch
'activeKey' => $moduleID,
'settingLink' => $this->createLink('tree', 'browse', "rootID=$productID&view=story&currentModuleID=0&branch=$branchID"),
'closeLink' => createLink('execution', 'task'),
'branchType' => $branchType
)))
);
};
+6
View File
@@ -34,6 +34,12 @@ $config->task->dtable->fieldList['type']['map'] = $lang->task->typeList;
$config->task->dtable->fieldList['type']['sortType'] = true;
$config->task->dtable->fieldList['type']['group'] = 1;
$config->task->dtable->fieldList['branch']['title'] = $lang->branchName;
$config->task->dtable->fieldList['branch']['type'] = 'text';
$config->task->dtable->fieldList['branch']['sortType'] = false;
$config->task->dtable->fieldList['branch']['width'] = '100';
$config->task->dtable->fieldList['branch']['group'] = 1;
$config->task->dtable->fieldList['openedBy']['title'] = $lang->task->openedByAB;
$config->task->dtable->fieldList['openedBy']['type'] = 'user';
$config->task->dtable->fieldList['openedBy']['sortType'] = true;