Merge branch 'zentaopms_239'

This commit is contained in:
wangyidong
2022-11-08 08:41:28 +08:00
458 changed files with 9419 additions and 4940 deletions
+6
View File
@@ -927,6 +927,12 @@ class baseControl
if($type != 'json') die();
$data = (array)$data;
/* Make sure locate in this tab. */
global $lang;
$moduleName = $this->app->rawModule;
if(isset($lang->navGroup->{$moduleName}) and $lang->navGroup->{$moduleName} != $this->app->tab and isset($data['locate']) and $data['locate'][0] == '/' and !helper::inOnlyBodyMode()) $data['locate'] .= "#app={$this->app->tab}";
if(helper::isAjaxRequest() or $this->viewType == 'json')
{
/* Process for zh-cn in json. */
+1 -1
View File
@@ -136,7 +136,7 @@ class baseHelper
*/
if($viewType == $app->getViewType())
{
$link .= $moduleName . '/';
$link .= $moduleName . '.' . $viewType;
return self::processOnlyBodyParam($link, $onlyBody);
}
+44
View File
@@ -76,6 +76,50 @@ class helper extends baseHelper
return str_replace($escapers, $replacements, $json);
}
/**
* Verify that the system has opened on the feature.
*
* @param string $feature scrum_risk | risk | scrum
* @static
* @access public
* @return bool
*/
public static function hasFeature($feature)
{
global $config;
if(strpos($feature, '_') !== false)
{
$code = explode('_', $feature);
$code = $code[0] . ucfirst($code[1]);
return strpos(",$config->disabledFeatures,", ",{$code},") === false;
}
else
{
if($feature == 'product' or $feature == 'scrum' or $feature == 'waterfall') return strpos(",$config->disabledFeatures,", ",{$feature},") === false;
$hasFeature = false;
foreach($config->featureGroup as $group => $modules)
{
if($feature == $group)
{
foreach($modules as $module)
{
if(helper::hasFeature("{$group}_{$module}")) $hasFeature = true;
}
}
else
{
foreach($modules as $module)
{
if($feature == $module and helper::hasFeature("{$group}_{$module}")) $hasFeature = true;
}
}
}
return $hasFeature && strpos(",$config->disabledFeatures,", ",{$feature},") === false;
}
}
/**
* Convert encoding.
*
+17 -12
View File
@@ -171,7 +171,7 @@ class router extends baseRouter
try
{
$commonSettings = $this->dbh->query('SELECT section, `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND (`module`='custom' or `module`='common') and `key` in ('sprintConcept', 'hourPoint', 'URSR', 'mode', 'URAndSR', 'scoreStatus')")->fetchAll();
$commonSettings = $this->dbh->query('SELECT section, `key`, value FROM' . TABLE_CONFIG . "WHERE `owner`='system' AND (`module`='custom' or `module`='common') and `key` in ('sprintConcept', 'hourPoint', 'URSR', 'mode', 'URAndSR', 'scoreStatus', 'disabledFeatures', 'closedFeatures')")->fetchAll();
}
catch (PDOException $exception)
{
@@ -181,18 +181,22 @@ class router extends baseRouter
$hourKey = $planKey = $URSR = $URAndSR = 0;
$mode = 'new';
$score = '0';
$projectKey = ITERATION_KEY;
$mode = 'new';
$score = '0';
$projectKey = ITERATION_KEY;
$disabledFeatures = '';
$closedFeatures = '';
foreach($commonSettings as $setting)
{
if($setting->key == 'sprintConcept') $projectKey = $setting->value;
if($setting->key == 'hourPoint') $hourKey = $setting->value;
if($setting->key == 'URSR') $URSR = $setting->value;
if($setting->key == 'URAndSR') $URAndSR = $setting->value;
if($setting->key == 'mode' and $setting->section == 'global') $mode = $setting->value;
if($setting->key == 'scoreStatus' and $setting->section == 'global') $score = $setting->value;
if($setting->key == 'sprintConcept') $projectKey = $setting->value;
if($setting->key == 'hourPoint') $hourKey = $setting->value;
if($setting->key == 'URSR') $URSR = $setting->value;
if($setting->key == 'URAndSR') $URAndSR = $setting->value;
if($setting->key == 'mode' and $setting->section == 'global') $mode = $setting->value;
if($setting->key == 'scoreStatus' and $setting->section == 'global') $score = $setting->value;
if($setting->key == 'disabledFeatures') $disabledFeatures = $setting->value;
if($setting->key == 'closedFeatures') $closedFeatures = $setting->value;
}
/* Lite Version is compatible with classic modes */
@@ -200,7 +204,8 @@ class router extends baseRouter
/* Record system mode. */
$config->systemMode = $mode;
if($config->systemMode == 'classic') $this->config->executionCommonList = $this->config->projectCommonList;
$config->disabledFeatures = $disabledFeatures . ',' . $closedFeatures;
/* Record system score.*/
$config->systemScore = $score;
@@ -221,7 +226,7 @@ class router extends baseRouter
/* User preference init. */
$config->URSR = $URSR;
$config->URAndSR = $URAndSR;
$config->URAndSR = ($URAndSR and strpos(",{$config->disabledFeatures},", ',productUR,') === false);
$config->programLink = 'program-browse';
$config->productLink = 'product-all';
$config->projectLink = 'project-browse';