* [misc] fix merge feature/doc to main at commit b058c8a456de76894f54000847fc708019d3c5b8.

This commit is contained in:
sunhao
2024-10-16 09:04:30 +08:00
committed by 刘刚
parent 4fda49b053
commit 369c976ccf
3 changed files with 59 additions and 0 deletions
+22
View File
@@ -536,6 +536,28 @@ class file extends control
}
}
/**
* Query the file.
*
* @param int $fileID
* @param string $objectType
* @param int $objectID
* @param string $title
* @param string $extra
* @param int $stream
* @access public
* @return void
*/
public function ajaxQuery(int $fileID, string $objectType = '', int $objectID = 0, string $title = '', string $extra = '', int $stream = 0)
{
if($fileID) return $this->fetch('file', 'read', "fileID=$fileID&stream=$stream");
if(!empty($title)) $title = base64_decode($title);
$file = $this->file->query($objectType, $objectID, $title, $extra);
if(empty($file)) return $this->send(array('result' => 'fail', 'message' => $this->lang->file->fileNotFound, 'load' => helper::createLink('my', 'index'), 'closeModal' => true));
$fileID = $file->id;
return $this->fetch('file', 'read', "fileID=$fileID&stream=$stream");
}
/**
* 关闭升级到企业版提示。
+1
View File
@@ -103,6 +103,7 @@ $config->upgrade->execFlow['20_3_0'] = array('functions' => 'importBuildinW
$config->upgrade->execFlow['20_4'] = array('functions' => 'createDefaultDoclibSpace,updateStoryVerifiedDate,xuanNotifyJitsiConference', 'xxsqls' => "$appRoot/db/upgradexuanxuan7.3.sql,$appRoot/db/upgradexuanxuan9.0.sql");
$config->upgrade->execFlow['20_5'] = array('functions' => 'fixWorkflowFieldOptions');
$config->upgrade->execFlow['20_6'] = array('functions' => 'processDemandFiles,processSqlbuilderTables');
$config->upgrade->execFlow['20_7'] = array('functions' => 'upgradeMyDocSpace');
if(!empty($config->isINT))
{
+36
View File
@@ -9994,4 +9994,40 @@ class upgradeModel extends model
}
return !dao::isError();
}
/**
* Upgrade demand files.
*
* @access public
* @return bool
*/
public function upgradeMyDocSpace()
{
$this->loadModel('doc');
$this->app->loadLang('doclib');
$spacesGroup = $this->dao->select('*')->from(TABLE_DOCLIB)
->where('deleted')->eq(0)
->andWhere('vision')->eq($this->config->vision)
->andWhere('type')->eq('mine')
->orderBy('`order` asc, id_asc')
->fetchGroup('addedBy', 'id');
foreach($spacesGroup as $account => $spaces)
{
$space = new stdclass();
$space->type = 'mine';
$space->vision = 'rnd';
$space->parent = 0;
$space->name = $this->lang->doclib->defaultSpace;
$space->main = '1';
$space->acl = 'private';
$space->addedBy = $account;
$space->addedDate = helper::now();
$spaceID = $this->doc->doInsertLib($space);
$this->dao->update(TABLE_DOCLIB)->set('parent')->eq($spaceID)->where('id')->in(array_keys($spaces))->exec();
$this->dao->update(TABLE_DOCLIB)->set('main')->eq(0)->where('id')->in(array_keys($spaces))->exec();
}
}
}