* Add workflow fields to formpanel.

This commit is contained in:
wangyuting
2024-03-21 09:01:37 +08:00
parent b30e95ef27
commit 1eab431aa4
2 changed files with 30 additions and 0 deletions
+22
View File
@@ -488,6 +488,28 @@ class control extends baseControl
echo $fields;
}
/**
* append workflow fields to form.
*
* @param zin\fieldList $fields
* @param string $moduleName
* @param string $methodName
* @access public
* @return void
*/
public function appendExtendFields(zin\fieldList $fields, string $moduleName = '', string $methodName = '')
{
if($this->config->edition == 'open') return false;
$moduleName = $moduleName ?: $this->app->getModuleName();
$methodName = $methodName ?: $this->app->getMethodName();
$flow = $this->loadModel('workflow')->getByModule($moduleName);
$action = $this->loadModel('workflowaction')->getByModuleAndAction($flow->module, $methodName);
$fieldList = $this->workflowaction->getFields($flow->module, $action->action);
return $this->loadModel('flow')->buildFormFields($fields, $fieldList);
}
/**
* Process status of an object according to its subStatus.
*