diff --git a/UPDATE.md b/UPDATE.md index 3ce171e..a36befa 100644 --- a/UPDATE.md +++ b/UPDATE.md @@ -6,7 +6,7 @@ 2. github地址:https://github.com/zyx0814/dzzoffice 3. 码云地址: https://gitee.com/zyx0814/dzzoffice -### DzzOffice2.01主要更新内容 +### DzzOffice2.02主要更新内容 1. 缓存优化,开启内存huanc(如:memcached等)会显著提高效率; diff --git a/core/class/io/io_dzz.php b/core/class/io/io_dzz.php index 147d74b..07b7861 100644 --- a/core/class/io/io_dzz.php +++ b/core/class/io/io_dzz.php @@ -484,7 +484,7 @@ class io_dzz extends io_api 'ext' => $attach['filetype'], 'dateline' => TIMESTAMP ); - $return = C::t('resources_version')->add_new_version_by_rid($icoarr['rid'], $setarr); + $return = C::t('resources_version')->add_new_version_by_rid($icoarr['rid'], $setarr,$force); if($return['error']){ return array('error'=>$return['error']); } diff --git a/core/class/table/table_resources.php b/core/class/table/table_resources.php index c30d7cc..13a5cd4 100644 --- a/core/class/table/table_resources.php +++ b/core/class/table/table_resources.php @@ -410,13 +410,13 @@ class table_resources extends dzz_table $data['url'] = DZZSCRIPT . '?mod=document&icoid=' . dzzencode('attach::' . $data['aid']); $data['img'] = isset($data['img']) ? $data['img'] : geticonfromext($data['ext'], $data['type']); } elseif ($data['type'] == 'folder') { - $contaions = self::get_contains_by_fid($data['oid'], true); - $data['contaions'] = $contaions; + //$contaions = self::get_contains_by_fid($data['oid'], true); + //$data['contaions'] = $contaions; $relativepath = str_replace(':', '', strrchr($data['path'], ':')); $data['position'] = substr($relativepath, 0, strlen($relativepath) - 1); $data['fsize'] = formatsize($contaions['size']); - $data['ffsize'] = lang('property_info_size', array('fsize' => formatsize($contaions['size']), 'size' => $contaions['size'])); - $data['contain'] = lang('property_info_contain', array('filenum' => $contaions['contain'][0], 'foldernum' => $contaions['contain'][1])); + // $data['ffsize'] = lang('property_info_size', array('fsize' => formatsize($contaions['size']), 'size' => $contaions['size'])); + // $data['contain'] = lang('property_info_contain', array('filenum' => $contaions['contain'][0], 'foldernum' => $contaions['contain'][1])); $data['img'] = './dzz/images/extimg/folder.png'; } else { $data['img'] = isset($data['img']) ? $data['img'] : geticonfromext($data['ext'], $data['type']); diff --git a/core/class/table/table_resources_version.php b/core/class/table/table_resources_version.php index 7d91e43..30aa24f 100644 --- a/core/class/table/table_resources_version.php +++ b/core/class/table/table_resources_version.php @@ -125,14 +125,14 @@ class table_resources_version extends dzz_table $this->clear_cache($cachekey); } //上传新版本 - public function add_new_version_by_rid($rid,$setarr){ + public function add_new_version_by_rid($rid,$setarr,$force=false){ global $_G,$documentexts; $cachekey = 'resourcesversiondata_'.$rid; if(!$resources = C::t('resources')->fetch_info_by_rid($rid)){ return array('error'=>lang('file_not_exist')); } //检测权限 - if (!perm_check::checkperm_Container($resources['pfid'], 'edit2') && !( $_G['uid'] == $resources['uid'] && perm_check::checkperm_Container($resources['pfid'], 'edit1'))) { + if (!$force && !perm_check::checkperm_Container($resources['pfid'], 'edit2') && !( $_G['uid'] == $resources['uid'] && perm_check::checkperm_Container($resources['pfid'], 'edit1'))) { return array('error'=>lang('no_privilege')); } //文件类型获取