Exemplo n.º 1
0
 public function createFields($object)
 {
     $specs = $object->getAlmanacPropertyFieldSpecifications();
     $default_specs = array();
     foreach ($object->getAlmanacProperties() as $property) {
         $default_specs[$property->getFieldName()] = array('name' => $property->getFieldName(), 'type' => 'text');
     }
     return PhabricatorStandardCustomField::buildStandardFields($this, $specs + $default_specs);
 }
 public function createFields($object)
 {
     if (!$object->getPanelType()) {
         return array();
     }
     $impl = $object->requireImplementation();
     $specs = $impl->getFieldSpecifications();
     return PhabricatorStandardCustomField::buildStandardFields($this, $specs);
 }
 public function createFields($object)
 {
     $impl = $object->getStepImplementation();
     $specs = $impl->getFieldSpecifications();
     if ($impl->supportsWaitForMessage()) {
         $specs['builtin.next-steps-header'] = array('type' => 'header', 'name' => pht('Next Steps'));
         $specs['builtin.wait-for-message'] = array('type' => 'select', 'name' => pht('When Complete'), 'instructions' => pht('After completing this build step Harbormaster can continue the ' . 'build normally, or it can pause the build and wait for a message. ' . 'If you are using this build step to trigger some work in an ' . 'external system, you may want to have Phabricator wait for that ' . 'system to perform the work and report results back.' . "\n\n" . 'If you select **Continue Build Normally**, the build plan will ' . 'proceed once this step finishes.' . "\n\n" . 'If you select **Wait For Message**, the build plan will pause ' . 'indefinitely once this step finishes. To resume the build, an ' . 'external system must call `harbormaster.sendmessage` with the ' . 'build target PHID, and either `"pass"` or `"fail"` to indicate ' . 'the result for this step. After the result is recorded, the build ' . 'plan will resume.'), 'options' => array('' => pht('Continue Build Normally'), 'wait' => pht('Wait For Message')));
     }
     return PhabricatorStandardCustomField::buildStandardFields($this, $specs);
 }
 public function createFields($object)
 {
     // If this is a generic object without an attached implementation (for
     // example, via ApplicationSearch), just don't build any custom fields.
     if (!$object->hasImplementation()) {
         return array();
     }
     $impl = $object->getImplementation();
     $specs = $impl->getFieldSpecifications();
     return PhabricatorStandardCustomField::buildStandardFields($this, $specs);
 }
 public function validateApplicationTransactions(PhabricatorApplicationTransactionEditor $editor, $type, array $xactions)
 {
     $errors = parent::validateApplicationTransactions($editor, $type, $xactions);
     $ok = PassphraseCredentialControl::validateTransactions($this->getViewer(), $xactions);
     if (!$ok) {
         foreach ($xactions as $xaction) {
             $errors[] = new PhabricatorApplicationTransactionValidationError($type, pht('Invalid'), pht('The selected credential does not exist, or you do not have ' . 'permission to use it.'), $xaction);
             $this->setFieldError(pht('Invalid'));
         }
     }
     return $errors;
 }
 public function validateApplicationTransactions(PhabricatorApplicationTransactionEditor $editor, $type, array $xactions)
 {
     $errors = parent::validateApplicationTransactions($editor, $type, $xactions);
     foreach ($xactions as $xaction) {
         $value = $xaction->getNewValue();
         if (strlen($value)) {
             if (!preg_match('/^-?\\d+/', $value)) {
                 $errors[] = new PhabricatorApplicationTransactionValidationError($type, pht('Invalid'), pht('%s must be an integer.', $this->getFieldName()), $xaction);
                 $this->setFieldError(pht('Invalid'));
             }
         }
     }
     return $errors;
 }
 public function createFields($object)
 {
     return PhabricatorStandardCustomField::buildStandardFields($this, array('description' => array('name' => pht('Description'), 'type' => 'remarkup', 'description' => pht('Short project description.'))));
 }
 public function getHeraldFieldValue()
 {
     // If the field has a `null` value, make sure we hand an `array()` to
     // Herald.
     $value = parent::getHeraldFieldValue();
     if ($value) {
         return $value;
     }
     return array();
 }
 public function createFields($object)
 {
     return PhabricatorStandardCustomField::buildStandardFields($this, array('description' => array('name' => pht('Description'), 'type' => 'remarkup', 'description' => pht('Short project description.'), 'fulltext' => PhabricatorSearchDocumentFieldType::FIELD_BODY)), $internal = true);
 }
 public function createFields($object)
 {
     $config = PhabricatorEnv::getEnvConfig('owners.custom-field-definitions', array());
     $fields = PhabricatorStandardCustomField::buildStandardFields($this, $config);
     return $fields;
 }
 public function createFields($object)
 {
     $impl = $object->getImplementation();
     $specs = $impl->getFieldSpecifications();
     return PhabricatorStandardCustomField::buildStandardFields($this, $specs);
 }
 public function createFields($object)
 {
     return PhabricatorStandardCustomField::buildStandardFields($this, PhabricatorEnv::getEnvConfig('projects.custom-field-definitions', array()));
 }