Changeset View
Changeset View
Standalone View
Standalone View
src/applications/people/query/PhabricatorPeopleSearchEngine.php
| Show All 28 Lines | $saved->setParameter( | ||||
| 'isDisabled', | 'isDisabled', | ||||
| $this->readBoolFromRequest($request, 'isDisabled')); | $this->readBoolFromRequest($request, 'isDisabled')); | ||||
| $saved->setParameter( | $saved->setParameter( | ||||
| 'isSystemAgent', | 'isSystemAgent', | ||||
| $this->readBoolFromRequest($request, 'isSystemAgent')); | $this->readBoolFromRequest($request, 'isSystemAgent')); | ||||
| $saved->setParameter( | $saved->setParameter( | ||||
| 'isMailingList', | |||||
| $this->readBoolFromRequest($request, 'isMailingList')); | |||||
| $saved->setParameter( | |||||
| 'needsApproval', | 'needsApproval', | ||||
| $this->readBoolFromRequest($request, 'needsApproval')); | $this->readBoolFromRequest($request, 'needsApproval')); | ||||
| $saved->setParameter('createdStart', $request->getStr('createdStart')); | $saved->setParameter('createdStart', $request->getStr('createdStart')); | ||||
| $saved->setParameter('createdEnd', $request->getStr('createdEnd')); | $saved->setParameter('createdEnd', $request->getStr('createdEnd')); | ||||
| $this->readCustomFieldsFromRequest($request, $saved); | $this->readCustomFieldsFromRequest($request, $saved); | ||||
| Show All 27 Lines | public function buildQueryFromSavedQuery(PhabricatorSavedQuery $saved) { | ||||
| $like = $saved->getParameter('nameLike'); | $like = $saved->getParameter('nameLike'); | ||||
| if ($like) { | if ($like) { | ||||
| $query->withNameLike($like); | $query->withNameLike($like); | ||||
| } | } | ||||
| $is_admin = $saved->getParameter('isAdmin'); | $is_admin = $saved->getParameter('isAdmin'); | ||||
| $is_disabled = $saved->getParameter('isDisabled'); | $is_disabled = $saved->getParameter('isDisabled'); | ||||
| $is_system_agent = $saved->getParameter('isSystemAgent'); | $is_system_agent = $saved->getParameter('isSystemAgent'); | ||||
| $is_mailing_list = $saved->getParameter('isMailingList'); | |||||
| $needs_approval = $saved->getParameter('needsApproval'); | $needs_approval = $saved->getParameter('needsApproval'); | ||||
| if ($is_admin !== null) { | if ($is_admin !== null) { | ||||
| $query->withIsAdmin($is_admin); | $query->withIsAdmin($is_admin); | ||||
| } | } | ||||
| if ($is_disabled !== null) { | if ($is_disabled !== null) { | ||||
| $query->withIsDisabled($is_disabled); | $query->withIsDisabled($is_disabled); | ||||
| } | } | ||||
| if ($is_system_agent !== null) { | if ($is_system_agent !== null) { | ||||
| $query->withIsSystemAgent($is_system_agent); | $query->withIsSystemAgent($is_system_agent); | ||||
| } | } | ||||
| if ($is_mailing_list !== null) { | |||||
| $query->withIsMailingList($is_mailing_list); | |||||
| } | |||||
| if ($needs_approval !== null) { | if ($needs_approval !== null) { | ||||
| $query->withIsApproved(!$needs_approval); | $query->withIsApproved(!$needs_approval); | ||||
| } | } | ||||
| $start = $this->parseDateTime($saved->getParameter('createdStart')); | $start = $this->parseDateTime($saved->getParameter('createdStart')); | ||||
| $end = $this->parseDateTime($saved->getParameter('createdEnd')); | $end = $this->parseDateTime($saved->getParameter('createdEnd')); | ||||
| if ($start) { | if ($start) { | ||||
| Show All 14 Lines | public function buildSearchForm( | ||||
| PhabricatorSavedQuery $saved) { | PhabricatorSavedQuery $saved) { | ||||
| $usernames = $saved->getParameter('usernames', array()); | $usernames = $saved->getParameter('usernames', array()); | ||||
| $like = $saved->getParameter('nameLike'); | $like = $saved->getParameter('nameLike'); | ||||
| $is_admin = $this->getBoolFromQuery($saved, 'isAdmin'); | $is_admin = $this->getBoolFromQuery($saved, 'isAdmin'); | ||||
| $is_disabled = $this->getBoolFromQuery($saved, 'isDisabled'); | $is_disabled = $this->getBoolFromQuery($saved, 'isDisabled'); | ||||
| $is_system_agent = $this->getBoolFromQuery($saved, 'isSystemAgent'); | $is_system_agent = $this->getBoolFromQuery($saved, 'isSystemAgent'); | ||||
| $is_mailing_list = $this->getBoolFromQuery($saved, 'isMailingList'); | |||||
| $needs_approval = $this->getBoolFromQuery($saved, 'needsApproval'); | $needs_approval = $this->getBoolFromQuery($saved, 'needsApproval'); | ||||
| $form | $form | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
| ->setName('usernames') | ->setName('usernames') | ||||
| ->setLabel(pht('Usernames')) | ->setLabel(pht('Usernames')) | ||||
| ->setValue(implode(', ', $usernames))) | ->setValue(implode(', ', $usernames))) | ||||
| Show All 32 Lines | $form | ||||
| ->setOptions( | ->setOptions( | ||||
| array( | array( | ||||
| '' => pht('(Show All)'), | '' => pht('(Show All)'), | ||||
| 'true' => pht('Show Only Bots'), | 'true' => pht('Show Only Bots'), | ||||
| 'false' => pht('Hide Bots'), | 'false' => pht('Hide Bots'), | ||||
| ))) | ))) | ||||
| ->appendChild( | ->appendChild( | ||||
| id(new AphrontFormSelectControl()) | id(new AphrontFormSelectControl()) | ||||
| ->setName('isMailingList') | |||||
| ->setLabel(pht('Mailing Lists')) | |||||
| ->setValue($is_mailing_list) | |||||
| ->setOptions( | |||||
| array( | |||||
| '' => pht('(Show All)'), | |||||
| 'true' => pht('Show Only Mailing Lists'), | |||||
| 'false' => pht('Hide Mailing Lists'), | |||||
| ))) | |||||
| ->appendChild( | |||||
| id(new AphrontFormSelectControl()) | |||||
| ->setName('needsApproval') | ->setName('needsApproval') | ||||
| ->setLabel(pht('Needs Approval')) | ->setLabel(pht('Needs Approval')) | ||||
| ->setValue($needs_approval) | ->setValue($needs_approval) | ||||
| ->setOptions( | ->setOptions( | ||||
| array( | array( | ||||
| '' => pht('(Show All)'), | '' => pht('(Show All)'), | ||||
| 'true' => pht('Show Only Unapproved Users'), | 'true' => pht('Show Only Unapproved Users'), | ||||
| 'false' => pht('Hide Unapproved Users'), | 'false' => pht('Hide Unapproved Users'), | ||||
| ▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Lines | foreach ($users as $user) { | ||||
| if ($user->getIsAdmin()) { | if ($user->getIsAdmin()) { | ||||
| $item->addIcon('fa-star', pht('Admin')); | $item->addIcon('fa-star', pht('Admin')); | ||||
| } | } | ||||
| if ($user->getIsSystemAgent()) { | if ($user->getIsSystemAgent()) { | ||||
| $item->addIcon('fa-desktop', pht('Bot')); | $item->addIcon('fa-desktop', pht('Bot')); | ||||
| } | } | ||||
| if ($user->getIsMailingList()) { | |||||
| $item->addIcon('fa-envelope-o', pht('Mailing List')); | |||||
| } | |||||
| if ($viewer->getIsAdmin()) { | if ($viewer->getIsAdmin()) { | ||||
| $user_id = $user->getID(); | $user_id = $user->getID(); | ||||
| if ($is_approval) { | if ($is_approval) { | ||||
| $item->addAction( | $item->addAction( | ||||
| id(new PHUIListItemView()) | id(new PHUIListItemView()) | ||||
| ->setIcon('fa-ban') | ->setIcon('fa-ban') | ||||
| ->setName(pht('Disable')) | ->setName(pht('Disable')) | ||||
| ->setWorkflow(true) | ->setWorkflow(true) | ||||
| Show All 17 Lines | |||||