* Code for finish task #83721,83722.

This commit is contained in:
tianshujie
2023-02-06 15:41:55 +08:00
parent 7faf11867e
commit adc0616341
17 changed files with 94 additions and 39 deletions
+7 -1
View File
@@ -84,13 +84,19 @@ $lang->admin->menuList->model['menuOrder']['10'] = 'scrum';
$lang->admin->menuList->model['menuOrder']['15'] = 'waterfall';
$lang->admin->menuList->feature['subMenu']['my'] = array('link' => "{$lang->my->common}|custom|set|module=todo");
$lang->admin->menuList->feature['subMenu']['product'] = array('link' => "{$lang->productCommon}|custom|product|");
$lang->admin->menuList->feature['subMenu']['product'] = array('link' => "{$lang->productCommon}|custom|required|module=product|");
$lang->admin->menuList->feature['subMenu']['execution'] = array('link' => "{$lang->execution->common}|custom|execution|");
$lang->admin->menuList->feature['subMenu']['qa'] = array('link' => "{$lang->qa->common}|custom|required|module=bug");
$lang->admin->menuList->feature['subMenu']['kanban'] = array('link' => "{$lang->kanban->common}|custom|kanban|");
$lang->admin->menuList->feature['subMenu']['doc'] = array('link' => "{$lang->doc->common}|custom|required|module=doc");
$lang->admin->menuList->feature['subMenu']['user'] = array('link' => "{$lang->user->common}|custom|set|module=user");
$lang->admin->menuList->feature['tabMenu']['my']['todo'] = array('link' => "{$lang->todo->common}|custom|set|module=todo&field=priList");
$lang->admin->menuList->feature['tabMenu']['my']['block'] = array('link' => "{$lang->block->common}|custom|set|module=block&field=closed");
if($this->config->vision == 'lite') $lang->admin->menuList->feature['tabMenu']['my']['task'] = array();
$lang->admin->menuList->feature['tabMenu']['product']['product'] = array('link' => "{$lang->productCommon}|custom|required|module=product", 'links' => array("custom|browsestoryconcept|", 'custom|product|'));
$lang->admin->menuList->feature['menuOrder']['5'] = 'my';
$lang->admin->menuList->feature['menuOrder']['10'] = 'product';
$lang->admin->menuList->feature['menuOrder']['15'] = 'execution';
+78 -23
View File
@@ -286,36 +286,54 @@ class adminModel extends model
$orders = array();
foreach($this->lang->admin->menuList as $menuKey => $menu)
{
$menu['disabled'] = false;
$menu['disabled'] = true;
if(!isset($menu['link'])) $menu['link'] = '';
if(!empty($menu['link']) and strpos($menu['link'], '|') !== false)
/* Check sub menu priv. */
if(isset($menu['subMenu']))
{
list($module, $method) = explode('|', $menu['link']);
$menu['link'] = helper::createLink($module, $method);
if(!common::hasPriv($module, $method)) $menu['disabled'] = true;
}
$menuOrder = isset($menu['menuOrder']) ? $menu['menuOrder'] : array();
if($menuOrder)
{
ksort($menuOrder);
/* Check sub menu priv. */
foreach($menuOrder as $subOrder => $subMenuKey)
foreach($menu['subMenu'] as $subMenuKey => $subMenu)
{
list($label, $module, $method, $params) = explode('|', $menu['subMenu'][$subMenuKey]['link']);
if(!common::hasPriv($module, $method)) unset($menuOrder[$subOrder]);
}
/* Check tab menu priv. */
$link = '';
$linkLabel = '';
if(isset($menu['tabMenu'][$subMenuKey]))
{
foreach($menu['tabMenu'][$subMenuKey] as $tabMenuKey => $tabMenu)
{
list($linkLabel, $link) = $this->getMenuLink($tabMenu);
if(!empty($link)) break;
}
}
else
{
list($linkLabel, $link) = $this->getMenuLink($subMenu);
}
/* Set link. */
if(!empty($menuOrder))
if(!empty($link))
{
$menu['subMenu'][$subMenuKey]['link'] = $linkLabel;
if(empty($menu['link']))
{
$menu['link'] = $link;
$menu['disabled'] = false;
}
}
else
{
unset($this->lang->admin->menuList->feature['subMenu'][$subMenuKey]);
}
}
}
else
{
if(!empty($menu['link']) and strpos($menu['link'], '|') !== false)
{
$subMenuKey = reset($menuOrder);
list($label, $module, $method, $params) = explode('|', $menu['subMenu'][$subMenuKey]['link']);
$menu['link'] = helper::createLink($module, $method, $params);
list($module, $method) = explode('|', $menu['link']);
$menu['link'] = helper::createLink($module, $method);
if(common::hasPriv($module, $method)) $menu['disabled'] = false;
}
}
if(empty($menuOrder) and empty($menu['link'])) $menu['disabled'] = true;
$order = $menu['order'];
$orders[$order] = $menuKey;
@@ -334,6 +352,43 @@ class adminModel extends model
$this->lang->admin->menuList = $menuList;
}
/**
* Get menu link.
*
* @param array $menu
* @access public
* @return array
*/
public function getMenuLink($menu)
{
$link = '';
$linkLabel = '';
if(!empty($menu['link']))
{
list($label, $module, $method, $params) = explode('|', $menu['link']);
if(common::hasPriv($module, $method))
{
$linkLabel = $menu['link'];
$link = helper::createLink($module, $method, $params);
}
elseif(!empty($menu['links']))
{
foreach($menu['links'] as $menuLink)
{
list($module, $method, $params) = explode('|', $menuLink);
if(common::hasPriv($module, $method))
{
$linkLabel = $label . '|' . $menuLink;
$link = helper::createLink($module, $method);
break;
}
}
}
}
return array($linkLabel, $link);
}
/**
* Get menu key
*
-2
View File
@@ -10,8 +10,6 @@
* @link http://www.zentao.net
*/
global $config;
$lang->block = new stdclass();
$lang->block->common = 'InfoBlock';
$lang->block->id = 'ID';
$lang->block->params = 'Params';
$lang->block->name = 'Name';
-2
View File
@@ -10,8 +10,6 @@
* @link http://www.zentao.net
*/
global $config;
$lang->block = new stdclass();
$lang->block->common = 'Block';
$lang->block->id = 'ID';
$lang->block->params = 'Params';
$lang->block->name = 'Name';
-2
View File
@@ -10,8 +10,6 @@
* @link http://www.zentao.net
*/
global $config;
$lang->block = new stdclass();
$lang->block->common = 'Bloc';
$lang->block->id = 'ID';
$lang->block->params = 'Params';
$lang->block->name = 'Nom';
-2
View File
@@ -10,8 +10,6 @@
* @link http://www.zentao.net
*/
global $config;
$lang->block = new stdclass();
$lang->block->common = 'Block';
$lang->block->name = 'Tên';
$lang->block->style = 'Kiểu';
$lang->block->grid = 'Vị trí';
-2
View File
@@ -10,8 +10,6 @@
* @link http://www.zentao.net
*/
global $config;
$lang->block = new stdclass();
$lang->block->common = '区块';
$lang->block->id = '编号';
$lang->block->params = '参数';
$lang->block->name = '区块名称';
+1
View File
@@ -3,6 +3,7 @@ $lang->common = new stdclass();
$lang->index = new stdclass();
$lang->my = new stdclass();
$lang->todo = new stdclass();
$lang->block = new stdclass();
$lang->program = new stdclass();
$lang->programplan = new stdclass();
$lang->product = new stdclass();
+2
View File
@@ -158,6 +158,8 @@ $lang->delayed = 'Delayed';
$lang->common->common = 'Standard Module';
$lang->common->story = 'Story';
$lang->my->common = 'My';
$lang->todo->common = 'Todo';
$lang->block->common = 'InfoBlock';
$lang->program->common = 'Program';
$lang->product->common = 'Product';
$lang->project->common = 'Project';
+2
View File
@@ -158,6 +158,8 @@ $lang->delayed = 'Delayed';
$lang->common->common = 'Common Module';
$lang->common->story = 'Story';
$lang->my->common = 'My';
$lang->todo->common = 'Todo';
$lang->block->common = 'Block';
$lang->program->common = 'Program';
$lang->product->common = 'Product';
$lang->project->common = 'Project';
+2
View File
@@ -158,6 +158,8 @@ $lang->delayed = 'Delayed';
$lang->common->common = 'Module Commun';
$lang->common->story = 'Story';
$lang->my->common = 'My';
$lang->todo->common = 'Agenda';
$lang->block->common = 'Bloc';
$lang->program->common = 'Program';
$lang->product->common = 'Product';
$lang->project->common = 'Project';
+2
View File
@@ -158,6 +158,8 @@ $lang->delayed = '已延期';
$lang->common->common = '公有模块';
$lang->common->story = '需求';
$lang->my->common = '地盘';
$lang->todo->common = '待办';
$lang->block->common = '区块';
$lang->program->common = '项目集';
$lang->product->common = '产品';
$lang->project->common = '项目';
-1
View File
@@ -9,7 +9,6 @@
* @version $Id: en.php 4676 2013-04-26 06:08:23Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->todo->common = 'Todo';
$lang->todo->index = "Home";
$lang->todo->create = "Todo hinzufügen";
$lang->todo->createCycle = "Wiederkehrenden Todo hinzufügen";
-1
View File
@@ -9,7 +9,6 @@
* @version $Id: en.php 4676 2013-04-26 06:08:23Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->todo->common = 'Todo';
$lang->todo->index = "Home";
$lang->todo->create = "Add Todo";
$lang->todo->createCycle = "Add Recurred Todo";
-1
View File
@@ -9,7 +9,6 @@
* @version $Id: en.php 4676 2013-04-26 06:08:23Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->todo->common = 'Agenda';
$lang->todo->index = "Accueil";
$lang->todo->create = "Ajout Entrée";
$lang->todo->createCycle = "Ajout Tâche récurrente";
-1
View File
@@ -9,7 +9,6 @@
* @version $Id: vi.php 4676 2020-04-06 06:08:23Z quocnho@gmail.com $
* @link http://www.zentao.net
*/
$lang->todo->common = 'Việc làm';
$lang->todo->index = "Home";
$lang->todo->create = "Thêm việc";
$lang->todo->createCycle = "Thêm việc lặp lại";
-1
View File
@@ -9,7 +9,6 @@
* @version $Id: zh-cn.php 5022 2013-07-05 06:50:39Z chencongzhi520@gmail.com $
* @link http://www.zentao.net
*/
$lang->todo->common = '待办';
$lang->todo->index = "待办一览";
$lang->todo->create = "添加待办";
$lang->todo->createCycle = "创建周期待办";