*[misc] Create default team space.
This commit is contained in:
@@ -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¶m=$param");
|
||||
}
|
||||
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user