1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-23 05:50:55 +01:00

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
This commit is contained in:
Ricky Elrod 2012-11-15 16:34:36 -08:00 committed by epriestley
parent 7fac80cb9a
commit bf4f74dbb3

View file

@ -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,