diff --git a/config/zentaopms.php b/config/zentaopms.php
index 3ecf24e31e..646f396d0a 100644
--- a/config/zentaopms.php
+++ b/config/zentaopms.php
@@ -389,3 +389,5 @@ $config->programPriv->scrum = array('story', 'projectstory', 'projectrelease
$config->programPriv->waterfall = array_merge($config->programPriv->scrum, array('task', 'workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'issue', 'risk', 'opportunity', 'measrecord', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport'));
$config->waterfallModules = array('workestimation', 'durationestimation', 'budget', 'programplan', 'review', 'reviewissue', 'weekly', 'cm', 'milestone', 'design', 'opportunity', 'auditplan', 'trainplan', 'gapanalysis', 'pssp', 'researchplan', 'researchreport');
+
+$config->showMainMenu = true;
diff --git a/extension/lite/project/ext/view/create.html.php b/extension/lite/project/ext/view/create.html.php
index dcaead759c..a105f7a5b7 100644
--- a/extension/lite/project/ext/view/create.html.php
+++ b/extension/lite/project/ext/view/create.html.php
@@ -40,10 +40,12 @@
project->name;?> |
|
+ setCode) or $config->setCode == 1):?>
| project->code;?> |
|
+
| project->PM;?> |
|
diff --git a/module/action/model.php b/module/action/model.php
index 843eab0388..8aec1a5db1 100755
--- a/module/action/model.php
+++ b/module/action/model.php
@@ -984,13 +984,16 @@ class actionModel extends model
$executions = array();
if(!$this->app->user->admin)
{
- if($productID == 'all') $authedProducts = $this->app->user->view->products;
- if($projectID == 'all') $authedProjects = $this->app->user->view->projects;
- if($executionID == 'all') $authedExecutions = $this->app->user->view->sprints;
+ $aclViews = isset($this->app->user->rights['acls']['views']) ? $this->app->user->rights['acls']['views'] : array();
+ if($productID == 'all') $authedProducts = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['product']))) ? $this->app->user->view->products : '0';
+ if($projectID == 'all') $authedProjects = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['project']))) ? $this->app->user->view->projects : '0';
+ if($executionID == 'all') $authedExecutions = (empty($aclViews) or (!empty($aclViews) and !empty($aclViews['execution']))) ? $this->app->user->view->sprints : '0';
if($productID == 'all' and $projectID == 'all')
{
- $productCondition = "product " . helper::dbIN($authedProducts);
+ $productCondition = '';
+ foreach(explode(',', $authedProducts) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'";
+
$projectCondition = "project " . helper::dbIN($authedProjects);
$executionCondition = isset($authedExecutions) ? "execution " . helper::dbIN($authedExecutions) : '';
}
@@ -999,7 +1002,9 @@ class actionModel extends model
$products = $this->loadModel('product')->getProductPairsByProject($projectID);
$executions = $this->loadModel('execution')->getPairs($projectID) + array(0 => 0);
- $productCondition = "product " . helper::dbIN(array_keys($products));
+ $productCondition = '';
+ foreach(array_keys($products) as $product) $productCondition = empty($productCondition) ? "product LIKE '%,$product,%'" : "$productCondition OR product LIKE '%,$product,%'";
+
$projectCondition = "project = $projectID";
$executionCondition = "execution " . helper::dbIN(array_keys($executions));
}
@@ -1014,7 +1019,7 @@ class actionModel extends model
$executionCondition = "execution " . helper::dbIN(array_keys($executions));
}
- $condition = "((product =',0,' or product=0) AND project = '0' AND execution = 0)";
+ $condition = "((product =',0,' or product = '0') AND project = '0' AND execution = '0')";
if(!empty($productCondition)) $condition .= ' OR ' . $productCondition;
if(!empty($projectCondition)) $condition .= ' OR ' . $projectCondition;
if(!empty($executionCondition)) $condition .= ' OR ' . $executionCondition;
@@ -1086,6 +1091,7 @@ class actionModel extends model
foreach($this->app->user->rights['acls']['actions'] as $moduleName => $actions)
{
+ if(isset($this->lang->mainNav->$moduleName) and !empty($this->app->user->rights['acls']['views']) and !isset($this->app->user->rights['acls']['views'][$moduleName])) continue;
$actionCondition .= "(`objectType` = '$moduleName' and `action` " . helper::dbIN($actions) . ") or ";
}
$actionCondition = trim($actionCondition, 'or ');
@@ -1258,11 +1264,7 @@ class actionModel extends model
if(empty($action->objectName) and (substr($objectType, 0, 6) == 'gitlab' or substr($objectType, 0, 5) == 'gitea')) $action->objectName = $action->extra;
/* Other actions, create a link. */
- if(!$this->setObjectLink($action, $deptUsers))
- {
- unset($actions[$i]);
- continue;
- }
+ $this->setObjectLink($action, $deptUsers);
/* Set merge request link. */
if(empty($action->objectName) and $action->objectType == 'mr') $action->objectLink = '';
@@ -1437,7 +1439,6 @@ class actionModel extends model
/* Fix bug #2961. */
$isLoginOrLogout = $action->objectType == 'user' and ($action->action == 'login' or $action->action == 'logout');
- if(!common::hasPriv($moduleName, $methodName) and !$isLoginOrLogout) return false;
$action->objectLabel = $objectLabel;
$action->product = trim($action->product, ',');
@@ -1536,6 +1537,7 @@ class actionModel extends model
$action->objectLink = !isset($deptUsers[$action->objectID]) ? 'javascript:void(0)' : helper::createLink($moduleName, $methodName, sprintf($vars, $action->objectID));
}
}
+ if(!common::hasPriv($moduleName, $methodName) and !$isLoginOrLogout) $action->objectLink = '';
}
elseif($action->objectType == 'team')
{
diff --git a/module/block/view/dynamic.html.php b/module/block/view/dynamic.html.php
index e2e44aac2d..6e0102b36c 100644
--- a/module/block/view/dynamic.html.php
+++ b/module/block/view/dynamic.html.php
@@ -25,7 +25,7 @@
$class = $action->major ? "class='active'" : '';
echo "";
if($action->objectLink) printf($lang->block->dynamicInfo, $action->date, $user, $action->actionLabel, $action->objectLabel, $action->objectLink, $action->objectName, $action->objectName);
- if(!$action->objectLink) printf($lang->block->noLinkDynamic, $action->date, $action->objectName, $user, $action->actionLabel, $action->objectLabel, $action->objectName);
+ if(!$action->objectLink) printf($lang->block->noLinkDynamic, $action->date, $action->objectName, $user, $action->actionLabel, $action->objectLabel, ' ' . $action->objectName);
echo "
";
$i++;
}
diff --git a/module/bug/model.php b/module/bug/model.php
index 0835194d51..80ff5ef43c 100644
--- a/module/bug/model.php
+++ b/module/bug/model.php
@@ -740,6 +740,24 @@ class bugModel extends model
$this->linkBugToBuild($bugID, $bug->resolvedBuild);
}
+ $linkBugs = explode(',', $bug->linkBug);
+ $oldLinkBugs = explode(',', $oldBug->linkBug);
+ $addBugs = array_diff($linkBugs, $oldLinkBugs);
+ $removeBugs = array_diff($oldLinkBugs, $linkBugs);
+ $changeBugs = array_merge($addBugs, $removeBugs);
+ $changeBugs = $this->dao->select('id,linkbug')->from(TABLE_BUG)->where('id')->in(array_filter($changeBugs))->fetchPairs();
+ foreach($changeBugs as $changeBugID => $changeBug)
+ {
+ if(in_array($changeBugID, $addBugs) and empty($changeBug)) $this->dao->update(TABLE_BUG)->set('linkBug')->eq($bugID)->where('id')->eq((int)$changeBugID)->exec();
+ if(in_array($changeBugID, $addBugs) and !empty($changeBug)) $this->dao->update(TABLE_BUG)->set('linkBug')->eq("$changeBug,$bugID")->where('id')->eq((int)$changeBugID)->exec();
+ if(in_array($changeBugID, $removeBugs))
+ {
+ $linkBugs = explode(',', $changeBug);
+ unset($linkBugs[array_search($bugID, $linkBugs)]);
+ $this->dao->update(TABLE_BUG)->set('linkBug')->eq(implode(',', $linkBugs))->where('id')->eq((int)$changeBugID)->exec();
+ }
+ }
+
if(!empty($bug->resolvedBy)) $this->loadModel('score')->create('bug', 'resolve', $bugID);
$this->file->updateObjectID($this->post->uid, $bugID, 'bug');
diff --git a/module/ci/model.php b/module/ci/model.php
index e9b06fd86c..0d27513edc 100644
--- a/module/ci/model.php
+++ b/module/ci/model.php
@@ -29,7 +29,7 @@ class ciModel extends model
if($this->session->repoID)
{
$repo = $this->loadModel('repo')->getRepoByID($this->session->repoID);
- if(!in_array(strtolower($repo->SCM), $this->config->mr->gitServiceList)) unset($this->lang->devops->menu->mr);
+ if(!in_array(strtolower($repo->SCM), $this->config->repo->gitServiceList)) unset($this->lang->devops->menu->mr);
$this->lang->switcherMenu = $this->loadModel('repo')->getSwitcher($this->session->repoID);
}
diff --git a/module/common/view/header.html.php b/module/common/view/header.html.php
index 5e3a344972..6d67bb95e8 100755
--- a/module/common/view/header.html.php
+++ b/module/common/view/header.html.php
@@ -7,6 +7,7 @@ include 'chosen.html.php';
app->loadConfig('sso');?>
sso->redirect)) js::set('ssoRedirect', $config->sso->redirect);?>
+showMainMenu):?>