* finish task #919.

This commit is contained in:
wangyidong
2012-11-22 01:41:37 +00:00
parent b5de8a7d75
commit 4aad9ef7bc
5 changed files with 43 additions and 1 deletions
+13
View File
@@ -63,4 +63,17 @@ class action extends control
$this->action->undelete($actionID);
die(js::locate(inlink('trash'), 'parent'));
}
/**
* Hide object.
*
* @param int $actionID
* @access public
* @return void
*/
public function hide($actionID)
{
$this->action->hide($actionID);
die(js::reload('parent'));
}
}
+4
View File
@@ -12,6 +12,7 @@
$lang->action->common = 'Logs';
$lang->action->trash = 'Trash';
$lang->action->undelete = 'Restore';
$lang->action->hide = 'Hide';
$lang->action->product = 'Product';
$lang->action->project = 'Project';
@@ -63,6 +64,7 @@ $lang->action->desc->deletedfile = '$date, deleted file by <strong>$actor</stro
$lang->action->desc->editfile = '$date, edit file by <strong>$actor</strong>, the file is <strong><i>$extra</i></strong>.';
$lang->action->desc->erased = '$date, erased by <strong>$actor</strong>.';
$lang->action->desc->undeleted = '$date, restored by <strong>$actor</strong>.';
$lang->action->desc->hidden = '$date, hidden by <strong>$actor</strong>.';
$lang->action->desc->commented = '$date, commented by <strong>$actor</strong>.';
$lang->action->desc->activated = '$date, activated by <strong>$actor</strong>.';
$lang->action->desc->moved = '$date, moved by <strong>$actor</strong>, previouse is "$extra".';
@@ -89,6 +91,7 @@ $lang->action->label->deletedfile = 'deleted file';
$lang->action->label->editfile = 'edit file name';
$lang->action->label->erased = 'deleted';
$lang->action->label->undeleted = 'restore';
$lang->action->label->hidden = 'hidden';
$lang->action->label->commented = 'commented';
$lang->action->label->activated = 'activated';
$lang->action->label->resolved = 'resolved';
@@ -158,6 +161,7 @@ $lang->action->search->label['deletedfile'] = $lang->action->label->dele
$lang->action->search->label['editfile'] = $lang->action->label->editfile;
$lang->action->search->label['erased'] = $lang->action->label->erased;
$lang->action->search->label['undeleted'] = $lang->action->label->undeleted;
$lang->action->search->label['hidden'] = $lang->action->label->hidden;
$lang->action->search->label['commented'] = $lang->action->label->commented;
$lang->action->search->label['activated'] = $lang->action->label->activated;
$lang->action->search->label['resolved'] = $lang->action->label->resolved;
+4
View File
@@ -12,6 +12,7 @@
$lang->action->common = '系统日志';
$lang->action->trash = '回收站';
$lang->action->undelete = '还原';
$lang->action->hide = '隐藏';
$lang->action->product = '产品';
$lang->action->project = '项目';
@@ -63,6 +64,7 @@ $lang->action->desc->deletedfile = '$date, 由 <strong>$actor</strong> 删除
$lang->action->desc->editfile = '$date, 由 <strong>$actor</strong> 编辑了附件:<strong><i>$extra</i></strong>。' . "\n";
$lang->action->desc->erased = '$date, 由 <strong>$actor</strong> 删除。' . "\n";
$lang->action->desc->undeleted = '$date, 由 <strong>$actor</strong> 还原。' . "\n";
$lang->action->desc->hidden = '$date, 由 <strong>$actor</strong> 隐藏。' . "\n";
$lang->action->desc->commented = '$date, 由 <strong>$actor</strong> 添加备注。' . "\n";
$lang->action->desc->activated = '$date, 由 <strong>$actor</strong> 激活。' . "\n";
$lang->action->desc->moved = '$date, 由 <strong>$actor</strong> 移动,之前为 "$extra"。' . "\n";
@@ -89,6 +91,7 @@ $lang->action->label->deletedfile = '删除附件';
$lang->action->label->editfile = '编辑附件';
$lang->action->label->erased = '删除了';
$lang->action->label->undeleted = '还原了';
$lang->action->label->hidden = '隐藏了';
$lang->action->label->commented = '评论了';
$lang->action->label->activated = '激活了';
$lang->action->label->resolved = '解决了';
@@ -158,6 +161,7 @@ $lang->action->search->label['deletedfile'] = $lang->action->label->dele
$lang->action->search->label['editfile'] = $lang->action->label->editfile;
$lang->action->search->label['erased'] = $lang->action->label->erased;
$lang->action->search->label['undeleted'] = $lang->action->label->undeleted;
$lang->action->search->label['hidden'] = $lang->action->label->hidden;
$lang->action->search->label['commented'] = $lang->action->label->commented;
$lang->action->search->label['activated'] = $lang->action->label->activated;
$lang->action->search->label['resolved'] = $lang->action->label->resolved;
+16
View File
@@ -15,6 +15,7 @@ class actionModel extends model
{
const CAN_UNDELETED = 1; // The deleted object can be undeleted or not.
const BE_UNDELETED = 0; // The deleted object has been undeleted or not.
const BE_HIDDEN = 2;
/**
* Create a action.
@@ -553,4 +554,19 @@ class actionModel extends model
}
}
}
/**
* Hide object.
*
* @param int $actionID
* @access public
* @return void
*/
public function hide($actionID)
{
$action = $this->getById($actionID);
if($action->action != 'deleted') return;
$this->dao->update(TABLE_ACTION)->set('extra')->eq(self::BE_HIDDEN)->where('id')->eq($actionID)->exec();
$this->create($action->objectType, $action->objectID, 'hidden');
}
}
+6 -1
View File
@@ -33,7 +33,12 @@
<td class='a-left'><?php echo html::a($this->createLink($module, 'view', "id=$action->objectID"), $action->objectName);?></td>
<td><?php echo $users[$action->actor];?></td>
<td><?php echo $action->date;?></td>
<td><?php common::printLink('action', 'undelete', "actionid=$action->id", $lang->action->undelete, 'hiddenwin');?>
<td>
<?php
common::printLink('action', 'undelete', "actionid=$action->id", $lang->action->undelete, 'hiddenwin');
common::printLink('action', 'hide', "actionid=$action->id", $lang->action->hide, 'hiddenwin');
?>
</td>
</tr>
<?php endforeach;?>
</tbody>