Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15556063
D13809.id33390.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D13809.id33390.diff
View Options
diff --git a/src/applications/paste/query/PhabricatorPasteQuery.php b/src/applications/paste/query/PhabricatorPasteQuery.php
--- a/src/applications/paste/query/PhabricatorPasteQuery.php
+++ b/src/applications/paste/query/PhabricatorPasteQuery.php
@@ -14,6 +14,8 @@
private $includeNoLanguage;
private $dateCreatedAfter;
private $dateCreatedBefore;
+ private $statuses;
+
public function withIDs(array $ids) {
$this->ids = $ids;
@@ -67,6 +69,11 @@
return $this;
}
+ public function withStatuses(array $statuses) {
+ $this->statuses = $statuses;
+ return $this;
+ }
+
public function newResultObject() {
return new PhabricatorPaste();
}
@@ -139,6 +146,13 @@
$this->dateCreatedBefore);
}
+ if ($this->statuses !== null) {
+ $where[] = qsprintf(
+ $conn,
+ 'status IN (%Ls)',
+ $this->statuses);
+ }
+
return $where;
}
diff --git a/src/applications/paste/query/PhabricatorPasteSearchEngine.php b/src/applications/paste/query/PhabricatorPasteSearchEngine.php
--- a/src/applications/paste/query/PhabricatorPasteSearchEngine.php
+++ b/src/applications/paste/query/PhabricatorPasteSearchEngine.php
@@ -35,6 +35,10 @@
$query->withDateCreatedBefore($map['createdEnd']);
}
+ if ($map['statuses']) {
+ $query->withStatuses($map['statuses']);
+ }
+
return $query;
}
@@ -53,6 +57,12 @@
id(new PhabricatorSearchDateField())
->setKey('createdEnd')
->setLabel(pht('Created Before')),
+ id(new PhabricatorSearchCheckboxesField())
+ ->setKey('statuses')
+ ->setLabel(pht('Status'))
+ ->setOptions(
+ id(new PhabricatorPaste())
+ ->getStatusNameMap()),
);
}
@@ -70,6 +80,7 @@
protected function getBuiltinQueryNames() {
$names = array(
+ 'active' => pht('Active Pastes'),
'all' => pht('All Pastes'),
);
@@ -86,6 +97,12 @@
$query->setQueryKey($query_key);
switch ($query_key) {
+ case 'active':
+ return $query->setParameter(
+ 'statuses',
+ array(
+ PhabricatorPaste::STATUS_ACTIVE,
+ ));
case 'all':
return $query;
case 'authored':
@@ -151,6 +168,10 @@
->addIcon('none', $line_count)
->appendChild($source_code);
+ if ($paste->isArchived()) {
+ $item->setDisabled(true);
+ }
+
$lang_name = $paste->getLanguage();
if ($lang_name) {
$lang_name = idx($lang_map, $lang_name, $lang_name);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, Apr 29, 2:28 PM (1 w, 3 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7223214
Default Alt Text
D13809.id33390.diff (2 KB)
Attached To
Mode
D13809: Add application search for Paste status
Attached
Detach File
Event Timeline
Log In to Comment