Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/editor/DiffusionCommitEditEngine.php
| Show First 20 Lines • Show All 107 Lines • ▼ Show 20 Lines | $fields[] = id(new PhabricatorDatasourceEditField()) | ||||
| ->setTransactionType( | ->setTransactionType( | ||||
| DiffusionCommitAuditorsTransaction::TRANSACTIONTYPE) | DiffusionCommitAuditorsTransaction::TRANSACTIONTYPE) | ||||
| ->setCommentActionLabel(pht('Change Auditors')) | ->setCommentActionLabel(pht('Change Auditors')) | ||||
| ->setDescription(pht('Auditors for this commit.')) | ->setDescription(pht('Auditors for this commit.')) | ||||
| ->setConduitDescription(pht('Change the auditors for this commit.')) | ->setConduitDescription(pht('Change the auditors for this commit.')) | ||||
| ->setConduitTypeDescription(pht('New auditors.')) | ->setConduitTypeDescription(pht('New auditors.')) | ||||
| ->setValue($object->getAuditorPHIDsForEdit()); | ->setValue($object->getAuditorPHIDsForEdit()); | ||||
| $reason = $data->getCommitDetail('autocloseReason', false); | $holds = $data->getPublisherHoldReasons(); | ||||
| if ($reason !== false) { | if ($holds) { | ||||
| switch ($reason) { | $hold_names = array(); | ||||
| case PhabricatorRepository::BECAUSE_REPOSITORY_IMPORTING: | foreach ($holds as $hold) { | ||||
| $desc = pht('No, Repository Importing'); | $hold_names[] = id(new PhabricatorRepositoryPublisher()) | ||||
| break; | ->getHoldName($hold); | ||||
| case PhabricatorRepository::BECAUSE_AUTOCLOSE_DISABLED: | |||||
| $desc = pht('No, Repository Publishing Disabled'); | |||||
| break; | |||||
| case PhabricatorRepository::BECAUSE_NOT_ON_AUTOCLOSE_BRANCH: | |||||
| $desc = pht('No, Not Reachable from Permanent Ref'); | |||||
| break; | |||||
| // Old commits which were manually reparsed with "--force-autoclose" | |||||
| // may have this constant. This flag is no longer supported. | |||||
| case 'auto/forced': | |||||
| case null: | |||||
| $desc = pht('Yes'); | |||||
| break; | |||||
| default: | |||||
| $desc = pht('Unknown'); | |||||
| break; | |||||
| } | } | ||||
| $desc = implode('; ', $hold_names); | |||||
| $doc_href = PhabricatorEnv::getDoclink( | $doc_href = PhabricatorEnv::getDoclink( | ||||
| 'Diffusion User Guide: Permanent Refs'); | 'Diffusion User Guide: Permanent Refs'); | ||||
| $doc_link = phutil_tag( | $doc_link = phutil_tag( | ||||
| 'a', | 'a', | ||||
| array( | array( | ||||
| 'href' => $doc_href, | 'href' => $doc_href, | ||||
| 'target' => '_blank', | 'target' => '_blank', | ||||
| ), | ), | ||||
| pht('Learn More')); | pht('Learn More')); | ||||
| $fields[] = id(new PhabricatorStaticEditField()) | $fields[] = id(new PhabricatorStaticEditField()) | ||||
| ->setLabel(pht('Published?')) | ->setLabel(pht('Unpublished')) | ||||
| ->setValue(array($desc, " \xC2\xB7 ", $doc_link)); | ->setValue(array($desc, " \xC2\xB7 ", $doc_link)); | ||||
| } | } | ||||
| $actions = DiffusionCommitActionTransaction::loadAllActions(); | $actions = DiffusionCommitActionTransaction::loadAllActions(); | ||||
| $actions = msortv($actions, 'getCommitActionOrderVector'); | $actions = msortv($actions, 'getCommitActionOrderVector'); | ||||
| foreach ($actions as $key => $action) { | foreach ($actions as $key => $action) { | ||||
| $fields[] = $action->newEditField($object, $viewer); | $fields[] = $action->newEditField($object, $viewer); | ||||
| ▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines | |||||