*[misc] Create default team space.

This commit is contained in:
songchenxuan
2024-10-16 08:39:35 +08:00
committed by sunhao
parent 78fcc44b03
commit 4131b8152d
3 changed files with 33 additions and 1 deletions
+7
View File
@@ -867,6 +867,13 @@ class doc extends control
*/
public function teamSpace(int $objectID = 0, int $libID = 0, int $moduleID = 0, string $browseType = 'all', string $orderBy = 'order_asc', int $param = 0, int $recTotal = 0, int $recPerPage = 20, int $pageID = 1, string $mode = 'list', int $docID = 0, string $search = '')
{
if(empty($objectID))
{
$this->docZen->initLibForTeamSpace();
$spaces = $this->doc->getSubSpacesByType('custom');
$objectID = key($spaces);
}
echo $this->fetch('doc', 'app', "type=custom&spaceID=$objectID&libID=$libID&moduleID=$moduleID&docID=$docID&mode=$mode&orderBy=$orderBy&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID&filterType=$browseType&search=$search&param=$param");
}
+1 -1
View File
@@ -414,7 +414,7 @@ const commands =
{
const docApp = getDocApp();
const spaceID = args[0] || docApp.spaceID;
const url = $.createLink('doc', 'createLib', spaceID ? `type=${docApp.spaceType}&objectID=${spaceID}` : 'type=mine');
const url = $.createLink('doc', 'createLib', spaceID ? `type=${docApp.spaceType}&objectID=${spaceID}` : `type=${docApp.spaceType}`);
zui.Modal.open({size: 'sm', url: url});
},
moveLib: function(_, args)
+25
View File
@@ -918,6 +918,31 @@ class docZen extends doc
$this->dao->insert(TABLE_DOCLIB)->data($mineLib)->exec();
}
/**
* 初始化团队空间的文档库。
* Init Lib for teamSpace.
*
* @access public
* @return void
*/
public function initLibForTeamSpace()
{
$customLibCount = $this->dao->select('count(1) as count')->from(TABLE_DOCLIB)
->where('type')->eq('custom')
->andWhere('vision')->eq($this->config->vision)
->fetch('count');
if(!empty($customLibCount)) return;
$teamLib = new stdclass();
$teamLib->type = 'custom';
$teamLib->vision = $this->config->vision;
$teamLib->name = $this->lang->doc->spaceList['custom'];
$teamLib->acl = 'open';
$teamLib->addedBy = $this->app->user->account;
$teamLib->addedDate = helper::now();
$this->dao->insert(TABLE_DOCLIB)->data($teamLib)->exec();
}
/**
* 获取所有空间。
* Get all spaces.