mirror of
https://github.com/DzzXH/DzzOffice.git
synced 2026-03-01 16:52:42 +08:00
修复分享的文件保存失败时无法显示提示信息问题和无法保存其他人分享的文件问题
This commit is contained in:
@@ -2093,6 +2093,10 @@ class io_dzz extends io_api
|
||||
{
|
||||
|
||||
try {
|
||||
if (strpos($rid, 'preview_') === 0) {
|
||||
$rid = preg_replace('/^preview_/', '', $rid);
|
||||
$preview = true;
|
||||
}
|
||||
$data = C::t('resources')->fetch_by_rid($rid);
|
||||
|
||||
if (is_numeric($pfid)) {//如果目标位置也是本地
|
||||
@@ -2110,7 +2114,7 @@ class io_dzz extends io_api
|
||||
$data['success'] = true;
|
||||
$data['moved'] = true;
|
||||
} else {
|
||||
$re = self::FileCopy($rid, $pfid, true,$force);
|
||||
$re = self::FileCopy($rid, $pfid, true,$force,$preview);
|
||||
$data['newdata'] = $re['icoarr'];
|
||||
$data['success'] = true;
|
||||
}
|
||||
@@ -2594,13 +2598,13 @@ class io_dzz extends io_api
|
||||
}
|
||||
|
||||
//本地文件复制到本地其它区域
|
||||
public function FileCopy($rid, $pfid, $first = true,$force=false)
|
||||
public function FileCopy($rid, $pfid, $first = true,$force=false,$preview = false)
|
||||
{
|
||||
global $_G, $_GET;
|
||||
if (!$tfolder = DB::fetch_first("select * from " . DB::table('folder') . " where fid='{$pfid}'")) {
|
||||
return array('error' => lang('target_location_not_exist'));
|
||||
}
|
||||
if ($icoarr = C::t('resources')->fetch_by_rid($rid)) {
|
||||
if ($icoarr = C::t('resources')->fetch_by_rid($rid,'',$preview)) {
|
||||
|
||||
unset($icoarr['rid']);
|
||||
//判断当前文件有没有拷贝权限;
|
||||
@@ -2652,7 +2656,7 @@ class io_dzz extends io_api
|
||||
//复制源文件夹数据到目标目录同名文件夹
|
||||
foreach (C::t('resources')->fetch_by_pfid($icoarr['oid']) as $value) {
|
||||
try {
|
||||
self::FileCopy($value['rid'], $currentfid, false);
|
||||
self::FileCopy($value['rid'], $currentfid, false,$preview);
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
@@ -2664,7 +2668,7 @@ class io_dzz extends io_api
|
||||
if ($data = self::createFolderByPath($icoarr['name'], $pfid)) {//根据文件夹名字和当前文件夹路径创建文件夹
|
||||
foreach (C::t('resources')->fetch_by_pfid($folder['fid']) as $value) {//查询原文件夹中文件
|
||||
try {
|
||||
self::FileCopy($value['rid'], $data['pfid'], false);//复制原文件夹中文件到新文件夹
|
||||
self::FileCopy($value['rid'], $data['pfid'], false,$preview);//复制原文件夹中文件到新文件夹
|
||||
} catch (Exception $e) {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,7 +172,7 @@ class perm_check{
|
||||
//$arr=array('uid','gid','desktop');其中这几项必须
|
||||
function checkperm($action,$arr,$bz=''){ //检查某个图标是否有权限;
|
||||
global $_G;
|
||||
if ($arr['preview'] && $action === 'read') {
|
||||
if ($arr['preview']) {
|
||||
return true;
|
||||
}
|
||||
if($_G['uid']<1){ //游客没有权限
|
||||
|
||||
@@ -14,7 +14,7 @@ if(!defined('CORE_VERSION')) {
|
||||
define('CORE_VERSION', '2.02');
|
||||
define('CORE_RELEASE', '20180909');
|
||||
define('CORE_FIXBUG' , '20000000');
|
||||
define('CORE_XHVERSION', '1.90');
|
||||
define('CORE_XHVERSION', '1.90.1');
|
||||
define('CORE_XHRELEASE', '20241011');
|
||||
define('CORE_XHFIXBUG' , '20241008');
|
||||
define('CORE_XHFIXBUG' , '20241013');
|
||||
}
|
||||
@@ -64,6 +64,7 @@ foreach ($icoids as $icoid) {
|
||||
$data['msg'][] = 'error';
|
||||
continue;
|
||||
}
|
||||
$rid = 'preview_' . $rid;
|
||||
$return = IO::CopyTo($rid, $fid, 1);
|
||||
if ($return['success'] === true) {
|
||||
$data['icoarr'][] = $return['newdata'];
|
||||
@@ -76,9 +77,9 @@ foreach ($icoids as $icoid) {
|
||||
$ridarr[] = $return['newdata']['rid'];
|
||||
$i++;
|
||||
} else {
|
||||
$data['name'][$return['newdata']['rid']] = $return['newdata']['name'];
|
||||
$data['error'][$return['newdata']['rid']] = $return['newdata']['name'] . ':' . $return['error'];
|
||||
$data['msg'][$return['newdata']['rid']] = 'error';
|
||||
$data['name'][$return['rid']] = $return['name'];
|
||||
$data['error'][$return['rid']] = $return['success'];
|
||||
$data['msg'][$return['rid']] = 'error';
|
||||
$errorarr[] = $return['error'];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -576,6 +576,7 @@
|
||||
showWindow('seldir', userhref, 'get', '0');
|
||||
}
|
||||
function saveall_file(fid) {
|
||||
showmessage(__lang.In_the_save, 'info',0,1, 'right-bottom');
|
||||
var rids = [];
|
||||
jQuery('div[data-value="true"]').each(function () {
|
||||
rids.push(jQuery(this).data('dpath'));
|
||||
@@ -594,6 +595,7 @@
|
||||
}, 'json');
|
||||
}
|
||||
function save_file(fid) {
|
||||
showmessage(__lang.In_the_save, 'info',0,1, 'right-bottom');
|
||||
var rids = share.join(',');
|
||||
$.post('{MOD_URL}&op=save', {'fid': fid, 'dzzrids': rids}, function (data) {
|
||||
var msg = '';
|
||||
|
||||
Reference in New Issue
Block a user