- Remove unused code.

This commit is contained in:
tianshujie
2024-03-27 11:06:46 +08:00
committed by liyang
parent a461ca907c
commit a1b2ade344
-47
View File
@@ -496,9 +496,6 @@ function initPageEntity(object $object): array
*/
function initTableData(array $items, array &$fieldList, object $model = null, string $moduleName = ''): array
{
global $config;
if($config->edition != 'open') $fieldList = initTableFields($fieldList, $moduleName);
if(!empty($_GET['orderBy']) && strpos($_GET['orderBy'], '-') !== false) list($orderField, $orderValue) = explode('_', $_GET['orderBy']);
if(!empty($orderField) && !empty($orderValue) && !empty($fieldList[$orderField]))
{
@@ -605,50 +602,6 @@ function initTableData(array $items, array &$fieldList, object $model = null, st
return array_values($items);
}
/**
* 初始化表格工作流内置字段。
* Init workflow buildin fields in table.
*
* @param array $fieldList
* @param string $moduleName
* @access public
* @return array
*/
function initTableFields(array $fieldList, string $moduleName = ''): array
{
global $app;
if(empty($moduleName)) $moduleName = $app->rawModule;
$workflowFields = $app->control->loadModel('workflowfield')->getList($moduleName);
foreach($workflowFields as $fieldKey => $field)
{
if($field->buildin || !isset($fieldList[$fieldKey])) continue;
switch($field->control)
{
case 'select':
case 'radio':
$fieldList[$fieldKey]['map'] = $app->control->workflowfield->getFieldOptions($field);
break;
case 'multi-select':
case 'checkbox':
$fieldList[$fieldKey]['map'] = $app->control->workflowfield->getFieldOptions($field);
$fieldList[$fieldKey]['type'] = 'category';
break;
case 'richtext':
$fieldList[$fieldKey]['type'] = 'html';
case 'date':
case 'datetime':
$fieldList[$fieldKey]['type'] = $field->control;
case 'int':
case 'decimal':
$fieldList[$fieldKey]['type'] = 'number';
default:
$fieldList[$fieldKey]['type'] = 'text';
break;
}
}
return $fieldList;
}
/**
* Set the parent property of the data.
*