diff --git a/module/common/lang/menu.php b/module/common/lang/menu.php
index 9479d7c48c..e84343b3f1 100644
--- a/module/common/lang/menu.php
+++ b/module/common/lang/menu.php
@@ -503,7 +503,7 @@ $lang->devops->homeMenu->apps = array('link' => "{$lang->app->common}|space|brow
//$lang->devops->homeMenu->app = array('link' => "{$lang->app->common}|app|serverlink|%s");
$lang->devops->menu = new stdclass();
-$lang->devops->menu->code = array('link' => "{$lang->repo->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccommit');
+$lang->devops->menu->code = array('link' => "{$lang->repocode->common}|repo|browse|repoID=%s", 'alias' => 'diff,view,revision,log,blame,showsynccommit');
$lang->devops->menu->mr = array('link' => "{$lang->devops->mr}|mr|browse|repoID=%s");
$lang->devops->menu->compile = array('link' => "{$lang->devops->compile}|job|browse|repoID=%s", 'subModule' => 'compile,job');
diff --git a/module/common/model.php b/module/common/model.php
index 53d6796d9a..1027fa7b1b 100644
--- a/module/common/model.php
+++ b/module/common/model.php
@@ -41,6 +41,10 @@ class commonModel extends model
{
global $app;
$rawModule = $app->rawModule;
+ $rawMethod = strtolower($app->rawMethod);
+
+ if($rawModule == 'marketresearch' and strpos($rawMethod, 'task') !== false) $rawModule = 'task';
+ if($rawModule == 'marketresearch' and strpos($rawMethod, 'stage') !== false) $rawModule = 'execution';
if($rawModule == 'task' or $rawModule == 'effort')
{
@@ -312,6 +316,7 @@ class commonModel extends model
$required = $app->dbQuery("SELECT * FROM " . TABLE_WORKFLOWRULE . " WHERE `type` = 'system' and `rule` = 'notempty'")->fetch();
$fields = $app->control->loadModel('flow')->getExtendFields($module, $method);
+ $fields = (new self())->loadModel('flow')->getExtendFields($module, $method);
$formConfig = array();
$type = 'string';
foreach($fields as $fieldObject)
@@ -482,7 +487,7 @@ class commonModel extends model
{
if(!commonModel::isTutorialMode())
{
- echo '
' . html::a(helper::createLink('tutorial', 'start'), " " . $lang->tutorialAB, '', "class='iframe' data-class-name='modal-inverse' data-width='800' data-headerless='true' data-backdrop='true' data-keyboard='true'") . '';
+ echo '' . html::a(helper::createLink('tutorial', 'start', '', '', true), " " . $lang->tutorialAB, '', "class='iframe' data-class-name='modal-inverse' data-width='800' data-headerless='true' data-backdrop='true' data-keyboard='true'") . '';
}
echo '' . html::a(helper::createLink('my', 'preference', 'showTip=false', '', true), " " . $lang->preference, '', "class='iframe' data-width='700'") . '';
@@ -909,6 +914,7 @@ class commonModel extends model
if(!in_array($tab, array('program', 'product', 'project')))
{
+ if(!isset($lang->mainNav->$tab)) return;
$nav = $lang->mainNav->$tab;
list(, $currentModule, $currentMethod,) = explode('|', $nav);
if($tab == 'execution') $currentMethod = 'all';
@@ -980,6 +986,9 @@ class commonModel extends model
$app->loadLang('my');
+ /* Ensure user has latest rights set. */
+ $app->user->rights = $app->control->loadModel('user')->authorize($app->user->account);
+
$menuOrder = $lang->mainNav->menuOrder;
ksort($menuOrder);
@@ -1088,6 +1097,27 @@ class commonModel extends model
}
}
+ /* Check whether the homeMenu of this group have permissions. If yes, point to them. */
+ if($display == false and isset($lang->$group->homeMenu))
+ {
+ foreach($lang->$group->homeMenu as $menu)
+ {
+ if(!isset($menu['link'])) continue;
+
+ $linkPart = explode('|', $menu['link']);
+ if(count($linkPart) < 3) continue;
+ list($label, $module, $method) = $linkPart;
+
+ if(common::hasPriv($module, $method))
+ {
+ $display = true;
+ $currentModule = $module;
+ $currentMethod = $method;
+ if(!isset($menu['target'])) break;
+ }
+ }
+ }
+
if(!$display) continue;
/* Assign vars. */
@@ -1306,6 +1336,7 @@ class commonModel extends model
$class = $key == $searchObject ? "class='selected'" : '';
if($key == 'program') $key = 'program-product';
if($key == 'deploystep') $key = 'deploy-viewstep';
+ if($key == 'practice') $key = 'traincourse-practiceview';
echo "{$value}";
}
@@ -1690,9 +1721,6 @@ EOF;
global $app, $lang, $config;
- /* Add data-app attribute. */
- if(strpos($misc, 'data-app') === false) $misc .= ' data-app="' . $app->tab . '"';
-
/* Judge the $method of $module clickable or not, default is clickable. */
$clickable = true;
if(is_bool($extraEnabled))
@@ -1711,6 +1739,10 @@ EOF;
}
}
+ /* Add data-app attribute. */
+ if(strpos($misc, 'data-app') === false) $misc .= ' data-app="' . $app->tab . '"';
+ if($onlyBody && strpos($misc, 'data-toggle') === false && $clickable && !isonlybody()) $misc .= ' data-toggle="modal"';
+
/* Set module and method, then create link to it. */
if(strtolower($module) == 'story' and strtolower($method) == 'createcase') ($module = 'testcase') and ($method = 'create');
if(strtolower($module) == 'bug' and strtolower($method) == 'tostory') ($module = 'story') and ($method = 'create');
@@ -2075,7 +2107,7 @@ EOF;
if(strtolower($key) == 'closeddate' and $value == '') continue;
if(strtolower($key) == 'actualcloseddate' and $value == '') continue;
- if(isset($old->$key))
+ if(isset($old->$key) && is_string($old->$key))
{
if($config->edition != 'open' && isset($dateFields[$key])) $old->$key = formatTime($old->$key);
@@ -2454,8 +2486,8 @@ EOF;
* The following pages can be allowed to open in non-iframe, so ignore these pages.
*/
$module = $this->app->getModuleName();
- $whitelist = '|index|tutorial|install|upgrade|sso|cron|misc|user-login|user-deny|user-logout|user-reset|user-forgetpassword|user-resetpassword|my-changepassword|my-preference|file-read|file-download|file-uploadimages|report-annualdata|misc-captcha|execution-printkanban|traincourse-playvideo|screen-view|zanode-create|screen-ajaxgetchart|screen-view|zanode-create|';
-
+ $whitelist = '|index|tutorial|install|upgrade|sso|cron|misc|user-login|user-deny|user-logout|user-reset|user-forgetpassword|user-resetpassword|my-changepassword|my-preference|file-read|file-download|file-preview|file-uploadimages|file-ajaxwopifiles|report-annualdata|misc-captcha|execution-printkanban|traincourse-ajaxuploadlargefile|traincourse-playvideo|screen-view|zanode-create|screen-ajaxgetchart|';
+
if(strpos($whitelist, "|{$module}|") !== false || strpos($whitelist, "|{$module}-{$method}|") !== false) return true;
/**
@@ -2482,11 +2514,12 @@ EOF;
*/
public static function hasPriv($module, $method, $object = null, $vars = '')
{
- global $app, $lang;
+ global $app, $lang, $config;
$module = strtolower($module);
$method = strtolower($method);
parse_str($vars, $params);
+ if($config->vision == 'or' and $module == 'story') $module = 'requirement';
if(empty($app->user)) return false;
if(empty($params['storyType']) and $module == 'story' and !empty($app->params['storyType']) and strpos(",story,requirement,", ",{$app->params['storyType']},") !== false) $module = $app->params['storyType'];
if($module == 'story' and !empty($params['storyType']) and strpos(",story,requirement,", ",{$params['storyType']},") !== false) $module = $params['storyType'];
@@ -3539,7 +3572,12 @@ EOF;
foreach($postData as $key => $value)
{
if(!is_array($value) or strpos($this->config->$objectType->excludeCheckFields, ",$key,") !== false) continue;
- if(isset($value[$index]) and !empty($value[$index]) and $value[$index] != 'ditto') return true;
+ if(isset($value[$index]) and !empty($value[$index]) and $value[$index] != 'ditto')
+ {
+ /* Judgment of multi-select fields. */
+ if(is_array($value[$index]) and join(',', $value[$index]) == '') continue;
+ return true;
+ }
}
return false;
diff --git a/module/common/view/datatable.fix.html.php b/module/common/view/datatable.fix.html.php
index 4a805cd705..f3a19be1ac 100644
--- a/module/common/view/datatable.fix.html.php
+++ b/module/common/view/datatable.fix.html.php
@@ -3,6 +3,14 @@
moduleName . ucfirst($this->methodName);?>
app->rawMethod)?>
app->rawModule)?>
+