Merge branch 'cyy_90779' of https://gitlab.zcorp.cc/easycorp/zentaopms into tsj_task
This commit is contained in:
@@ -12,20 +12,27 @@
|
||||
?>
|
||||
<style>
|
||||
.block-docrecentupdate .panel-body {padding: 0px 20px;}
|
||||
.block-docrecentupdate .doc-list {display: flex; flex-wrap: wrap; padding: 0 4px 4px 4px;}
|
||||
.block-docrecentupdate .doc-list {display: flex; flex-wrap: wrap; padding: 2px 4px 4px 4px;}
|
||||
.block-docrecentupdate .doc-list > .doc-item {flex: 1 1 26%; padding: 8px 10px; border: 1px solid #EDEEF2; border-radius: 4px; margin-right: 10px; margin-bottom: 16px; width: 0px; cursor: pointer;}
|
||||
.block-docrecentupdate .doc-list > .doc-item .date-interval {float: right; padding: 8px 0px;}
|
||||
.block-docrecentupdate .doc-list > .doc-item .file-icon {float: left; padding: 8px 4px;}
|
||||
.block-docrecentupdate .doc-list > .doc-item > .plug-title {height: 16px; overflow: hidden;}
|
||||
.block-docrecentupdate .doc-list > .doc-item .edit-date {overflow: hidden; height: 16px;}
|
||||
.block-docrecentupdate .no-doc {text-align: center; vertical-align: middle; height: 50px;}
|
||||
|
||||
.block-docrecentupdate.block-sm .doc-list > .doc-item {flex: 1 1 100%;}
|
||||
</style>
|
||||
<?php $canView = common::hasPriv('doc', 'view');?>
|
||||
<div class="panel-body">
|
||||
<div class="plug">
|
||||
<?php if($docList):?>
|
||||
<div class="doc-list">
|
||||
<?php foreach($docList as $doc):?>
|
||||
<a class="doc-item shadow-primary-hover" href='<?php echo $this->createLink("doc", "view", "docID=$doc->id");?>'>
|
||||
<?php if($canView):?>
|
||||
<a class="doc-item shadow-primary-hover" href='<?php echo $this->createlink("doc", "view", "docid=$doc->id");?>'>
|
||||
<?php else:?>
|
||||
<div class="doc-item shadow-primary-hover">
|
||||
<?php endif;?>
|
||||
<span class='date-interval text-muted'>
|
||||
<?php
|
||||
$interval = $doc->editInterval;
|
||||
@@ -51,8 +58,15 @@
|
||||
?>
|
||||
<h4 class="plug-title" title="<?php echo $doc->title;?>"><?php echo $doc->title;?></h4>
|
||||
<p class='edit-date text-muted'><?php echo $lang->doc->editedDate . (common::checkNotCN() ? ': ' : ':') . $doc->editedDate;?></p>
|
||||
<?php if($canView):?>
|
||||
</a>
|
||||
<?php else:?>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
<?php endforeach;?>
|
||||
</div>
|
||||
<?php else:?>
|
||||
<div class='no-doc'><?php echo $lang->doc->noDoc;?></div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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 @@
|
||||
<div class='panel-move-handler'></div>
|
||||
<div class="panel-body flex">
|
||||
<div class='flex flex-column statistic'>
|
||||
<h4 class="title-line"><?php echo $lang->doc->docStatistic;?></h4>
|
||||
<div class='flex'>
|
||||
<div class="tile">
|
||||
<div class="tile-amount"><?php echo (int)$statistic->totalDocs;?></div>
|
||||
@@ -52,7 +45,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='flex flex-column created'>
|
||||
<h4 class="title-line"><?php echo $lang->doc->openedByMe;?></h4>
|
||||
<div class='flex'>
|
||||
<?php if(common::hasPriv('doc', 'mySpace')):?>
|
||||
<a class="tile" href="<?php echo $this->createLink('doc', 'mySpace', 'type=createdBy');?>">
|
||||
@@ -77,7 +69,6 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class='flex flex-column edited'>
|
||||
<h4 class="title-line"><?php echo $lang->doc->editedByMe;?></h4>
|
||||
<div class='flex'>
|
||||
<div class="tile">
|
||||
<div class="tile-amount"><?php echo (int)$statistic->myEditedDocs;?></div>
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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 = "<div class='dropdown btn-group createDropdown'>";
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
echo html::a(helper::createLink('doc', 'createLib', "type=mine"), '<i class="icon icon-plus"></i> ' . $this->lang->doc->createLib, '', 'class="btn btn-secondary iframe" data-width="800px"');
|
||||
}
|
||||
|
||||
if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, 'mine', 0, 0);
|
||||
if($libID and common::hasPriv('doc', 'create')) echo $this->doc->printCreateBtn($lib, 'mine', 0, $moduleID);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user