Merge branch '15.0.beta3' of https://gitlab.zcorp.cc/easycorp/zentaopms into 15.0.beta3
This commit is contained in:
@@ -116,7 +116,7 @@
|
||||
</tr>
|
||||
<?php if($this->session->currentProductType != 'normal'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->branch;?></th>
|
||||
<th><?php echo sprintf($lang->product->branch, $lang->product->branchName[$this->session->currentProductType]);?></th>
|
||||
<td><?php if(!common::printLink('bug', 'browse', "productID=$bug->product&branch=$bug->branch", $branchName)) echo $branchName;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
|
||||
@@ -40,7 +40,7 @@ $lang->mainNav->report = "{$lang->navIcons['report']} {$lang->report->common}
|
||||
$lang->mainNav->system = "{$lang->navIcons['system']} {$lang->system->common}|my|team|";
|
||||
$lang->mainNav->admin = "{$lang->navIcons['admin']} {$lang->admin->common}|admin|index|";
|
||||
|
||||
$lang->dividerMenu = ',devops,system,';
|
||||
$lang->dividerMenu = ',doc,admin,';
|
||||
$lang->mainNav->menuOrder[5] = 'my';
|
||||
if($config->systemMode == 'new') $lang->mainNav->menuOrder[10] = 'program';
|
||||
$lang->mainNav->menuOrder[15] = 'product';
|
||||
|
||||
+12
-7
@@ -577,13 +577,23 @@ class commonModel extends model
|
||||
|
||||
$items = array();
|
||||
$lastItem = end($menuOrder);
|
||||
$divider = false;
|
||||
foreach($menuOrder as $key => $group)
|
||||
{
|
||||
$nav = $lang->mainNav->$group;
|
||||
list($title, $currentModule, $currentMethod, $vars) = explode('|', $nav);
|
||||
|
||||
/* When last divider is not used in mainNav, use it next menu. */
|
||||
$divider = ($divider || ($lastItem != $key) && strpos($lang->dividerMenu, ",{$group},") !== false) ? true : false;
|
||||
|
||||
if(!common::hasPriv($currentModule, $currentMethod)) continue;
|
||||
|
||||
if($divider)
|
||||
{
|
||||
$items[] = 'divider';
|
||||
$divider = false;
|
||||
}
|
||||
|
||||
$item = new stdClass();
|
||||
$item->group = $group;
|
||||
$item->code = $group;
|
||||
@@ -595,11 +605,6 @@ class commonModel extends model
|
||||
$item->url = helper::createLink($currentModule, $currentMethod, $vars, '', 0, 0, 1);
|
||||
|
||||
$items[] = $item;
|
||||
|
||||
if(($lastItem != $key) && strpos($lang->dividerMenu, ",{$group},") !== false)
|
||||
{
|
||||
$items[] = 'divider';
|
||||
}
|
||||
}
|
||||
return $items;
|
||||
}
|
||||
@@ -633,7 +638,7 @@ class commonModel extends model
|
||||
{
|
||||
if(isset($menuItem->hidden) && $menuItem->hidden) continue;
|
||||
if(empty($menuItem->link)) continue;
|
||||
if(isset($lang->$openApp->dividerMenu) and strpos($lang->$openApp->dividerMenu, ",{$menuItem->name},") !== false) echo "<li class='divider'></li>";
|
||||
if($menuItem->divider) echo "<li class='divider'></li>";
|
||||
|
||||
/* Init the these vars. */
|
||||
$alias = isset($menuItem->alias) ? $menuItem->alias : '';
|
||||
@@ -814,7 +819,7 @@ class commonModel extends model
|
||||
{
|
||||
if(isset($menuItem->hidden) && $menuItem->hidden) continue;
|
||||
if($isMobile and empty($menuItem->link)) continue;
|
||||
if(isset($lang->$moduleName->dividerMenu) and strpos($lang->$moduleName->dividerMenu, ",{$menuItem->name},") !== false) echo "<li class='divider'></li>";
|
||||
if($menuItem->divider) echo "<li class='divider'></li>";
|
||||
|
||||
/* Init the these vars. */
|
||||
$alias = isset($menuItem->alias) ? $menuItem->alias : '';
|
||||
|
||||
+15
-1
@@ -217,6 +217,7 @@ class customModel extends model
|
||||
if(is_array($allMenu) and !isset($allMenu[$name])) $allMenu[$name] = $item;
|
||||
}
|
||||
|
||||
$divider = false;
|
||||
foreach($allMenu as $name => $item)
|
||||
{
|
||||
if(is_object($item)) $item = (array)$item;
|
||||
@@ -244,6 +245,13 @@ class customModel extends model
|
||||
$hasPriv = commonModel::hasPriv($module, $method);
|
||||
}
|
||||
|
||||
/* When last divider is not used in mainMenu, use it next menu. */
|
||||
if($menuModuleName == 'main')
|
||||
{
|
||||
$openApp = $app->openApp;
|
||||
$divider = $divider || (isset($lang->$openApp->dividerMenu) and strpos($lang->$openApp->dividerMenu, ",{$name},") !== false) ? true : false;
|
||||
}
|
||||
|
||||
if($isTutorialMode || $hasPriv)
|
||||
{
|
||||
$itemLink = '';
|
||||
@@ -304,6 +312,10 @@ class customModel extends model
|
||||
if($exclude) $menuItem->exclude = $exclude;
|
||||
if($isTutorialMode) $menuItem->tutorial = true;
|
||||
|
||||
/* Set divider and reset it. */
|
||||
$menuItem->divider = $divider;
|
||||
$divider = false;
|
||||
|
||||
/* Hidden menu by config in mobile. */
|
||||
if($app->viewType == 'mhtml' and isset($config->custom->moblieHidden[$menuModuleName]) and in_array($name, $config->custom->moblieHidden[$menuModuleName])) $menuItem->hidden = 1;
|
||||
|
||||
@@ -325,9 +337,10 @@ class customModel extends model
|
||||
*/
|
||||
public static function getModuleMenu($module = 'main', $rebuild = false)
|
||||
{
|
||||
global $app, $lang, $config;
|
||||
|
||||
if(empty($module)) $module = 'main';
|
||||
|
||||
global $app, $lang, $config;
|
||||
$allMenu = new stdclass();
|
||||
if($module == 'main' and !empty($lang->menu)) $allMenu = $lang->menu;
|
||||
if($module != 'main' and isset($lang->menu->$module) and isset($lang->menu->{$module}['subMenu'])) $allMenu = $lang->menu->{$module}['subMenu'];
|
||||
@@ -337,6 +350,7 @@ class customModel extends model
|
||||
if(commonModel::isTutorialMode() && $module === 'main') $customMenu = 'my,product,project,qa,company';
|
||||
if(!empty($customMenu) && is_string($customMenu) && substr($customMenu, 0, 1) === '[') $customMenu = json_decode($customMenu);
|
||||
if($module == 'my' && empty($config->global->scoreStatus)) unset($allMenu->score);
|
||||
|
||||
$menu = self::setMenuByConfig($allMenu, $customMenu, $module);
|
||||
|
||||
return $menu;
|
||||
|
||||
@@ -110,7 +110,7 @@ class productModel extends model
|
||||
if($currentProduct->type == 'normal' || !$withBranch) unset($this->lang->product->menu->settings['subMenu']->branch);
|
||||
if($currentProduct->type != 'normal' && $currentModule != 'programplan' && $withBranch)
|
||||
{
|
||||
$this->lang->product->branch = $this->lang->product->branchName[$currentProduct->type];
|
||||
$this->lang->product->branch = sprintf($this->lang->product->branch, $this->lang->product->branchName[$currentProduct->type]);
|
||||
$this->lang->product->menu->settings['subMenu']->branch = str_replace('@branch@', $this->lang->product->branch, $this->lang->product->menu->settings['subMenu']->branch);
|
||||
|
||||
$branches = $this->loadModel('branch')->getPairs($productID);
|
||||
|
||||
@@ -432,7 +432,7 @@ class programModel extends model
|
||||
while($program = $stmt->fetch())
|
||||
{
|
||||
$link = $from == 'program' ? helper::createLink($moduleName, $methodName, "programID=$program->id") : helper::createLink('product', 'all', "programID=$program->id" . $vars);
|
||||
$linkHtml = html::a($link, html::icon($this->lang->icons[$program->type], 'icon icon-sm text-muted') . ' ' . $program->name, '', "id='program$program->id' class='text-ellipsis' title=$program->name");
|
||||
$linkHtml = html::a($link, $program->name, '', "id='program$program->id' class='text-ellipsis' title=$program->name");
|
||||
|
||||
if(isset($programMenu[$program->id]) and !empty($programMenu[$program->id]))
|
||||
{
|
||||
|
||||
@@ -146,17 +146,17 @@
|
||||
<?php if($isLibCase):?>
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->testcase->lib;?></th>
|
||||
<td><?php if(!common::printLink('caselib', 'browse', "libID=$case->lib", $libName)) echo $libName;?></td>
|
||||
<td><?php echo common::hasPriv('caselib', 'browse') ? html::a($this->createLink('caselib', 'browse', "libID=$case->lib"), $libName) : $libName;?></td>
|
||||
</tr>
|
||||
<?php else:?>
|
||||
<tr>
|
||||
<th class='thWidth'><?php echo $lang->testcase->product;?></th>
|
||||
<td><?php if(!common::printLink('product', 'browse', "productID=$case->product", $productName)) echo $productName;?></td>
|
||||
<td><?php echo common::hasPriv('product', 'browse') ? html::a($this->createLink('product', 'browse', "productID=$case->product"), $productName) : $productName;?></td>
|
||||
</tr>
|
||||
<?php if($this->session->currentProductType != 'normal'):?>
|
||||
<tr>
|
||||
<th><?php echo $lang->product->branch;?></th>
|
||||
<td><?php if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$case->branch", $branchName)) echo $branchName;?></td>
|
||||
<th><?php echo sprintf($lang->product->branch, $lang->product->branchName[$this->session->currentProductType]);?></th>
|
||||
<td><?php echo common::hasPriv('testcase', 'browse') ? html::a($this->createLink('testcase', 'browse', "productID=$case->product&branch=$case->branch"), $branchName) : $branchName;?></td>
|
||||
</tr>
|
||||
<?php endif;?>
|
||||
<?php endif;?>
|
||||
@@ -177,7 +177,8 @@
|
||||
|
||||
foreach($modulePath as $key => $module)
|
||||
{
|
||||
if(!common::printLink('testcase', 'browse', "productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
if($this->app->openApp == 'qa' and !common::printLink('testcase', 'browse', "productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
if($this->app->openApp == 'project' and !common::printLink('project', 'testcase', "projectID={$this->session->project}&productID=$case->product&branch=$module->branch&browseType=byModule¶m=$module->id", $module->name)) echo $module->name;
|
||||
if(isset($modulePath[$key + 1])) echo $lang->arrow;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user