Changeset View
Changeset View
Standalone View
Standalone View
src/applications/auth/provider/PhabricatorJIRAAuthProvider.php
Show First 20 Lines • Show All 163 Lines • ▼ Show 20 Lines | public function extendEditForm( | ||||
if (!function_exists('openssl_pkey_new')) { | if (!function_exists('openssl_pkey_new')) { | ||||
// TODO: This could be a bit prettier. | // TODO: This could be a bit prettier. | ||||
throw new Exception( | throw new Exception( | ||||
pht( | pht( | ||||
"The PHP 'openssl' extension is not installed. You must install ". | "The PHP 'openssl' extension is not installed. You must install ". | ||||
"this extension in order to add a JIRA authentication provider, ". | "this extension in order to add a JIRA authentication provider, ". | ||||
"because JIRA OAuth requests use the RSA-SHA1 signing algorithm. ". | "because JIRA OAuth requests use the RSA-SHA1 signing algorithm. ". | ||||
"Install the 'openssl' extension, restart Phabricator, and try ". | "Install the 'openssl' extension, restart %s, and try ". | ||||
"again.")); | "again.", | ||||
PhabricatorPlatformSite::getName())); | |||||
} | } | ||||
$form->appendRemarkupInstructions( | $form->appendRemarkupInstructions( | ||||
pht( | pht( | ||||
'NOTE: This provider **only supports JIRA 6**. It will not work with '. | 'NOTE: This provider **only supports JIRA 6**. It will not work with '. | ||||
'JIRA 5 or earlier.')); | 'JIRA 5 or earlier.')); | ||||
$is_setup = $this->isSetup(); | $is_setup = $this->isSetup(); | ||||
Show All 11 Lines | public function extendEditForm( | ||||
$v_uri = $values[self::PROPERTY_JIRA_URI]; | $v_uri = $values[self::PROPERTY_JIRA_URI]; | ||||
$e_uri = idx($issues, self::PROPERTY_JIRA_URI, $e_required); | $e_uri = idx($issues, self::PROPERTY_JIRA_URI, $e_required); | ||||
if ($is_setup) { | if ($is_setup) { | ||||
$form | $form | ||||
->appendRemarkupInstructions( | ->appendRemarkupInstructions( | ||||
pht( | pht( | ||||
"**JIRA Instance Name**\n\n". | "**JIRA Instance Name**\n\n". | ||||
"Choose a permanent name for this instance of JIRA. Phabricator ". | "Choose a permanent name for this instance of JIRA. %s ". | ||||
"uses this name internally to keep track of this instance of ". | "uses this name internally to keep track of this instance of ". | ||||
"JIRA, in case the URL changes later.\n\n". | "JIRA, in case the URL changes later.\n\n". | ||||
"Use lowercase letters, digits, and period. For example, ". | "Use lowercase letters, digits, and period. For example, ". | ||||
"`jira`, `jira.mycompany` or `jira.engineering` are reasonable ". | "`jira`, `jira.mycompany` or `jira.engineering` are reasonable ". | ||||
"names.")) | "names.", | ||||
PhabricatorPlatformSite::getName())) | |||||
->appendChild( | ->appendChild( | ||||
id(new AphrontFormTextControl()) | id(new AphrontFormTextControl()) | ||||
->setLabel(pht('JIRA Instance Name')) | ->setLabel(pht('JIRA Instance Name')) | ||||
->setValue($v_name) | ->setValue($v_name) | ||||
->setName(self::PROPERTY_JIRA_NAME) | ->setName(self::PROPERTY_JIRA_NAME) | ||||
->setError($e_name)); | ->setError($e_name)); | ||||
} else { | } else { | ||||
$form | $form | ||||
▲ Show 20 Lines • Show All 62 Lines • ▼ Show 20 Lines | if (!$is_setup) { | ||||
id(new AphrontFormCheckboxControl()) | id(new AphrontFormCheckboxControl()) | ||||
->addCheckbox( | ->addCheckbox( | ||||
self::PROPERTY_REPORT_COMMENT, | self::PROPERTY_REPORT_COMMENT, | ||||
1, | 1, | ||||
new PHUIRemarkupView( | new PHUIRemarkupView( | ||||
$viewer, | $viewer, | ||||
pht( | pht( | ||||
'**Post a comment** in the JIRA task, similar to the '. | '**Post a comment** in the JIRA task, similar to the '. | ||||
'emails Phabricator sends.')), | 'emails %s sends.', | ||||
PhabricatorPlatformSite::getName())), | |||||
$this->shouldCreateJIRAComment())); | $this->shouldCreateJIRAComment())); | ||||
} | } | ||||
} | } | ||||
/** | /** | ||||
* JIRA uses a setup step to generate public/private keys. | * JIRA uses a setup step to generate public/private keys. | ||||
*/ | */ | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |
Content licensed under Creative Commons Attribution-ShareAlike 4.0 (CC-BY-SA) unless otherwise noted; code licensed under Apache 2.0 or other open source licenses. · CC BY-SA 4.0 · Apache 2.0