This commit is contained in:
wangyidong
2023-08-30 17:10:03 +08:00
parent 60ac6c9331
commit eb559611c6
2 changed files with 9 additions and 5 deletions
+4 -1
View File
@@ -23,7 +23,10 @@ $options['storyStages'] = $storyStages;
$options['isShowBranch'] = '';
if(!empty($branchOptions)) $options['branchOptions'] = $branchOptions;
$cols = $this->story->generateCol($orderBy, $storyType);
$hasChildren = false;
array_map(function($story) use(&$hasChildren){ if(!empty($story->children)) $hasChildren = true;}, $stories);
$cols = $this->story->generateCol($orderBy, $storyType, $hasChildren);
$rows = $this->story->generateRow($stories, $cols, $options, $project, $storyType);
$vars = "productID=$productID&branch=$branch&browseType=$browseType&param=$param&storyType=$storyType&orderBy={orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
if($from == 'project' and !empty($projectID)) $vars = "projectID=$projectID&productID=$productID&branch=$branch&browseType=$browseType&param=$param&storyType=$storyType&orderBy={orderBy}&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";
+5 -4
View File
@@ -6660,10 +6660,11 @@ class storyModel extends model
*
* @param string $orderBy
* @param string $storyType
* @param bool $hasChildren
* @access public
* @return array
*/
public function generateCol($orderBy = '', $storyType = 'story')
public function generateCol($orderBy = '', $storyType = 'story', $hasChildren = false)
{
$setting = $this->loadModel('datatable')->getSetting('product');
$fieldList = $this->config->story->datatable->fieldList;
@@ -6724,11 +6725,12 @@ class storyModel extends model
if(isset($set->fixed) && $set->fixed == 'no') unset($set->fixed);
if(isset($set->width)) $set->width = str_replace('px', '', $set->width);
unset($set->id);
$shownFields[] = $set;
$shownFields[$set->name] = $set;
}
if(!$hasChildren) $shownFields['title']->nestedToggle = false;
usort($shownFields, array('datatableModel', 'sortCols'));
return $shownFields;
return array_values($shownFields);
}
/**
@@ -6840,7 +6842,6 @@ class storyModel extends model
if($story->module and isset($modulePairs[$story->module])) $storyTitle .= "<span class='label label-gray label-badge'>{$modulePairs[$story->module]}</span> ";
if($story->parent > 0) $storyTitle .= '<span class="label label-badge label-light" title="' . $this->lang->story->children . '">' . $this->lang->story->childrenAB . '</span> ';
$storyTitle .= $canView ? html::a($storyLink, $story->title, '', "title='$story->title' style='color: $story->color' data-app='$tab'") : "<span style='color: $story->color'>{$storyTitle}{$story->title}</span>";
if(!empty($story->children)) $storyTitle .= '<a class="story-toggle" data-id="' . $story->id . '"><i class="icon icon-angle-right"></i></a>';
$story->title = $storyTitle;
}
if($col->name == 'mailto')