From 3d4374964a715540fa1377a3a1474514099b0233 Mon Sep 17 00:00:00 2001 From: wangyuting2 <851424971@qq.com> Date: Sat, 7 May 2022 09:52:16 +0800 Subject: [PATCH] * Merge zdoo framework. --- framework/control.class.php | 161 ++++++++---------------------- framework/model.class.php | 190 ++++++++++++++++++++++++++++++++++++ 2 files changed, 231 insertions(+), 120 deletions(-) diff --git a/framework/control.class.php b/framework/control.class.php index 77cf3e724d..803189b9c3 100644 --- a/framework/control.class.php +++ b/framework/control.class.php @@ -42,8 +42,6 @@ class control extends baseControl /* Code for task #9224. Set requiredFields for workflow. */ if($this->dbh and (defined('IN_USE') or (defined('RUN_MODE') and RUN_MODE == 'api'))) { - $this->checkRequireFlowField(); - if(isset($this->config->{$this->moduleName}) and strpos($this->methodName, 'export') !== false) { if(isset($this->config->{$this->moduleName}->exportFields) or isset($this->config->{$this->moduleName}->list->exportFields)) @@ -291,6 +289,24 @@ class control extends baseControl chdir($currentPWD); } + /** + * Build operate menu of a method. + * + * @param object $object product|project|productplan|release|build|story|task|bug|testtask|testcase|testsuite + * @param string $displayOn view|browse + * @access public + * @return void + */ + public function buildOperateMenu($object, $displayOn = 'view') + { + if(!isset($this->config->bizVersion)) return false; + + $flow = $this->loadModel('workflow')->getByModule($this->moduleName); + return $this->loadModel('flow')->buildOperateMenu($flow, $object, $displayOn); + //$moduleName = $this->moduleName; + //return $this->$moduleName->buildOperateMenu($object, $type); + } + /** * Execute hooks of a method. * @@ -307,19 +323,18 @@ class control extends baseControl } /** - * Build operate menu of a method. - * - * @param object $object product|project|productplan|release|build|story|task|bug|testtask|testcase|testsuite - * @param string $displayOn view|browse + * Set workflow export fields + * + * @param array $fields * @access public - * @return void + * @return array */ - public function buildOperateMenu($object, $displayOn = 'view') + public function getFlowExportFields() { - if(!isset($this->config->bizVersion)) return false; + if(!isset($this->config->bizVersion)) return array(); - $flow = $this->loadModel('workflow')->getByModule($this->moduleName); - return $this->loadModel('flow')->buildOperateMenu($flow, $object, $displayOn); + $moduleName = $this->moduleName; + return $this->$moduleName->getFlowExportFields(); } /** @@ -332,14 +347,27 @@ class control extends baseControl * position=left|right The position which the fields displayed in a page. * inForm=0|1 The fields displayed in a form or not. The default is 1. * inCell=0|1 The fields displayed in a div with class cell or not. The default is 0. + * @param bool $print * @access public * @return void */ - public function printExtendFields($object, $type, $extras = '') + public function printExtendFields($object, $type, $extras = '', $print = false) { if(!isset($this->config->bizVersion)) return false; - echo $this->loadModel('flow')->printFields($this->moduleName, $this->methodName, $object, $type, $extras); + $moduleName = $this->app->getModuleName(); + $methodName = $this->app->getMethodName(); + $fields = $this->loadModel('flow')->printFields($moduleName, $methodName, $object, $type, $extras); + if(!$print) return $fields; + + $jsRoot = $this->config->webRoot . "js/"; + $picker = file_get_contents($this->app->getBasePath() . 'app/sys/common/view/picker.html.php'); + $picker = substr($picker, strpos($picker, '