* Optimized Level 2.5 dropdown interaction.

This commit is contained in:
tianshujie
2023-04-14 13:47:27 +08:00
parent f954e7935c
commit 9cb069b33a
+18 -14
View File
@@ -2735,20 +2735,8 @@ class docModel extends model
$objectDropdown = '';
if(in_array($type, array('project', 'product', 'execution')))
{
$objects = $this->getOrderedObjects($type);
$objectID = $this->loadModel($type)->saveState($objectID, $objects);
$table = $this->config->objectTables[$type];
$libs = $this->getLibsByObject($type, $objectID, '', $appendLib);
if(($libID == 0 or !isset($libs[$libID])) and !empty($libs)) $libID = reset($libs)->id;
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
$objectTitle = zget($objects, $objectID, '');
$objectDropdown = $this->select($type, $objectTitle, $objectID);
if($type == 'execution' and isset($libs[$libID]))
{
$objectTitle = zget($libs[$libID], 'name', '');
$objectDropdown = "<div id='sidebarHeader'><div class='title' title='{$objectTitle}'>{$objectTitle}</div></div>";
}
$table = $this->config->objectTables[$type];
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
if(empty($object))
{
@@ -2756,6 +2744,22 @@ class docModel extends model
$methodName = ($type == 'project' and $this->config->vision != 'lite') ? 'createGuide' : 'create';
return print(js::locate(helper::createLink($type, $methodName, $param)));
}
$objects = $this->getOrderedObjects($type);
$objectID = $this->loadModel($type)->saveState($objectID, $objects);
$libs = $this->getLibsByObject($type, $objectID, '', $appendLib);
if(($libID == 0 or !isset($libs[$libID])) and !empty($libs)) $libID = reset($libs)->id;
$objectTitle = zget($objects, $objectID, '');
if($this->app->tab != 'doc' and isset($libs[$libID]))
{
$objectTitle = zget($libs[$libID], 'name', '');
$objectDropdown = "<div id='sidebarHeader'><div class='title' title='{$objectTitle}'>{$objectTitle}</div></div>";
}
else
{
$objectDropdown = $this->select($type, $objectTitle, $objectID);
}
}
else
{