* Code for task #90780.
This commit is contained in:
@@ -269,6 +269,10 @@ $lang->action->desc->linkbug = '$date, <strong>$actor</strong> link bugs <st
|
||||
$lang->action->desc->unlinkstory = '$date, <strong>$actor</strong> remove stories <strong>$extra</strong> from plan.' . "\n";
|
||||
$lang->action->desc->unlinkbug = '$date, <strong>$actor</strong> remove bugs <strong>$extra</strong> from plan.' . "\n";
|
||||
|
||||
/* Describes the history of operations when a document is saved as a draft or released. */
|
||||
$lang->action->desc->saveddraft = '$date, 由 <strong>$actor</strong> save draft <strong>$extra</strong>。' . "\n";
|
||||
$lang->action->desc->releaseddoc = '$date, 由 <strong>$actor</strong> released <strong>$extra</strong>。' . "\n";
|
||||
|
||||
/* Used to display dynamic information. */
|
||||
$lang->action->label = new stdclass();
|
||||
$lang->action->label->install = 'install ';
|
||||
@@ -428,6 +432,8 @@ $lang->action->label->createdsnapshot = 'create snapshot';
|
||||
$lang->action->label->restoredsnapshot = 'create snapshot';
|
||||
$lang->action->label->editsnapshot = 'edit snapshot';
|
||||
$lang->action->label->deletesnapshot = 'deleted snapshot';
|
||||
$lang->action->label->saveddraft = 'save draft';
|
||||
$lang->action->label->releaseddoc = 'released';
|
||||
|
||||
/* Dynamic information is grouped by object. */
|
||||
$lang->action->dynamicAction = new stdclass;
|
||||
|
||||
@@ -269,6 +269,10 @@ $lang->action->desc->linkbug = '$date, <strong>$actor</strong> link bugs <st
|
||||
$lang->action->desc->unlinkstory = '$date, <strong>$actor</strong> remove stories <strong>$extra</strong> from plan.' . "\n";
|
||||
$lang->action->desc->unlinkbug = '$date, <strong>$actor</strong> remove bugs <strong>$extra</strong> from plan.' . "\n";
|
||||
|
||||
/* Describes the history of operations when a document is saved as a draft or released. */
|
||||
$lang->action->desc->saveddraft = '$date, 由 <strong>$actor</strong> save draft <strong>$extra</strong>。' . "\n";
|
||||
$lang->action->desc->releaseddoc = '$date, 由 <strong>$actor</strong> released <strong>$extra</strong>。' . "\n";
|
||||
|
||||
/* Used to display dynamic information. */
|
||||
$lang->action->label = new stdclass();
|
||||
$lang->action->label->install = 'install ';
|
||||
@@ -428,6 +432,8 @@ $lang->action->label->createdsnapshot = 'create snapshot';
|
||||
$lang->action->label->restoredsnapshot = 'create snapshot';
|
||||
$lang->action->label->editsnapshot = 'edit snapshot';
|
||||
$lang->action->label->deletesnapshot = 'deleted snapshot';
|
||||
$lang->action->label->saveddraft = 'save draft';
|
||||
$lang->action->label->releaseddoc = 'released';
|
||||
|
||||
/* Dynamic information is grouped by object. */
|
||||
$lang->action->dynamicAction = new stdclass;
|
||||
|
||||
@@ -269,6 +269,10 @@ $lang->action->desc->linkbug = '$date, <strong>$actor</strong> link bugs <st
|
||||
$lang->action->desc->unlinkstory = '$date, <strong>$actor</strong> remove stories <strong>$extra</strong> from plan.' . "\n";
|
||||
$lang->action->desc->unlinkbug = '$date, <strong>$actor</strong> remove bugs <strong>$extra</strong> from plan.' . "\n";
|
||||
|
||||
/* Describes the history of operations when a document is saved as a draft or released. */
|
||||
$lang->action->desc->saveddraft = '$date, 由 <strong>$actor</strong> save draft <strong>$extra</strong>。' . "\n";
|
||||
$lang->action->desc->releaseddoc = '$date, 由 <strong>$actor</strong> released <strong>$extra</strong>。' . "\n";
|
||||
|
||||
/* Used to display dynamic information. */
|
||||
$lang->action->label = new stdclass();
|
||||
$lang->action->label->install = 'install ';
|
||||
@@ -428,6 +432,8 @@ $lang->action->label->createdsnapshot = 'create snapshot';
|
||||
$lang->action->label->restoredsnapshot = 'create snapshot';
|
||||
$lang->action->label->editsnapshot = 'edit snapshot';
|
||||
$lang->action->label->deletesnapshot = 'deleted snapshot';
|
||||
$lang->action->label->saveddraft = 'save draft';
|
||||
$lang->action->label->releaseddoc = 'released';
|
||||
|
||||
/* Dynamic information is grouped by object. */
|
||||
$lang->action->dynamicAction = new stdclass();
|
||||
|
||||
@@ -269,6 +269,10 @@ $lang->action->desc->linkbug = '$date, 由 <strong>$actor</strong> 关联BUG
|
||||
$lang->action->desc->unlinkstory = '$date, 由 <strong>$actor</strong> 从计划移除需求 <strong>$extra</strong>。' . "\n";
|
||||
$lang->action->desc->unlinkbug = '$date, 由 <strong>$actor</strong> 从计划移除BUG <strong>$extra</strong>。' . "\n";
|
||||
|
||||
/* 用来描述文档保存为草稿或发布时的历史操作记录。*/
|
||||
$lang->action->desc->saveddraft = '$date, 由 <strong>$actor</strong> 存为草稿 <strong>$extra</strong>。' . "\n";
|
||||
$lang->action->desc->releaseddoc = '$date, 由 <strong>$actor</strong> 发布 <strong>$extra</strong>。' . "\n";
|
||||
|
||||
/* 用来显示动态信息。*/
|
||||
$lang->action->label = new stdclass();
|
||||
$lang->action->label->install = '安装了';
|
||||
@@ -428,6 +432,8 @@ $lang->action->label->createdsnapshot = '创建了快照';
|
||||
$lang->action->label->restoredsnapshot = '还原了快照';
|
||||
$lang->action->label->editsnapshot = '编辑了快照';
|
||||
$lang->action->label->deletesnapshot = '编辑了快照';
|
||||
$lang->action->label->saveddraft = '存为草稿';
|
||||
$lang->action->label->releaseddoc = '发布了';
|
||||
|
||||
/* 动态信息按照对象分组 */
|
||||
$lang->action->dynamicAction = new stdclass();
|
||||
|
||||
@@ -2052,6 +2052,12 @@ class block extends control
|
||||
*/
|
||||
public function printDocDynamicBlock()
|
||||
{
|
||||
/* Load pager. */
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager(0, 30, 1);
|
||||
|
||||
$this->view->actions = $this->loadModel('doc')->getDynamic($pager);
|
||||
$this->view->users = $this->loadModel('user')->getPairs('nodeleted|noletter|all');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php if(empty($actions)): ?>
|
||||
<div class='empty-tip'><?php echo $lang->block->emptyTip;?></div>
|
||||
<?php else:?>
|
||||
<style>
|
||||
.block-docdynamic .timeline > li .timeline-text {max-width: 600px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 20px;}
|
||||
.block-docdynamic .panel-body {padding-top: 0;}
|
||||
.timeline > li:before {left: -26px;}
|
||||
.timeline > li + li:after {left: -23px;}
|
||||
.timeline-text {margin-left: -18px;}
|
||||
.block-docdynamic .label-action {padding: 0 6px;}
|
||||
.block-docdynamic .label-action + a {padding-left: 6px;}
|
||||
.timeline > li.active:before {left: -30px;}
|
||||
.timeline > li > div:after {left: -27px;}
|
||||
.timeline > li > div > .timeline-tag, .timeline > li > div > .timeline-text > .label-action {color: #838A9D;}
|
||||
.timeline > li > div > .timeline-text > a {color: #313C52;}
|
||||
</style>
|
||||
<div class='panel-body scrollbar-hover'>
|
||||
<ul class="timeline timeline-tag-left no-margin">
|
||||
<?php
|
||||
$i = 0;
|
||||
foreach($actions as $action)
|
||||
{
|
||||
$user = zget($users, $action->actor);
|
||||
$class = $action->major ? "class='active'" : '';
|
||||
echo "<li $class><div>";
|
||||
if($action->objectLink) printf($lang->block->dynamicInfo, $action->date, $user, $action->actionLabel, $action->objectLabel, $action->objectLink, $action->objectName, $action->objectName);
|
||||
if(!$action->objectLink) printf($lang->block->noLinkDynamic, $action->date, $action->objectName, $user, $action->actionLabel, $action->objectLabel, ' ' . $action->objectName);
|
||||
echo "</div></li>";
|
||||
$i++;
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif;?>
|
||||
|
||||
+12
-3
@@ -375,7 +375,8 @@ class doc extends control
|
||||
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n";
|
||||
$this->action->create('doc', $docID, 'Created', $fileAction);
|
||||
$actionType = $_POST['status'] == 'draft' ? 'saveDraft' : 'releaseDoc';
|
||||
$this->action->create('doc', $docID, $actionType, $fileAction);
|
||||
|
||||
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID));
|
||||
$objectID = zget($lib, $lib->type, 0);
|
||||
@@ -521,6 +522,8 @@ class doc extends control
|
||||
*/
|
||||
public function edit($docID, $comment = false, $objectType = '', $objectID = 0, $libID = 0, $from = 'edit')
|
||||
{
|
||||
$doc = $this->doc->getById($docID);
|
||||
|
||||
if(!empty($_POST))
|
||||
{
|
||||
if($comment == false || $comment == 'false')
|
||||
@@ -532,7 +535,14 @@ class doc extends control
|
||||
}
|
||||
if($this->post->comment != '' or !empty($changes) or !empty($files))
|
||||
{
|
||||
$action = !empty($changes) ? 'Edited' : 'Commented';
|
||||
$action = 'Commented';
|
||||
if(!empty($changes))
|
||||
{
|
||||
$newType = $_POST['status'];
|
||||
if($doc->status == 'draft' and $newType == 'draft') $action = 'saveDraft';
|
||||
if($doc->status == 'draft' and $newType == 'normal') $action = 'releaseDoc';
|
||||
if($doc->status == 'normal' and $newType == 'normal') $action = 'Edited';
|
||||
}
|
||||
$fileAction = '';
|
||||
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n";
|
||||
$actionID = $this->action->create('doc', $docID, $action, $fileAction . $this->post->comment);
|
||||
@@ -554,7 +564,6 @@ class doc extends control
|
||||
}
|
||||
|
||||
/* Get doc and set menu. */
|
||||
$doc = $this->doc->getById($docID);
|
||||
$libID = $doc->lib;
|
||||
|
||||
if($doc->contentType == 'markdown') $this->config->doc->markdown->edit = array('id' => 'content', 'tools' => 'toolbar');
|
||||
|
||||
@@ -3350,4 +3350,23 @@ class docModel extends model
|
||||
|
||||
return $otherEditing;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get document dynamic.
|
||||
*
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getDynamic($pager = null)
|
||||
{
|
||||
$actions = $this->dao->select('*')->from(TABLE_ACTION)
|
||||
->where('objectType')->in('doclib,doc')
|
||||
->andWhere('vision')->eq($this->config->vision)
|
||||
->orderBy('date_desc')
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
|
||||
return $this->loadModel('action')->transformActions($actions);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user