diff --git a/module/action/control.php b/module/action/control.php index 35bd340480..7382d78409 100644 --- a/module/action/control.php +++ b/module/action/control.php @@ -14,6 +14,7 @@ class action extends control /** * Trash * + * @param string $type all|hidden * @param string $orderBy * @param int $recTotal * @param int $recPerPage @@ -21,7 +22,7 @@ class action extends control * @access public * @return void */ - public function trash($orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) + public function trash($type = 'all', $orderBy = 'id_desc', $recTotal = 0, $recPerPage = 20, $pageID = 1) { /* Save session. */ $uri = $this->app->getURI(true); @@ -40,13 +41,14 @@ class action extends control /* Get deleted objects. */ $this->app->loadClass('pager', $static = true); $pager = pager::init($recTotal, $recPerPage, $pageID); - $trashes = $this->action->getTrashes($orderBy, $pager); + $trashes = $this->action->getTrashes($type, $orderBy, $pager); /* Title and position. */ $this->view->title = $this->lang->action->trash; $this->view->position[] = $this->lang->action->trash; $this->view->trashes = $trashes; + $this->view->type = $type; $this->view->orderBy = $orderBy; $this->view->pager = $pager; $this->view->users = $this->loadModel('user')->getPairs('noletter'); diff --git a/module/action/lang/en.php b/module/action/lang/en.php index eceab1a338..f33c938367 100644 --- a/module/action/lang/en.php +++ b/module/action/lang/en.php @@ -39,6 +39,7 @@ $lang->action->dynamic->lastWeek = 'Last week'; $lang->action->dynamic->thisMonth = 'This month'; $lang->action->dynamic->lastMonth = 'Last month'; $lang->action->dynamic->all = 'All'; +$lang->action->dynamic->hidden = 'Hidden'; $lang->action->dynamic->search = 'Search'; $lang->action->objectTypes['product'] = 'Product'; diff --git a/module/action/lang/zh-cn.php b/module/action/lang/zh-cn.php index d368571cde..0d2f60fb79 100644 --- a/module/action/lang/zh-cn.php +++ b/module/action/lang/zh-cn.php @@ -39,6 +39,7 @@ $lang->action->dynamic->lastWeek = '上周'; $lang->action->dynamic->thisMonth = '本月'; $lang->action->dynamic->lastMonth = '上月'; $lang->action->dynamic->all = '所有'; +$lang->action->dynamic->hidden = '已隐藏'; $lang->action->dynamic->search = '搜索'; $lang->action->objectTypes['product'] = '产品'; diff --git a/module/action/model.php b/module/action/model.php index 9ae18ab770..d5484c2c18 100644 --- a/module/action/model.php +++ b/module/action/model.php @@ -213,16 +213,18 @@ class actionModel extends model /** * Get deleted objects. * + * @param string $type all|hidden * @param string $orderBy * @param object $pager * @access public * @return array */ - public function getTrashes($orderBy, $pager) + public function getTrashes($type, $orderBy, $pager) { + $extra = $type == 'hidden' ? self::BE_HIDDEN : self::CAN_UNDELETED; $trashes = $this->dao->select('*')->from(TABLE_ACTION) ->where('action')->eq('deleted') - ->andWhere('extra')->eq(self::CAN_UNDELETED) + ->andWhere('extra')->eq($extra) ->orderBy($orderBy)->page($pager)->fetchAll(); if(!$trashes) return array(); diff --git a/module/action/view/trash.html.php b/module/action/view/trash.html.php index bfa87f1332..f5ef4d7dee 100644 --- a/module/action/view/trash.html.php +++ b/module/action/view/trash.html.php @@ -13,6 +13,10 @@ + recTotal}&recPerPage={$pager->recPerPage}"; ?> @@ -36,7 +40,7 @@
+ inLink('trash', "type=all"), $lang->goback);?> + inLink('trash', "type=hidden"), $lang->action->dynamic->hidden);?> +
id", '', 'list', '', 'hiddenwin'); - common::printIcon('action', 'hideOne', "actionid=$action->id", '', 'list', '', 'hiddenwin'); + if($type == 'all') common::printIcon('action', 'hideOne', "actionid=$action->id", '', 'list', '', 'hiddenwin'); ?>