From bf4f74dbb3442a9d00d5438a743f662650e73960 Mon Sep 17 00:00:00 2001 From: Ricky Elrod Date: Thu, 15 Nov 2012 16:34:36 -0800 Subject: [PATCH] Don't show deleted pages from the 'All Documents' panel. Summary: If a user is asking for a list of documents stored in Phriction, it's pretty safe to assume that they mean documents that actually exist. Test Plan: Made a document, saw it listed in /phriction/list/all. Deleted it, and no longer saw it. Reviewers: epriestley Reviewed By: epriestley CC: aran, Korvin Differential Revision: https://secure.phabricator.com/D3951 --- .../controller/PhrictionListController.php | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/applications/phriction/controller/PhrictionListController.php b/src/applications/phriction/controller/PhrictionListController.php index 255f82f79e..45cca58155 100644 --- a/src/applications/phriction/controller/PhrictionListController.php +++ b/src/applications/phriction/controller/PhrictionListController.php @@ -18,12 +18,13 @@ final class PhrictionListController $user = $request->getUser(); $views = array( + 'active' => 'Active Documents', 'all' => 'All Documents', 'updates' => 'Recently Updated', ); if (empty($views[$this->view])) { - $this->view = 'all'; + $this->view = 'active'; } $nav = new AphrontSideNavView(); @@ -86,6 +87,7 @@ final class PhrictionListController )); $view_headers = array( + 'active' => 'Active Documents', 'all' => 'All Documents', 'updates' => 'Recently Updated Documents', ); @@ -113,6 +115,15 @@ final class PhrictionListController $conn = $document_dao->establishConnection('r'); switch ($this->view) { + case 'active': + $data = queryfx_all( + $conn, + 'SELECT * FROM %T WHERE status != %d ORDER BY id DESC LIMIT %d, %d', + $document_dao->getTableName(), + PhrictionDocumentStatus::STATUS_DELETED, + $pager->getOffset(), + $pager->getPageSize() + 1); + break; case 'all': $data = queryfx_all( $conn,