protected function getConditionObjectValue(HeraldCondition $condition, HeraldAdapter $object) { $field = $condition->getFieldName(); return $this->getObjectFieldValue($field); }
private function renderConditionValueAsText(HeraldCondition $condition, PhabricatorHandleList $handles, PhabricatorUser $viewer) { $field = $this->requireFieldImplementation($condition->getFieldName()); return $field->renderConditionValue($viewer, $condition->getFieldCondition(), $condition->getValue()); }
private function renderConditionValueAsText(HeraldCondition $condition, PhabricatorHandleList $handles, PhabricatorUser $viewer) { $impl = $this->getFieldImplementation($condition->getFieldName()); if ($impl) { return $impl->renderConditionValue($viewer, $condition->getValue()); } $value = $condition->getValue(); if (!is_array($value)) { $value = array($value); } foreach ($value as $index => $val) { $handle = $handles->getHandleIfExists($val); if ($handle) { $value[$index] = $handle->renderLink(); } } $value = phutil_implode_html(', ', $value); return $value; }
private function renderConditionValueAsText(HeraldCondition $condition, PhabricatorHandleList $handles) { $value = $condition->getValue(); if (!is_array($value)) { $value = array($value); } switch ($condition->getFieldName()) { case self::FIELD_TASK_PRIORITY: $priority_map = ManiphestTaskPriority::getTaskPriorityMap(); foreach ($value as $index => $val) { $name = idx($priority_map, $val); if ($name) { $value[$index] = $name; } } break; case self::FIELD_TASK_STATUS: $status_map = ManiphestTaskStatus::getTaskStatusMap(); foreach ($value as $index => $val) { $name = idx($status_map, $val); if ($name) { $value[$index] = $name; } } break; case HeraldPreCommitRefAdapter::FIELD_REF_CHANGE: $change_map = PhabricatorRepositoryPushLog::getHeraldChangeFlagConditionOptions(); foreach ($value as $index => $val) { $name = idx($change_map, $val); if ($name) { $value[$index] = $name; } } break; default: foreach ($value as $index => $val) { $handle = $handles->getHandleIfExists($val); if ($handle) { $value[$index] = $handle->renderLink(); } } break; } $value = phutil_implode_html(', ', $value); return $value; }
private function renderConditionValueAsText(HeraldCondition $condition, PhabricatorHandleList $handles, PhabricatorUser $viewer) { $impl = $this->getFieldImplementation($condition->getFieldName()); if ($impl) { return $impl->renderConditionValue($viewer, $condition->getValue()); } $value = $condition->getValue(); if (!is_array($value)) { $value = array($value); } switch ($condition->getFieldName()) { case HeraldPreCommitRefAdapter::FIELD_REF_CHANGE: $change_map = PhabricatorRepositoryPushLog::getHeraldChangeFlagConditionOptions(); foreach ($value as $index => $val) { $name = idx($change_map, $val); if ($name) { $value[$index] = $name; } } break; default: foreach ($value as $index => $val) { $handle = $handles->getHandleIfExists($val); if ($handle) { $value[$index] = $handle->renderLink(); } } break; } $value = phutil_implode_html(', ', $value); return $value; }