Differential D14073 Diff 34742 src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/transactions/response/PhabricatorApplicationTransactionNoEffectResponse.php
| Show All 26 Lines | public function reduceProxyResponse() { | ||||
| $ex = $this->exception; | $ex = $this->exception; | ||||
| $xactions = $ex->getTransactions(); | $xactions = $ex->getTransactions(); | ||||
| $type_comment = PhabricatorTransactions::TYPE_COMMENT; | $type_comment = PhabricatorTransactions::TYPE_COMMENT; | ||||
| $only_empty_comment = (count($xactions) == 1) && | $only_empty_comment = (count($xactions) == 1) && | ||||
| (head($xactions)->getTransactionType() == $type_comment); | (head($xactions)->getTransactionType() == $type_comment); | ||||
| $count = new PhutilNumber(count($xactions)); | $count = phutil_count($xactions); | ||||
| if ($ex->hasAnyEffect()) { | if ($ex->hasAnyEffect()) { | ||||
| $title = pht('%d Action(s) With No Effect', $count); | $title = pht('%s Action(s) With No Effect', $count); | ||||
| $head = pht('Some of your %d action(s) have no effect:', $count); | $head = pht('Some of your %s action(s) have no effect:', $count); | ||||
| $tail = pht('Apply remaining actions?'); | $tail = pht('Apply remaining actions?'); | ||||
| $continue = pht('Apply Remaining Actions'); | $continue = pht('Apply Remaining Actions'); | ||||
| } else if ($ex->hasComment()) { | } else if ($ex->hasComment()) { | ||||
| $title = pht('Post as Comment'); | $title = pht('Post as Comment'); | ||||
| $head = pht('The %d action(s) you are taking have no effect:', $count); | $head = pht('The %s action(s) you are taking have no effect:', $count); | ||||
| $tail = pht('Do you want to post your comment anyway?'); | $tail = pht('Do you want to post your comment anyway?'); | ||||
| $continue = pht('Post Comment'); | $continue = pht('Post Comment'); | ||||
| } else if ($only_empty_comment) { | } else if ($only_empty_comment) { | ||||
| // Special case this since it's common and we can give the user a nicer | // Special case this since it's common and we can give the user a nicer | ||||
| // dialog than "Action Has No Effect". | // dialog than "Action Has No Effect". | ||||
| $title = pht('Empty Comment'); | $title = pht('Empty Comment'); | ||||
| $head = null; | $head = null; | ||||
| $tail = null; | $tail = null; | ||||
| $continue = null; | $continue = null; | ||||
| } else { | } else { | ||||
| $title = pht('%d Action(s) Have No Effect', $count); | $title = pht('%s Action(s) Have No Effect', $count); | ||||
| $head = pht('The %d action(s) you are taking have no effect:', $count); | $head = pht('The %s action(s) you are taking have no effect:', $count); | ||||
| $tail = null; | $tail = null; | ||||
| $continue = null; | $continue = null; | ||||
| } | } | ||||
| $dialog = id(new AphrontDialogView()) | $dialog = id(new AphrontDialogView()) | ||||
| ->setUser($request->getUser()) | ->setUser($request->getUser()) | ||||
| ->setTitle($title); | ->setTitle($title); | ||||
| Show All 27 Lines | |||||