diff --git a/module/block/view/docrecentupdateblock.html.php b/module/block/view/docrecentupdateblock.html.php index d5ba89ab49..3321d13b61 100644 --- a/module/block/view/docrecentupdateblock.html.php +++ b/module/block/view/docrecentupdateblock.html.php @@ -12,20 +12,27 @@ ?> +
+ + +
doc->noDoc;?>
+
diff --git a/module/block/view/docstatisticblock.html.php b/module/block/view/docstatisticblock.html.php index 49815f2353..ce54c45dcf 100644 --- a/module/block/view/docstatisticblock.html.php +++ b/module/block/view/docstatisticblock.html.php @@ -17,18 +17,12 @@ .block-docstatistic .created {flex: 0 1 48%;} .block-docstatistic .edited {flex: 0 1 16%; padding-left: 20px;} .block-docstatistic .divider {border-right: 1px solid #eee; padding-right: 12%;} -.block-docstatistic .title-line {height: 32px;} -.block-docstatistic .panel-title {display: none;} -.block-docstatistic .panel-body {margin-top: -32px; padding: 30px;} -.block-docstatistic .tile-title {white-space: nowrap;} +.block-docstatistic .panel-body {padding-top: 0;} .block-docstatistic.block-sm .flex {justify-content: start;} .block-docstatistic.block-sm .panel-body.flex {flex-direction: column;} .block-docstatistic.block-sm .divider {border-right: none;} -.block-docstatistic.block-sm .panel-title {display: block;} -.block-docstatistic.block-sm .statistic .title-line {display: none;} .block-docstatistic.block-sm .statistic .flex {margin-top: -28px;} -.block-docstatistic.block-sm .title-line {height: 0; padding-top: 10px;} .block-docstatistic.block-sm .tile {padding: 10px 32px 20px;} .block-docstatistic.block-sm .panel-body {margin-top: 0px; padding: 10px;} .block-docstatistic.block-sm .flex-column .flex .tile:nth-child(1) {padding-left: 0;} @@ -39,7 +33,6 @@
-

doc->docStatistic;?>

totalDocs;?>
@@ -52,7 +45,6 @@
-

doc->openedByMe;?>

-

doc->editedByMe;?>

myEditedDocs;?>
diff --git a/module/doc/control.php b/module/doc/control.php index ec02fc78ab..112edb6961 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -1142,7 +1142,7 @@ class doc extends control public function view($docID = 0, $version = 0, $appendLib = 0) { $doc = $this->doc->getById($docID); - if(!$doc) + if(!$doc or !isset($doc->id)) { if(defined('RUN_MODE') && RUN_MODE == 'api') return $this->send(array('status' => 'fail', 'code' => 404, 'message' => '404 Not found')); return print(js::error($this->lang->notFound) . js::locate($this->inlink('index'))); @@ -1151,7 +1151,6 @@ class doc extends control $lib = $this->doc->getLibById($doc->lib); if(!empty($lib) and $lib->deleted == '1') $appendLib = $doc->id; - $objectType = isset($lib->type) ? $lib->type : 'custom'; $type = $objectType == 'execution' && $this->app->tab != 'execution' ? 'project' : $objectType; $objectID = zget($doc, $type, 0); @@ -1162,9 +1161,6 @@ class doc extends control /* Get doc. */ if($docID) { - $doc = $this->doc->getById($docID, $version, true); - if(!$doc) return print(js::error($this->lang->notFound)); - $this->doc->createAction($docID, 'view'); $this->doc->removeEditing($doc); if($doc->keywords) diff --git a/module/doc/model.php b/module/doc/model.php index c958e291d6..dcb5c0cd2d 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -766,7 +766,7 @@ class docModel extends model echo(js::alert($this->lang->doc->accessDenied)); $loginLink = $this->config->requestType == 'GET' ? "?{$this->config->moduleVar}=user&{$this->config->methodVar}=login" : "user{$this->config->requestFix}login"; if(strpos($this->server->http_referer, $loginLink) !== false) return print(js::locate(inlink('index'))); - return print(js::locate('back')); + helper::end(print(js::locate('back'))); } $docs = $this->processCollector(array($doc->id => $doc)); @@ -1320,6 +1320,8 @@ class docModel extends model */ public function checkPrivDoc($object) { + if(!isset($object->lib)) return false; + $libType = $this->dao->select('type')->from(TABLE_DOCLIB)->where('id')->eq($object->lib)->fetch('type'); if($this->app->user->admin and $libType != 'mine') return true; @@ -2807,7 +2809,7 @@ class docModel extends model public function checkAutoloadPage($doc) { $autoloadPage = true; - if(!empty($doc) and $doc->type == 'url') + if(isset($doc->type) and $doc->type == 'url') { if(empty($doc->content)) return false; @@ -2990,6 +2992,7 @@ class docModel extends model $docIDList = $this->getPrivDocs($lib->id); $docs = $this->dao->select('*, title as name')->from(TABLE_DOC) ->where('id')->in($docIDList) + ->andWhere("(status = 'normal' or (status = 'draft' and addedBy='{$this->app->user->account}'))") ->andWhere('deleted')->eq(0) ->andWhere('module')->eq(0) ->fetchAll('id'); @@ -3145,7 +3148,7 @@ class docModel extends model */ public function printCreateBtn($lib, $type, $objectID, $moduleID, $from = '') { - if(!common::hasPriv('doc', 'create')) return null; + if(!common::hasPriv('doc', 'create') or !isset($lib->id)) return null; $class = $from == 'list' ? 'btn-info' : 'btn-primary'; $html = "