diff --git a/module/doc/control.php b/module/doc/control.php index 19067ff842..8a6791bf55 100755 --- a/module/doc/control.php +++ b/module/doc/control.php @@ -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(); } diff --git a/module/doc/css/view.css b/module/doc/css/view.css index 8dd0aafb98..726d815580 100644 --- a/module/doc/css/view.css +++ b/module/doc/css/view.css @@ -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;} diff --git a/module/doc/lang/de.php b/module/doc/lang/de.php index 414e02d102..6ac3ba9ce4 100644 --- a/module/doc/lang/de.php +++ b/module/doc/lang/de.php @@ -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'; diff --git a/module/doc/lang/en.php b/module/doc/lang/en.php index d8f4a0de89..6d0d61acd0 100644 --- a/module/doc/lang/en.php +++ b/module/doc/lang/en.php @@ -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'; diff --git a/module/doc/lang/fr.php b/module/doc/lang/fr.php index 1cf8e58da5..c7927db948 100644 --- a/module/doc/lang/fr.php +++ b/module/doc/lang/fr.php @@ -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'; diff --git a/module/doc/lang/zh-cn.php b/module/doc/lang/zh-cn.php index fc3fcfb248..e37a0f39f2 100644 --- a/module/doc/lang/zh-cn.php +++ b/module/doc/lang/zh-cn.php @@ -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 = '搜索'; diff --git a/module/doc/model.php b/module/doc/model.php index 60bea0d7c5..f876bba434 100644 --- a/module/doc/model.php +++ b/module/doc/model.php @@ -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; + } } diff --git a/module/doc/view/content.html.php b/module/doc/view/content.html.php index 7332c8b3a4..6a6ce30c3a 100644 --- a/module/doc/view/content.html.php +++ b/module/doc/view/content.html.php @@ -69,11 +69,42 @@ ?> + +
+
+ account) . ' ' . substr($firstEditor->date, 0, 10) . $space . $lang->doc->update; + + array_shift($editors); + ?> + + + + +
+
+
- addedBy) . " {$lang->colon} " . substr($doc->addedDate, 0, 10) . (common::checkNotCN() ? ' ' : '') . $lang->doc->createAB;?> + 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;?> + collects;?> views;?>