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:
parent
7fac80cb9a
commit
bf4f74dbb3
1 changed files with 12 additions and 1 deletions
|
@ -18,12 +18,13 @@ final class PhrictionListController
|
||||||
$user = $request->getUser();
|
$user = $request->getUser();
|
||||||
|
|
||||||
$views = array(
|
$views = array(
|
||||||
|
'active' => 'Active Documents',
|
||||||
'all' => 'All Documents',
|
'all' => 'All Documents',
|
||||||
'updates' => 'Recently Updated',
|
'updates' => 'Recently Updated',
|
||||||
);
|
);
|
||||||
|
|
||||||
if (empty($views[$this->view])) {
|
if (empty($views[$this->view])) {
|
||||||
$this->view = 'all';
|
$this->view = 'active';
|
||||||
}
|
}
|
||||||
|
|
||||||
$nav = new AphrontSideNavView();
|
$nav = new AphrontSideNavView();
|
||||||
|
@ -86,6 +87,7 @@ final class PhrictionListController
|
||||||
));
|
));
|
||||||
|
|
||||||
$view_headers = array(
|
$view_headers = array(
|
||||||
|
'active' => 'Active Documents',
|
||||||
'all' => 'All Documents',
|
'all' => 'All Documents',
|
||||||
'updates' => 'Recently Updated Documents',
|
'updates' => 'Recently Updated Documents',
|
||||||
);
|
);
|
||||||
|
@ -113,6 +115,15 @@ final class PhrictionListController
|
||||||
$conn = $document_dao->establishConnection('r');
|
$conn = $document_dao->establishConnection('r');
|
||||||
|
|
||||||
switch ($this->view) {
|
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':
|
case 'all':
|
||||||
$data = queryfx_all(
|
$data = queryfx_all(
|
||||||
$conn,
|
$conn,
|
||||||
|
|
Loading…
Reference in a new issue