Remove product literal strings in "pht()", part 6
[phabricator.git] / src / applications / people / management / PhabricatorPeopleManagementApproveWorkflow.php
blobcf3952215c5afbed32050737a207057914154097
1 <?php
4 final class PhabricatorPeopleManagementApproveWorkflow
5 extends PhabricatorPeopleManagementWorkflow {
7 protected function didConstruct() {
8 $arguments = array_merge(
9 $this->getUserSelectionArguments(),
10 array());
12 $this
13 ->setName('approve')
14 ->setExamples('**approve** --user __username__')
15 ->setSynopsis(pht('Approves a user.'))
16 ->setArguments($arguments);
19 public function execute(PhutilArgumentParser $args) {
20 $user = $this->selectUser($args);
21 $display_name = $user->getUsername();
23 if ($user->getIsApproved()) {
24 throw new PhutilArgumentUsageException(
25 pht(
26 'User account "%s" is already approved. You can only '.
27 'approve accounts that are not yet approved.',
28 $display_name));
31 $xactions = array();
32 $xactions[] = $user->getApplicationTransactionTemplate()
33 ->setTransactionType(PhabricatorUserApproveTransaction::TRANSACTIONTYPE)
34 ->setNewValue(true);
36 $this->applyTransactions($user, $xactions);
38 $this->logOkay(
39 pht('DONE'),
40 pht('Approved user account "%s".', $display_name));
42 return 0;