Differential D25018 Diff 57 src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/legalpad/query/LegalpadDocumentSignatureSearchEngine.php
<?php | <?php | |||||||||||||||||
final class LegalpadDocumentSignatureSearchEngine | final class LegalpadDocumentSignatureSearchEngine | |||||||||||||||||
extends PhabricatorApplicationSearchEngine { | extends PhabricatorApplicationSearchEngine { | |||||||||||||||||
private $document; | private $document; | |||||||||||||||||
public function newQuery() { | ||||||||||||||||||
return new LegalpadDocumentSignatureQuery(); | ||||||||||||||||||
} | ||||||||||||||||||
protected function buildCustomSearchFields() { | ||||||||||||||||||
return array( | ||||||||||||||||||
id(new PhabricatorUsersSearchField()) | ||||||||||||||||||
->setLabel(pht('Signed By')) | ||||||||||||||||||
->setKey('signerPHIDs') | ||||||||||||||||||
->setAliases(array('signer', 'signers', 'signerPHID')) | ||||||||||||||||||
->setDescription( | ||||||||||||||||||
pht('Search for signatures by given users.')), | ||||||||||||||||||
id(new PhabricatorPHIDsSearchField()) | ||||||||||||||||||
->setLabel(pht('Documents')) | ||||||||||||||||||
->setKey('documentPHIDs') | ||||||||||||||||||
->setAliases(array('document', 'documents', 'documentPHID')) | ||||||||||||||||||
->setDescription( | ||||||||||||||||||
pht('Search for signatures on the given documents')), | ||||||||||||||||||
id(new PhabricatorSearchTextField()) | ||||||||||||||||||
20after4Unsubmitted Done Inline Actions
20after4: | ||||||||||||||||||
->setLabel(pht('Name Contains')) | ||||||||||||||||||
->setKey('nameContains') | ||||||||||||||||||
->setDescription( | ||||||||||||||||||
pht('Search for signatures with a name containing the '. | ||||||||||||||||||
'given string.')), | ||||||||||||||||||
id(new PhabricatorSearchTextField()) | ||||||||||||||||||
->setLabel(pht('Email Contains')) | ||||||||||||||||||
->setKey('emailContains') | ||||||||||||||||||
->setDescription( | ||||||||||||||||||
pht('Search for signatures with an email containing the '. | ||||||||||||||||||
'given string.')), | ||||||||||||||||||
id(new PhabricatorSearchDateField()) | ||||||||||||||||||
->setLabel(pht('Created After')) | ||||||||||||||||||
->setKey('createdStart'), | ||||||||||||||||||
id(new PhabricatorSearchDateField()) | ||||||||||||||||||
->setLabel(pht('Created Before')) | ||||||||||||||||||
->setKey('createdEnd'), | ||||||||||||||||||
); | ||||||||||||||||||
} | ||||||||||||||||||
Done Inline Actions
20after4: | ||||||||||||||||||
protected function buildQueryFromParameters(array $map) { | ||||||||||||||||||
$query = $this->newQuery(); | ||||||||||||||||||
if ($map['signerPHIDs']) { | ||||||||||||||||||
$query->withSignerPHIDs($map['signerPHIDs']); | ||||||||||||||||||
} | ||||||||||||||||||
if ($map['documentPHIDs']) { | ||||||||||||||||||
$query->withDocumentPHIDs($map['documentPHIDs']); | ||||||||||||||||||
} | ||||||||||||||||||
if ($map['createdStart']) { | ||||||||||||||||||
$query->withDateCreatedAfter($map['createdStart']); | ||||||||||||||||||
} | ||||||||||||||||||
if ($map['createdEnd']) { | ||||||||||||||||||
$query->withDateCreatedAfter($map['createdStart']); | ||||||||||||||||||
} | ||||||||||||||||||
if ($map['nameContains']) { | ||||||||||||||||||
$query->withNameContains($map['nameContains']); | ||||||||||||||||||
} | ||||||||||||||||||
if ($map['emailContains']) { | ||||||||||||||||||
$query->withEmailContains($map['emailContains']); | ||||||||||||||||||
} | ||||||||||||||||||
return $query; | ||||||||||||||||||
} | ||||||||||||||||||
public function getResultTypeDescription() { | public function getResultTypeDescription() { | |||||||||||||||||
return pht('Legalpad Signatures'); | return pht('Legalpad Signatures'); | |||||||||||||||||
} | } | |||||||||||||||||
public function getApplicationClassName() { | public function getApplicationClassName() { | |||||||||||||||||
return 'PhabricatorLegalpadApplication'; | return 'PhabricatorLegalpadApplication'; | |||||||||||||||||
} | } | |||||||||||||||||
▲ Show 20 Lines • Show All 300 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0