Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/query/PhabricatorPeopleSearchEngine.php
| Show All 16 Lines | return id(new PhabricatorPeopleQuery()) | ||||
| ->needProfileImage(true); | ->needProfileImage(true); | ||||
| } | } | ||||
| protected function buildCustomSearchFields() { | protected function buildCustomSearchFields() { | ||||
| return array( | return array( | ||||
| id(new PhabricatorSearchStringListField()) | id(new PhabricatorSearchStringListField()) | ||||
| ->setLabel(pht('Usernames')) | ->setLabel(pht('Usernames')) | ||||
| ->setKey('usernames') | ->setKey('usernames') | ||||
| ->setAliases(array('username')), | ->setAliases(array('username')) | ||||
| ->setDescription(pht('Find users by exact username.')), | |||||
| id(new PhabricatorSearchTextField()) | id(new PhabricatorSearchTextField()) | ||||
| ->setLabel(pht('Name Contains')) | ->setLabel(pht('Name Contains')) | ||||
| ->setKey('nameLike'), | ->setKey('nameLike') | ||||
| ->setDescription( | |||||
| pht('Find users whose usernames contain a substring.')), | |||||
| id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
| ->setLabel(pht('Administrators')) | ->setLabel(pht('Administrators')) | ||||
| ->setKey('isAdmin') | ->setKey('isAdmin') | ||||
| ->setOptions( | ->setOptions( | ||||
| pht('(Show All)'), | pht('(Show All)'), | ||||
| pht('Show Only Administrators'), | pht('Show Only Administrators'), | ||||
| pht('Hide Administrators')), | pht('Hide Administrators')) | ||||
| ->setDescription( | |||||
| pht( | |||||
| 'Pass true to find only administrators, or false to omit '. | |||||
| 'administrators.')), | |||||
| id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
| ->setLabel(pht('Disabled')) | ->setLabel(pht('Disabled')) | ||||
| ->setKey('isDisabled') | ->setKey('isDisabled') | ||||
| ->setOptions( | ->setOptions( | ||||
| pht('(Show All)'), | pht('(Show All)'), | ||||
| pht('Show Only Disabled Users'), | pht('Show Only Disabled Users'), | ||||
| pht('Hide Disabled Users')), | pht('Hide Disabled Users')) | ||||
| ->setDescription( | |||||
| pht( | |||||
| 'Pass true to find only disabled users, or false to omit '. | |||||
| 'disabled users.')), | |||||
| id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
| ->setLabel(pht('Bots')) | ->setLabel(pht('Bots')) | ||||
| ->setKey('isSystemAgent') | ->setKey('isBot') | ||||
| ->setAliases(array('isSystemAgent')) | |||||
| ->setOptions( | ->setOptions( | ||||
| pht('(Show All)'), | pht('(Show All)'), | ||||
| pht('Show Only Bots'), | pht('Show Only Bots'), | ||||
| pht('Hide Bots')), | pht('Hide Bots')) | ||||
| ->setDescription( | |||||
| pht( | |||||
| 'Pass true to find only bots, or false to omit bots.')), | |||||
| id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
| ->setLabel(pht('Mailing Lists')) | ->setLabel(pht('Mailing Lists')) | ||||
| ->setKey('isMailingList') | ->setKey('isMailingList') | ||||
| ->setOptions( | ->setOptions( | ||||
| pht('(Show All)'), | pht('(Show All)'), | ||||
| pht('Show Only Mailing Lists'), | pht('Show Only Mailing Lists'), | ||||
| pht('Hide Mailing Lists')), | pht('Hide Mailing Lists')) | ||||
| ->setDescription( | |||||
| pht( | |||||
| 'Pass true to find only mailing lists, or false to omit '. | |||||
| 'mailing lists.')), | |||||
| id(new PhabricatorSearchThreeStateField()) | id(new PhabricatorSearchThreeStateField()) | ||||
| ->setLabel(pht('Needs Approval')) | ->setLabel(pht('Needs Approval')) | ||||
| ->setKey('needsApproval') | ->setKey('needsApproval') | ||||
| ->setOptions( | ->setOptions( | ||||
| pht('(Show All)'), | pht('(Show All)'), | ||||
| pht('Show Only Unapproved Users'), | pht('Show Only Unapproved Users'), | ||||
| pht('Hide Unappproved Users')), | pht('Hide Unappproved Users')) | ||||
| ->setDescription( | |||||
| pht( | |||||
| 'Pass true to find only users awaiting administrative approval, '. | |||||
| 'or false to omit these users.')), | |||||
| id(new PhabricatorSearchDateField()) | id(new PhabricatorSearchDateField()) | ||||
| ->setKey('createdStart') | ->setKey('createdStart') | ||||
| ->setLabel(pht('Joined After')), | ->setLabel(pht('Joined After')) | ||||
| ->setDescription( | |||||
| pht('Find user accounts created after a given time.')), | |||||
| id(new PhabricatorSearchDateField()) | id(new PhabricatorSearchDateField()) | ||||
| ->setKey('createdEnd') | ->setKey('createdEnd') | ||||
| ->setLabel(pht('Joined Before')), | ->setLabel(pht('Joined Before')) | ||||
| ->setDescription( | |||||
| pht('Find user accounts created before a given time.')), | |||||
| ); | ); | ||||
| } | } | ||||
| protected function getDefaultFieldOrder() { | protected function getDefaultFieldOrder() { | ||||
| return array( | return array( | ||||
| '...', | '...', | ||||
| 'createdStart', | 'createdStart', | ||||
| 'createdEnd', | 'createdEnd', | ||||
| Show All 32 Lines | protected function buildQueryFromParameters(array $map) { | ||||
| if ($map['isDisabled'] !== null) { | if ($map['isDisabled'] !== null) { | ||||
| $query->withIsDisabled($map['isDisabled']); | $query->withIsDisabled($map['isDisabled']); | ||||
| } | } | ||||
| if ($map['isMailingList'] !== null) { | if ($map['isMailingList'] !== null) { | ||||
| $query->withIsMailingList($map['isMailingList']); | $query->withIsMailingList($map['isMailingList']); | ||||
| } | } | ||||
| if ($map['isSystemAgent'] !== null) { | if ($map['isBot'] !== null) { | ||||
| $query->withIsSystemAgent($map['isSystemAgent']); | $query->withIsSystemAgent($map['isBot']); | ||||
| } | } | ||||
| if ($map['needsApproval'] !== null) { | if ($map['needsApproval'] !== null) { | ||||
| $query->withIsApproved(!$map['needsApproval']); | $query->withIsApproved(!$map['needsApproval']); | ||||
| } | } | ||||
| if ($map['createdStart']) { | if ($map['createdStart']) { | ||||
| $query->withDateCreatedAfter($map['createdStart']); | $query->withDateCreatedAfter($map['createdStart']); | ||||
| ▲ Show 20 Lines • Show All 130 Lines • Show Last 20 Lines | |||||