* [story #68106, doing] add noSpace param to doc app.

This commit is contained in:
sunhao
2024-10-16 09:43:47 +08:00
committed by 刘刚
parent c09fb2e2b1
commit 0dd5f366c9
3 changed files with 34 additions and 24 deletions
+29 -19
View File
@@ -1366,30 +1366,40 @@ class doc extends control
* @access public
* @return void
*/
public function app(string $type = 'mine', int $spaceID = 0, int $libID = 0, int $moduleID = 0, int $docID = 0, string $mode = 'list', string $orderBy = 'id_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1, string $filterType = '', string $search = '', string $params = '')
public function app(string $type = 'mine', int $spaceID = 0, int $libID = 0, int $moduleID = 0, int $docID = 0, string $mode = 'list', string $orderBy = 'id_desc', int $recTotal = 0, int $recPerPage = 20, int $pageID = 1, string $filterType = '', string $search = '', bool $noSpace = false)
{
$this->app->loadLang('file');
$menuType = $type == 'mine' ? 'my' : ($type == 'custom' ? 'team' : $type);
$this->lang->doc->menu->{$menuType}['alias'] .= ',' . $this->app->rawMethod;
$this->docZen->setSpacePageStorage($type, 'all', $spaceID, $libID, $moduleID, 0);
$libData = $this->doc->setMenuByType($type, $spaceID, $libID);
if(is_string($libData)) return $this->locate($libData);
list($libs, $libID, $object, $objectID, $objectDropdown) = $libData;
$this->view->type = $type;
$this->view->spaceID = $spaceID;
$this->view->libID = $libID;
$this->view->moduleID = $moduleID;
$this->view->docID = $docID;
$this->view->mode = $mode;
$this->view->filterType = $filterType;
$this->view->search = $search;
$this->view->recTotal = $recTotal;
$this->view->recPerPage = $recPerPage;
$this->view->pageID = $pageID;
$this->view->orderBy = $orderBy;
$this->view->params = $params;
$this->view->users = $this->loadModel('user')->getPairs('noclosed,noletter');
$this->view->activeMenuID = $menuType;
/* For product drop menu. */
if(in_array($type, array('product', 'project', 'execution')))
{
$objectKey = $type . 'ID';
$this->view->$objectKey = $spaceID;
}
if(empty($this->view->title)) $this->view->title = $this->lang->doc->spaceList[$type];
$this->view->type = $type;
$this->view->spaceID = $spaceID;
$this->view->libID = $libID;
$this->view->moduleID = $moduleID;
$this->view->docID = $docID;
$this->view->mode = $mode;
$this->view->filterType = $filterType;
$this->view->search = $search;
$this->view->recTotal = $recTotal;
$this->view->recPerPage = $recPerPage;
$this->view->pageID = $pageID;
$this->view->orderBy = $orderBy;
$this->view->objectType = $type;
$this->view->noSpace = $noSpace;
$this->view->objectID = $spaceID;
$this->view->object = $object;
$this->view->users = $this->loadModel('user')->getPairs('noclosed,noletter');
$this->view->title = $type == 'custom' ? $this->lang->doc->tableContents : $object->name . $this->lang->hyphen . $this->lang->doc->tableContents;
$this->display();
}
+4 -4
View File
@@ -107,15 +107,15 @@ function handleSwitchView(mode, location, info)
let url;
const pager = $.extend({recTotal: 0, recPerPage: 20, pageID: 1}, location.pager);
const search = encodeURIComponent(location.search || '');
const params = encodeURIComponent(location.params || '');
const noSpace = location.noSpace || 0;
const filterType = encodeURIComponent(location.filterType || '');
if(rawModule === 'doc' && ['myspace', 'teamspace', 'productspace', 'projectspace'].includes(rawMethod))
if (rawModule === 'doc' && rawMethod === 'app')
{
url = $.createLink('doc', config.rawMethod, `objectID=${location.spaceID}&libID=${location.libID}&moduleID=${location.moduleID}&browseType=${filterType}&param=${params}&orderBy=${location.orderBy}&recTotal=${pager.recTotal}&recPerPage=${pager.recPerPage}&pageID=${pager.pageID}&mode=${mode}&docID=${location.docID}&search=${search}`).replace('&libID=0&moduleID=0&browseType=all&param=&orderBy=&recTotal=0&recPerPage=20&pageID=1&mode=home&docID=0&search=', '');
url = $.createLink('doc', 'app', `type=${location.spaceType}&spaceID=${spaceID}&libID=${location.libID}&moduleID=${location.moduleID}&docID=${location.docID}&mode=${mode}&orderBy=${location.orderBy}&recTotal=${pager.recTotal}&recPerPage=${pager.recPerPage}&pageID=${pager.pageID}&filterType=${filterType}&search=${search}&noSpace=${noSpace}`).replace('&libID=0&moduleID=0&docID=0&mode=home&orderBy=id_desc&recTotal=0&recPerPage=0&pageID=1&filterType=&search=&noSpace=false', '');
}
else
{
url = $.createLink('doc', 'app', `type=${location.spaceType}&spaceID=${spaceID}&libID=${location.libID}&moduleID=${location.moduleID}&docID=${location.docID}&mode=${mode}&orderBy=${location.orderBy}&recTotal=${pager.recTotal}&recPerPage=${pager.recPerPage}&pageID=${pager.pageID}&filterType=${filterType}&search=${search}&params=${params}`).replace('&libID=0&moduleID=0&docID=0&mode=home&orderBy=id_desc&recTotal=0&recPerPage=0&pageID=1&filterType=&search=&params=', '');
url = $.createLink(config.rawModule, config.rawMethod, `objectID=${location.spaceID}&libID=${location.libID}&moduleID=${location.moduleID}&browseType=${filterType}&param=0&orderBy=${location.orderBy}&recTotal=${pager.recTotal}&recPerPage=${pager.recPerPage}&pageID=${pager.pageID}&mode=${mode}&docID=${location.docID}&search=${search}`).replace('&libID=0&moduleID=0&browseType=all&param=&orderBy=&recTotal=0&recPerPage=20&pageID=1&mode=home&docID=0&search=', '');
}
if(url === lastAppUrl) return;
if(lastAppUrl && !$.apps.getAppUrl().endsWith(url)) $.apps.updateAppUrl(url, info.title ? (info.title + documentTitleSuffix) : originalDocumentTitle);
+1 -1
View File
@@ -154,8 +154,8 @@ zui::docApp
set::filterType($filterType),
set::search($search),
set::orderBy($orderBy),
set::params($params),
set::homeName($lang->doc->spaceList[$type]),
set::noSpace($noSpace),
set::pager(array('recTotal' => $recTotal, 'recPerPage' => $recPerPage, 'pageID' => $pageID)),
set::fetcher($fetcher),
set::docFetcher($docFetcher),