* Fix bug#44352.

This commit is contained in:
xieqiyu
2024-01-23 11:07:43 +08:00
parent e6e354568e
commit 017d09bef8
4 changed files with 9 additions and 7 deletions
+3 -3
View File
@@ -96,7 +96,7 @@ class datatable extends control
$value = json_encode($fields);
/* Split story and requirement custom fields. */
if($module == 'product' && $method == 'browse' && strpos(',story,requirement,', ",$extra,") !== false) $name = 'datatable.' . $module . ucfirst($method) . ucfirst($extra) . '.cols';
if(strpos(',product-browse,execution-story,', ",$module-$method,") !== false && strpos(',story,requirement,', ",$extra,") !== false) $name = 'datatable.' . $module . ucfirst($method) . ucfirst($extra) . '.cols';
/* 保存个人配置信息。 */
$this->loadModel('setting')->setItem($account . '.' . $name, $value);
@@ -200,7 +200,7 @@ class datatable extends control
$this->loadModel('setting')->deleteItems("owner={$account}&module=datatable&section={$target}&key=cols");
/* Delete story and requirement custom fields. */
if($module == 'product' && $method == 'browse')
if(strpos(',product-browse,execution-story,', ",$module-$method,") !== false)
{
$storyCustom = $module . ucfirst($method) . 'Story';
$requirementCustom = $module . ucfirst($method) . 'Requirement';
@@ -223,7 +223,7 @@ class datatable extends control
public function ajaxSaveGlobal(string $module, string $method, string $extra = '')
{
$target = $module . ucfirst($method);
if($module == 'product' && $method == 'browse' && strpos(',story,requirement', ",$extra,") !== false) $target .= ucfirst($extra);
if(strpos(',product-browse,execution-story,', ",$module-$method,") !== false && strpos(',story,requirement', ",$extra,") !== false) $target .= ucfirst($extra);
$settings = isset($this->config->datatable->$target->cols) ? $this->config->datatable->$target->cols : '';
if(!empty($settings)) $this->loadModel('setting')->setItem("system.datatable.{$target}.cols", $settings);
+1 -1
View File
@@ -91,7 +91,7 @@ class datatableModel extends model
$datatableId = $module . ucfirst($method);
/* Split story and requirement custom fields. */
if($module == 'product' && $method == 'browse' && strpos(',story,requirement,', $extra) !== false) $datatableId .= ucfirst($extra);
if(strpos(',product-browse,execution-story,', ",$module-$method,") !== false && strpos(',story,requirement,', $extra) !== false) $datatableId .= ucfirst($extra);
$module = zget($this->config->datatable->moduleAlias, "$module-$method", $module);
+4 -3
View File
@@ -353,13 +353,14 @@ if($canBatchAction)
}
/* DataTable columns. */
$setting = $this->loadModel('datatable')->getSetting('execution');
$config->story->dtable->fieldList['title']['title'] = $lang->story->title;
$setting = $this->loadModel('datatable')->getSetting('execution', 'story', false, $storyType);
$cols = array();
if($storyType == 'requirement') unset($setting['plan'], $setting['stage'], $setting['taskCount'], $setting['bugCount'], $setting['caseCount']);
foreach($setting as $col)
{
if(!$execution->hasProduct && $col['name'] == 'branch') continue;
if(!$execution->hasProduct && !$execution->multiple && $col['name'] == 'plan') continue;
if(!$execution->hasProduct && !$execution->multiple && $storyType == 'requirement' && $col['name'] == 'stage') continue;
if($col['name'] == 'title') $col['link'] = createLink('execution', 'storyView', array('storyID' => '{id}', 'execution' => $execution->id));
@@ -395,7 +396,7 @@ dtable
(
setClass('shadow rounded'),
set::userMap($users),
set::customCols(true),
set::customCols(array('url' => createLink('datatable', 'ajaxcustom', "module={$app->moduleName}&method={$app->methodName}&extra={$storyType}"), 'globalUrl' => createLink('datatable', 'ajaxsaveglobal', "module={$app->moduleName}&method={$app->methodName}&extra={$storyType}"))),
set::groupDivider(true),
set::cols($cols),
set::data($data),
+1
View File
@@ -8451,6 +8451,7 @@ class upgradeModel extends model
public function revertStoryCustomFields()
{
$this->dao->delete()->from(TABLE_CONFIG)->where('section')->eq('productBrowse')->andWhere('module')->eq('datatable')->andWhere('key')->eq('cols')->exec();
$this->dao->delete()->from(TABLE_CONFIG)->where('section')->eq('executionStory')->andWhere('module')->eq('datatable')->andWhere('key')->eq('cols')->exec();
return true;
}
}