/** * Shortcut method - probably should clean this up a bit more * @param $actionName * @return array|mixed * @throws \Exception */ public function getAdditionalFieldsForAction($actionName) { $additionalFields = $this->getWorkflow()->getAdditionalFieldsForAction($actionName, $this->getElementStatus()); if (is_array($additionalFields)) { foreach ($additionalFields as &$field) { if ($field['fieldType'] === 'user') { $userdata = new \Pimcore\Model\Object\ClassDefinition\Data\User(); $userdata->configureOptions(); $field['options'] = $userdata->getOptions(); } } } return $additionalFields; }
/** * Returns additional fields for an action. * @param $actionName * @return array */ public function getAdditionalFieldsForAction($actionName, $statusName = null) { $actionConfig = $this->getActionConfig($actionName, $statusName); if (empty($actionConfig['additionalFields'])) { return null; } $fields = []; foreach ($actionConfig['additionalFields'] as $field) { if (isset($field['fieldType'])) { //support for pimcore tags $newField = $field; if ($field['fieldType'] === 'user') { $def = new \Pimcore\Model\Object\ClassDefinition\Data\User(); $def->configureOptions(); $newField['options'] = $def->getOptions(); } } else { //support simple extjs types $newField = $field; } $fields[] = $newField; } return $fields; }