Merge branch 'ztflow-wangyidong-main#wangyidong' of zentao/zentaopms (#80)

This commit is contained in:
田淑杰
2024-06-12 02:37:13 +00:00
committed by Gitfox
5 changed files with 21 additions and 4 deletions
+6
View File
@@ -455,6 +455,7 @@ class control extends baseControl
public function getFlowExportFields()
{
if($this->config->edition == 'open') return array();
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return array();
$moduleName = $this->moduleName;
return $this->$moduleName->getFlowExportFields();
@@ -479,6 +480,7 @@ class control extends baseControl
public function printExtendFields(object|string $object, string $type, string $extras = '', bool $print = true, string $moduleName = '', string $methodName = '')
{
if($this->config->edition == 'open') return false;
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return false;
$moduleName = $moduleName ?: $this->app->getModuleName();
$methodName = $methodName ?: $this->app->getMethodName();
@@ -515,6 +517,7 @@ class control extends baseControl
public function appendExtendFields(zin\fieldList $fields, string $moduleName = '', string $methodName = ''): zin\fieldList
{
if($this->config->edition == 'open') return $fields;
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return $fields;
$moduleName = $moduleName ? $moduleName : $this->app->getModuleName();
$methodName = $methodName ? $moduleName : $this->app->getMethodName();
@@ -541,6 +544,7 @@ class control extends baseControl
public function appendExtendCssAndJS(string $moduleName = '', string $methodName = ''): string
{
if($this->config->edition == 'open') return '';
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return '';
$moduleName = $moduleName ? $moduleName : $this->app->getModuleName();
$methodName = $methodName ? $methodName : $this->app->getMethodName();
@@ -579,6 +583,7 @@ class control extends baseControl
public function appendExtendForm(string $position = 'info', object $object = null, string $moduleName = '', string $methodName = ''): array
{
if($this->config->edition == 'open') return array();
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return array();
$moduleName = $moduleName ? $moduleName : $this->app->getModuleName();
$methodName = $methodName ? $moduleName : $this->app->getMethodName();
@@ -679,6 +684,7 @@ class control extends baseControl
public function checkRequireFlowField()
{
if($this->config->edition == 'open') return false;
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return false;
if(empty($_POST)) return false;
$action = $this->dao->select('*')->from(TABLE_WORKFLOWACTION)->where('module')->eq($this->moduleName)->andWhere('action')->eq($this->methodName)->fetch();
+7
View File
@@ -212,6 +212,7 @@ class model extends baseModel
public function buildFlowMenu($module, $data, $type = 'browse', $show = '')
{
if($this->config->edition == 'open') return '';
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return '';
$moduleName = $module;
if(str_contains($module, '.')) [$appName, $moduleName] = explode('.', $module);
@@ -304,6 +305,7 @@ class model extends baseModel
public function processExportData($data)
{
if($this->config->edition == 'open') return $data;
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return $data;
return $this->loadModel('workflowfield')->processExportData($data);
}
@@ -318,6 +320,7 @@ class model extends baseModel
public function processExportOptions($data)
{
if($this->config->edition == 'open') return $data;
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return $data;
return $this->loadModel('workflowfield')->processExportOptions($data);
}
@@ -332,6 +335,7 @@ class model extends baseModel
public function processImportData($data)
{
if($this->config->edition == 'open') return $data;
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return $data;
return $this->loadModel('workflowfield')->processImportData($data);
}
@@ -345,6 +349,7 @@ class model extends baseModel
public function getFlowExtendFields()
{
if($this->config->edition == 'open') return array();
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return array();
return $this->loadModel('flow')->getExtendFields($this->app->getModuleName(), $this->app->getMethodName());
}
@@ -358,6 +363,7 @@ class model extends baseModel
public function getFlowExportFields()
{
if($this->config->edition == 'open') return array();
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return array();
return $this->loadModel('workflowfield')->getExportFields($this->app->getModuleName());
}
@@ -372,6 +378,7 @@ class model extends baseModel
public function executeHooks(int $objectID): string
{
if($this->config->edition == 'open') return '';
if(!empty($this->app->installing) || !empty($this->app->upgrading)) return '';
$moduleName = $this->app->getModuleName();
$methodName = $this->app->getMethodName();
+2 -2
View File
@@ -282,7 +282,7 @@ CSS;
{
global $app, $config;
$sections = $this->prop('sections');
if($config->edition != 'open') $sections = $app->control->loadModel('flow')->buildExtendZinValue($sections, $this->prop('object'), 'info');
if($config->edition != 'open' && empty($app->installing) && empty($app->upgrading)) $sections = $app->control->loadModel('flow')->buildExtendZinValue($sections, $this->prop('object'), 'info');
$list = array();
foreach($sections as $key => $item)
@@ -399,7 +399,7 @@ CSS;
{
global $app, $config;
$tabs = $this->prop('tabs');
if($config->edition != 'open') $tabs = $app->control->loadModel('flow')->buildExtendZinValue($tabs, $this->prop('object'), 'basic');
if($config->edition != 'open' && empty($app->installing) && empty($app->upgrading)) $tabs = $app->control->loadModel('flow')->buildExtendZinValue($tabs, $this->prop('object'), 'basic');
if(!$tabs) return null;
$groups = array();
+1 -1
View File
@@ -207,7 +207,7 @@ class dtable extends wg
}
global $config;
if($config->edition != 'open')
if($config->edition != 'open' && empty($app->installing) && empty($app->upgrading))
{
$extendFields = $app->control->loadModel('workflowaction')->getFields($moduleName, $methodName);
$extendCols = $app->control->loadModel('flow')->buildDtableCols($extendFields);
+5 -1
View File
@@ -481,13 +481,17 @@ class upgradeModel extends model
if($defaultPos === false) return false; // No default in std, don't change.
$stdDefault = str_replace("'", '', substr($stdField, $defaultPos + 9));
$commentPos = stripos($stdDefault, ' COMMENT ');
if($commentPos !== false) $stdDefault = substr($stdDefault, 0, $commentPos);
if($stdDefault == 'NULL') return false; // Default is NULL, don't change.
if(strpos($stdField, 'text') !== false && empty($stdDefault)) return false; // Default is '' and text type, don't change.
$defaultPos = stripos($dbField, ' DEFAULT ');
if($defaultPos === false) return true; // No default in db, change it.
$dbDefault = str_replace("'", '', substr($dbField, $defaultPos + 9));
$dbDefault = str_replace("'", '', substr($dbField, $defaultPos + 9));
$commentPos = stripos($dbDefault, ' COMMENT ');
if($commentPos !== false) $dbDefault = substr($dbDefault, 0, $commentPos);
return $stdDefault != $dbDefault;
}