* Finish task#40805.

This commit is contained in:
qiyu-xie
2021-08-03 15:35:36 +08:00
parent d6e08c274e
commit b8ba41c6c9
2 changed files with 11 additions and 66 deletions
+5 -33
View File
@@ -759,46 +759,18 @@ class doc extends control
*/
public function showFiles($type, $objectID, $viewType = '', $orderBy = 't1.id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$uri = $this->app->getURI(true);
$this->app->session->set('taskList', $uri);
$this->app->session->set('storyList', $uri);
$this->app->session->set('docList', $uri);
if(empty($viewType)) $viewType = !empty($_COOKIE['docFilesViewType']) ? $this->cookie->docFilesViewType : 'card';
setcookie('docFilesViewType', $viewType, $this->config->cookieLife, $this->config->webRoot, '', false, true);
$objects = $this->doc->getOrderedObjects($type);
if($type == 'product')
{
$objectID = $this->product->saveState($objectID, $objects);
$table = TABLE_PRODUCT;
$libs = $this->doc->getLibsByObject('product', $objectID);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs);
}
else if($type == 'project')
{
$objectID = $this->project->saveState($objectID, $objects);
$table = TABLE_PROJECT;
$libs = $this->doc->getLibsByObject('project', $objectID);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs);
}
else if($type == 'execution')
{
$objectID = $this->execution->saveState($objectID, $objects);
$table = TABLE_EXECUTION;
$libs = $this->doc->getLibsByObject('execution', $objectID);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs);
}
$objects = $this->doc->getOrderedObjects($type);
$objectID = $this->{$type}->saveState($objectID, $objects);
$libs = $this->doc->getLibsByObject($type, $objectID);
$this->lang->modulePageNav = $this->doc->select($type, $objects, $objectID, $libs);
$openApp = strpos('doc,product,project,execution', $this->app->openApp) !== false ? $this->app->openApp : 'doc';
if($openApp != 'doc') $this->loadModel($openApp)->setMenu($objectID);
$table = $type == 'product' ? TABLE_PRODUCT : TABLE_PROJECT;
$table = $this->config->objectTables[$type];
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
$this->lang->TRActions = $this->doc->buildCollectButton4Doc();
+6 -33
View File
@@ -2288,41 +2288,14 @@ EOT;
}
else
{
if($type == 'product')
{
$objectID = $this->product->saveState($objectID, $objects);
$table = TABLE_PRODUCT;
$objectID = $this->loadModel($type)->saveState($objectID, $objects);
$table = $this->config->objectTables[$type];
$libs = $this->getLibsByObject($type, $objectID);
$libs = $this->getLibsByObject('product', $objectID);
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->select($type, $objects, $objectID, $libs, $libID);
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->select($type, $objects, $objectID, $libs, $libID);
$this->app->rawMethod = 'product';
}
else if($type == 'project')
{
$objectID = $this->loadModel('project')->saveState($objectID, $objects);
$table = TABLE_PROJECT;
$libs = $this->getLibsByObject('project', $objectID);
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->select($type, $objects, $objectID, $libs, $libID);
$this->app->rawMethod = 'project';
}
else if($type == 'execution')
{
$objectID = $this->loadModel('execution')->saveState($objectID, $objects);
$table = TABLE_EXECUTION;
$libs = $this->getLibsByObject('execution', $objectID);
if($libID == 0) $libID = key($libs);
$this->lang->modulePageNav = $this->select($type, $objects, $objectID, $libs, $libID);
$this->app->rawMethod = 'execution';
}
$this->app->rawMethod = $type;
$object = $this->dao->select('id,name,status')->from($table)->where('id')->eq($objectID)->fetch();
if(empty($object)) die(js::locate(helper::createLink($type, 'create')));