Merge branch 'tsj_view' into 'master'
* Code for task #91378. See merge request easycorp/zentaopms!7430
This commit is contained in:
@@ -1261,6 +1261,7 @@ class doc extends control
|
||||
$this->view->objectDropdown = $objectDropdown;
|
||||
$this->view->canExport = ($this->config->edition != 'open' && common::hasPriv('doc', $type . '2export'));
|
||||
$this->view->exportMethod = $type . '2export';
|
||||
$this->view->editors = $this->doc->getEditors($docID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -78,3 +78,7 @@
|
||||
#outlineMenu::-moz-scrollbar,
|
||||
#hostory::-moz-scrollbar {height: 0px; width: 0px; background: transparent;}
|
||||
.main-col iframe {min-height: unset;}
|
||||
|
||||
#editorBox > .btn-group > button {margin: 2px 6px 0 4px; color: #838A9D;}
|
||||
#editorMenu {max-height: 200px; overflow: auto;}
|
||||
#editorMenu > li {color: #838A9D; font-weight: 400; padding: 5px 12px;}
|
||||
|
||||
@@ -125,6 +125,7 @@ $lang->doc->position = 'Position';
|
||||
$lang->doc->person = 'Person';
|
||||
$lang->doc->team = 'Team';
|
||||
$lang->doc->manage = 'Document Management';
|
||||
$lang->doc->release = 'Release';
|
||||
|
||||
$lang->doc->moduleDoc = 'Nach Modulen';
|
||||
$lang->doc->searchDoc = 'Suche';
|
||||
|
||||
@@ -125,6 +125,7 @@ $lang->doc->position = 'Position';
|
||||
$lang->doc->person = 'Person';
|
||||
$lang->doc->team = 'Team';
|
||||
$lang->doc->manage = 'Document Management';
|
||||
$lang->doc->release = 'Release';
|
||||
|
||||
$lang->doc->moduleDoc = 'By Module';
|
||||
$lang->doc->searchDoc = 'Search';
|
||||
|
||||
@@ -125,6 +125,7 @@ $lang->doc->position = 'Position';
|
||||
$lang->doc->person = 'Person';
|
||||
$lang->doc->team = 'Team';
|
||||
$lang->doc->manage = 'Document Management';
|
||||
$lang->doc->release = 'Release';
|
||||
|
||||
$lang->doc->moduleDoc = 'Par Module';
|
||||
$lang->doc->searchDoc = 'Rechercher';
|
||||
|
||||
@@ -125,6 +125,7 @@ $lang->doc->position = '所在位置';
|
||||
$lang->doc->person = '个人';
|
||||
$lang->doc->team = '团队';
|
||||
$lang->doc->manage = '文档管理';
|
||||
$lang->doc->release = '发布';
|
||||
|
||||
$lang->doc->moduleDoc = '按模块浏览';
|
||||
$lang->doc->searchDoc = '搜索';
|
||||
|
||||
@@ -768,6 +768,19 @@ class docModel extends model
|
||||
$version = $version ? $version : $doc->version;
|
||||
$docContent = $this->dao->select('*')->from(TABLE_DOCCONTENT)->where('doc')->eq($doc->id)->andWhere('version')->eq($version)->fetch();
|
||||
|
||||
$doc->releasedBy = '';
|
||||
$doc->releasedDate = '';
|
||||
if($doc->status == 'normal')
|
||||
{
|
||||
$releaseInfo = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('doc')
|
||||
->andWhere('objectID')->eq($docID)
|
||||
->andWhere('action')->eq('releaseddoc')
|
||||
->fetch();
|
||||
$doc->releasedBy = $releaseInfo ? $releaseInfo->actor : $doc->addedBy;
|
||||
$doc->releasedDate = $releaseInfo ? $releaseInfo->date : $doc->addedDate;
|
||||
}
|
||||
|
||||
/* When file change then version add one. */
|
||||
$files = $this->loadModel('file')->getByObject('doc', $docID);
|
||||
$docFiles = array();
|
||||
@@ -3409,4 +3422,34 @@ class docModel extends model
|
||||
unset($editingDate[$account]);
|
||||
$this->dao->update(TABLE_DOC)->set('editingDate')->eq(json_encode($editingDate))->where('id')->eq($doc->id)->exec();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get editors by doc id.
|
||||
*
|
||||
* @param int $docID
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getEditors($docID = 0)
|
||||
{
|
||||
if(!$docID) return array();
|
||||
$actions = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectType')->eq('doc')
|
||||
->andWhere('objectID')->eq((int)$docID)
|
||||
->andWhere('action')->in('edited')
|
||||
->orderBy('date_desc')
|
||||
->fetchAll('id');
|
||||
|
||||
$editors = array();
|
||||
foreach($actions as $action)
|
||||
{
|
||||
$editor = new stdclass();
|
||||
$editor->account = $action->actor;
|
||||
$editor->date = $action->date;
|
||||
|
||||
$editors[] = $editor;
|
||||
}
|
||||
|
||||
return $editors;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -69,11 +69,42 @@
|
||||
?>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<?php if(!empty($editors)):?>
|
||||
<div id='editorBox'>
|
||||
<div class="btn-group">
|
||||
<?php
|
||||
$space = common::checkNotCN() ? ' ' : '';
|
||||
$firstEditor = current($editors);
|
||||
$editorInfo = zget($users, $firstEditor->account) . ' ' . substr($firstEditor->date, 0, 10) . $space . $lang->doc->update;
|
||||
|
||||
array_shift($editors);
|
||||
?>
|
||||
<button class="btn pull-right btn-link" data-toggle="dropdown">
|
||||
<span class="text"><?php echo $editorInfo;?></span>
|
||||
<?php if(!empty($editors)):?>
|
||||
<span class="caret"></span>
|
||||
<?php endif;?>
|
||||
</button>
|
||||
<?php if(!empty($editors)):?>
|
||||
<ul class="dropdown-menu" id='editorMenu'>
|
||||
<?php
|
||||
foreach($editors as $editor)
|
||||
{
|
||||
$editorInfo = zget($users, $editor->account) . ' ' . substr($editor->date, 0, 10) . $space . $lang->doc->update;
|
||||
echo "<li>$editorInfo</li>";
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
<div class="">
|
||||
<div class="detail-content article-content table-col">
|
||||
<div class='info'>
|
||||
<span class='user-time text-muted'><i class='icon icon-contacts'></i> <?php echo zget($users, $doc->addedBy) . " {$lang->colon} " . substr($doc->addedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->createAB;?></span>
|
||||
<?php $createInfo = $doc->status == 'draft' ? zget($users, $doc->addedBy) . " {$lang->colon} " . substr($doc->addedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->createAB : zget($users, $doc->releasedBy) . " {$lang->colon} " . substr($doc->releasedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->release;?>
|
||||
<span class='user-time text-muted'><i class='icon icon-contacts'></i> <?php echo $createInfo;?></span>
|
||||
<!-- <span data-url="<?php echo $this->createLink('doc', 'collect', "objectID=$doc->id&objectType=doc");?>" title="<?php echo $lang->doc->collect;?>" class='user-time ajaxCollect text-muted'><?php echo html::image("static/svg/{$star}.svg", "class='$star'");?> <?php echo $doc->collects;?></span> -->
|
||||
<span class='user-time text-muted'><i class='icon-star'></i> <?php echo $doc->collects;?></span>
|
||||
<span class='user-time text-muted'><i class='icon-eye'></i> <?php echo $doc->views;?></span>
|
||||
|
||||
Reference in New Issue
Block a user