* Code for task #90780.

This commit is contained in:
tianshujie
2023-04-11 16:34:29 +08:00
parent 1f026f246a
commit 81e7153c8e
8 changed files with 38 additions and 8 deletions
+6
View File
@@ -273,6 +273,10 @@ $lang->action->desc->unlinkbug = '$date, <strong>$actor</strong> remove bugs <
$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";
/* This parameter describes historical operations that are performed when a document is collected or uncollected. */
$lang->action->desc->collected = '$date, 由 <strong>$actor</strong> collected <strong>$extra</strong>。' . "\n";
$lang->action->desc->uncollected = '$date, 由 <strong>$actor</strong> uncollected <strong>$extra</strong>。' . "\n";
/* Used to display dynamic information. */
$lang->action->label = new stdclass();
$lang->action->label->install = 'install ';
@@ -434,6 +438,8 @@ $lang->action->label->editsnapshot = 'edit snapshot';
$lang->action->label->deletesnapshot = 'deleted snapshot';
$lang->action->label->saveddraft = 'save draft';
$lang->action->label->releaseddoc = 'released';
$lang->action->label->collected = 'collected';
$lang->action->label->uncollected = 'uncollected';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
+6
View File
@@ -273,6 +273,10 @@ $lang->action->desc->unlinkbug = '$date, <strong>$actor</strong> remove bugs <
$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";
/* This parameter describes historical operations that are performed when a document is collected or uncollected. */
$lang->action->desc->collected = '$date, 由 <strong>$actor</strong> collected <strong>$extra</strong>。' . "\n";
$lang->action->desc->uncollected = '$date, 由 <strong>$actor</strong> uncollected <strong>$extra</strong>。' . "\n";
/* Used to display dynamic information. */
$lang->action->label = new stdclass();
$lang->action->label->install = 'install ';
@@ -434,6 +438,8 @@ $lang->action->label->editsnapshot = 'edit snapshot';
$lang->action->label->deletesnapshot = 'deleted snapshot';
$lang->action->label->saveddraft = 'save draft';
$lang->action->label->releaseddoc = 'released';
$lang->action->label->collected = 'collected';
$lang->action->label->uncollected = 'uncollected';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass;
+6
View File
@@ -273,6 +273,10 @@ $lang->action->desc->unlinkbug = '$date, <strong>$actor</strong> remove bugs <
$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";
/* This parameter describes historical operations that are performed when a document is collected or uncollected. */
$lang->action->desc->collected = '$date, 由 <strong>$actor</strong> collected <strong>$extra</strong>。' . "\n";
$lang->action->desc->uncollected = '$date, 由 <strong>$actor</strong> uncollected <strong>$extra</strong>。' . "\n";
/* Used to display dynamic information. */
$lang->action->label = new stdclass();
$lang->action->label->install = 'install ';
@@ -434,6 +438,8 @@ $lang->action->label->editsnapshot = 'edit snapshot';
$lang->action->label->deletesnapshot = 'deleted snapshot';
$lang->action->label->saveddraft = 'save draft';
$lang->action->label->releaseddoc = 'released';
$lang->action->label->collected = 'collected';
$lang->action->label->uncollected = 'uncollected';
/* Dynamic information is grouped by object. */
$lang->action->dynamicAction = new stdclass();
+6
View File
@@ -273,6 +273,10 @@ $lang->action->desc->unlinkbug = '$date, 由 <strong>$actor</strong> 从计划
$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->desc->collected = '$date, 由 <strong>$actor</strong> 收藏 <strong>$extra</strong>。' . "\n";
$lang->action->desc->uncollected = '$date, 由 <strong>$actor</strong> 取消收藏 <strong>$extra</strong>。' . "\n";
/* 用来显示动态信息。*/
$lang->action->label = new stdclass();
$lang->action->label->install = '安装了';
@@ -434,6 +438,8 @@ $lang->action->label->editsnapshot = '编辑了快照';
$lang->action->label->deletesnapshot = '编辑了快照';
$lang->action->label->saveddraft = '存为草稿';
$lang->action->label->releaseddoc = '发布了';
$lang->action->label->collected = '收藏了';
$lang->action->label->uncollected = '取消收藏了';
/* 动态信息按照对象分组 */
$lang->action->dynamicAction = new stdclass();
+6 -4
View File
@@ -2,14 +2,16 @@
<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 .timeline > li .timeline-text {max-width: 600px; display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; 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.active:before {left: -30px; background-color: #FFF;}
.timeline > li.collected > div:after {background-color: #FFAF65;}
.timeline > li.releaseddoc > div:after {background-color: #66A2FF;}
.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;}
@@ -21,8 +23,8 @@
foreach($actions as $action)
{
$user = zget($users, $action->actor);
$class = $action->major ? "class='active'" : '';
echo "<li $class><div>";
$class = in_array($action->action, array('releaseddoc', 'collected')) ? "active {$action->action}" : '';
echo "<li class='$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>";
+1 -1
View File
@@ -2,7 +2,7 @@
<div class='empty-tip'><?php echo $lang->block->emptyTip;?></div>
<?php else:?>
<style>
.block-dynamic .timeline > li .timeline-text {max-width: 600px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-height: 20px;}
.block-dynamic .timeline > li .timeline-text {max-width: 600px; display: block; white-space: nowrap; overflow: hidden; text-overflow: clip; max-height: 20px;}
.block-dynamic .panel-body {padding-top: 0;}
.timeline > li:before {left: -26px;}
.timeline > li + li:after {left: -23px;}
+5 -3
View File
@@ -375,7 +375,7 @@ class doc extends control
$fileAction = '';
if(!empty($files)) $fileAction = $this->lang->addFiles . join(',', $files) . "\n";
$actionType = $_POST['status'] == 'draft' ? 'saveDraft' : 'releaseDoc';
$actionType = $_POST['status'] == 'draft' ? 'savedDraft' : 'releasedDoc';
$this->action->create('doc', $docID, $actionType, $fileAction);
if($this->viewType == 'json') return $this->send(array('result' => 'success', 'message' => $this->lang->saveSuccess, 'id' => $docID));
@@ -539,8 +539,8 @@ class doc extends control
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 == 'draft' and $newType == 'draft') $action = 'savedDraft';
if($doc->status == 'draft' and $newType == 'normal') $action = 'releasedDoc';
if($doc->status == 'normal' and $newType == 'normal') $action = 'Edited';
}
$fileAction = '';
@@ -767,10 +767,12 @@ class doc extends control
if($action)
{
$this->doc->deleteAction($action->id);
$this->action->create('doc', $objectID, 'uncollected');
}
else
{
$this->doc->createAction($objectID, 'collect');
$this->action->create('doc', $objectID, 'collected');
}
return $this->send(array('status' => $action ? 'no' : 'yes'));
+2
View File
@@ -289,6 +289,8 @@ $(document).ready(function()
$(document).on('mousedown', '.ajaxCollect', function (event)
{
if(event.button != 0) return;
var obj = $(this);
var url = obj.data('url');
$.get(url, function(response)