This commit is contained in:
宋辰轩
2023-04-24 16:23:47 +08:00
12 changed files with 72 additions and 34 deletions
+19 -6
View File
@@ -61,6 +61,8 @@ html[lang="de"] .block-productdoc .c-user{width: 105px;}
.block-productdoc .table .c-title > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
</style>
<?php $blockNavId = 'nav-' . uniqid(); ?>
<?php js::set('emptyProducts', empty($products));?>
<?php js::set('emptyInvolveds', empty($involveds));?>
<script>
$(function()
{
@@ -90,6 +92,18 @@ function switch<?php echo "block{$block->id}";?>Product(obj)
function change<?php echo "block{$block->id}";?>ProductType(type)
{
var hiddenData = type == 'all' ? emptyProducts : emptyInvolveds;
if(hiddenData)
{
$('.block-productdoc<?php echo "#block{$block->id}";?> .dataBlock').addClass('hidden');
$('.block-productdoc<?php echo "#block{$block->id}";?> .block-statistic > .table-empty-tip').removeClass('hidden');
}
else
{
$('.block-productdoc<?php echo "#block{$block->id}";?> .dataBlock').removeClass('hidden');
$('.block-productdoc<?php echo "#block{$block->id}";?> .block-statistic > .table-empty-tip').addClass('hidden');
}
$('.block-productdoc<?php echo "#block{$block->id}";?> .nav.products').toggleClass('hidden', type != 'all');
$('.block-productdoc<?php echo "#block{$block->id}";?> .nav.involveds').toggleClass('hidden', type != 'involved');
$('.block-productdoc<?php echo "#block{$block->id}";?> #productType .btn').html($('.block-productdoc<?php echo "#block{$block->id}";?> #productType [data-type=' + type + ']').html() + " <span class='caret'></span>");
@@ -112,14 +126,14 @@ function change<?php echo "block{$block->id}";?>ProductType(type)
<li><a href="javascript:change<?php echo "block{$block->id}";?>ProductType('all')" data-type='all'><?php echo $lang->product->all;?></a></li>
</ul>
</div>
<?php $hiddenBlock = empty($involveds) ? 'hidden' : '';?>
<?php $hiddenEmpty = empty($involveds) ? '' : 'hidden';?>
<div class="panel-body">
<div class="table-row block-statistic">
<?php if(empty($products) and empty($involveds)):?>
<div class="table-empty-tip">
<div class="table-empty-tip <?php echo $hiddenEmpty;?>">
<p><span class="text-muted"><?php echo $lang->block->emptyTip;?></span></p>
</div>
<?php else:?>
<div class="col col-nav">
<div class="col col-nav dataBlock <?php echo $hiddenBlock;?>">
<ul class="nav nav-stacked nav-secondary scrollbar-hover involveds">
<li class='switch-icon prev'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Product(this)'><i class='icon icon-arrow-left'></i></a></li>
<?php $selected = key($involveds);?>
@@ -142,7 +156,7 @@ function change<?php echo "block{$block->id}";?>ProductType(type)
<li class='switch-icon next'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Product(this)'><i class='icon icon-arrow-right'></i></a></li>
</ul>
</div>
<div class="col tab-content">
<div class="col tab-content dataBlock <?php echo $hiddenBlock;?>">
<?php foreach($products as $product):?>
<div class="tab-pane fade<?php if($product->id == $selected) echo ' active in';?>" id='<?php echo "tab3{$blockNavId}Content{$product->id}";?>'>
<?php if(isset($docGroup[$product->id])):?>
@@ -190,6 +204,5 @@ function change<?php echo "block{$block->id}";?>ProductType(type)
</div>
<?php endforeach;?>
</div>
<?php endif;?>
</div>
</div>
+20 -7
View File
@@ -60,8 +60,10 @@ html[lang="de"] .block-projectdoc .c-user{width: 105px;}
.block-projectdoc .table .c-title[data-status=draft] > .doc-title {max-width: calc(100% - 35px);}
.block-projectdoc .table .c-title > .draft {background-color:rgba(129, 102, 238, 0.12); color:#8166EE;}
</style>
<?php $blockNavId = 'nav-' . uniqid();?>
<?php js::set('emptyProjects', empty($projects));?>
<?php js::set('emptyInvolveds', empty($involveds));?>
<script>
<?php $blockNavId = 'nav-' . uniqid(); ?>
$(function()
{
if($('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType').length > 1);
@@ -90,6 +92,18 @@ function switch<?php echo "block{$block->id}";?>Project(obj)
function change<?php echo "block{$block->id}";?>ProjectType(type)
{
var hiddenData = type == 'all' ? emptyProjects : emptyInvolveds;
if(hiddenData)
{
$('.block-projectdoc<?php echo "#block{$block->id}";?> .dataBlock').addClass('hidden');
$('.block-projectdoc<?php echo "#block{$block->id}";?> .block-statistic > .table-empty-tip').removeClass('hidden');
}
else
{
$('.block-projectdoc<?php echo "#block{$block->id}";?> .dataBlock').removeClass('hidden');
$('.block-projectdoc<?php echo "#block{$block->id}";?> .block-statistic > .table-empty-tip').addClass('hidden');
}
$('.block-projectdoc<?php echo "#block{$block->id}";?> .nav.projects').toggleClass('hidden', type != 'all');
$('.block-projectdoc<?php echo "#block{$block->id}";?> .nav.involveds').toggleClass('hidden', type != 'involved');
$('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType .btn').html($('.block-projectdoc<?php echo "#block{$block->id}";?> #projectType [data-type=' + type + ']').html() + " <span class='caret'></span>");
@@ -112,14 +126,14 @@ function change<?php echo "block{$block->id}";?>ProjectType(type)
<li><a href="javascript:change<?php echo "block{$block->id}";?>ProjectType('all')" data-type='all'><?php echo $lang->project->all;?></a></li>
</ul>
</div>
<?php $hiddenBlock = empty($involveds) ? 'hidden' : '';?>
<?php $hiddenEmpty = empty($involveds) ? '' : 'hidden';?>
<div class="panel-body">
<div class="table-row block-statistic">
<?php if(empty($projects) and empty($involveds)):?>
<div class="table-empty-tip">
<div class="table-empty-tip <?php echo $hiddenEmpty;?>">
<p><span class="text-muted"><?php echo $lang->block->emptyTip;?></span></p>
</div>
<?php else:?>
<div class="col col-nav">
<div class="col col-nav dataBlock <?php echo $hiddenBlock;?>">
<ul class="nav nav-stacked nav-secondary scrollbar-hover involveds">
<li class='switch-icon prev'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Project(this)'><i class='icon icon-arrow-left'></i></a></li>
<?php $selected = key($involveds);?>
@@ -142,7 +156,7 @@ function change<?php echo "block{$block->id}";?>ProjectType(type)
<li class='switch-icon next'><a href='###' onclick='switch<?php echo "block{$block->id}";?>Project(this)'><i class='icon icon-arrow-right'></i></a></li>
</ul>
</div>
<div class="col tab-content">
<div class="col tab-content dataBlock <?php echo $hiddenBlock;?>">
<?php foreach($projects as $project):?>
<div class="tab-pane fade<?php if($project->id == $selected) echo ' active in';?>" id='<?php echo "tab3{$blockNavId}Content{$project->id}";?>'>
<?php if(isset($docGroup[$project->id])):?>
@@ -190,6 +204,5 @@ function change<?php echo "block{$block->id}";?>ProjectType(type)
</div>
<?php endforeach;?>
</div>
<?php endif;?>
</div>
</div>
+9
View File
@@ -266,6 +266,15 @@ $lang->waterfall->menu->release = array('link' => "{$lang->release->common}|p
$lang->waterfall->menu->dynamic = array('link' => "$lang->dynamic|project|dynamic|project=%s");
$lang->waterfall->menu->settings = array('link' => "$lang->settings|project|view|project=%s", 'subModule' => 'stakeholder', 'alias' => 'edit,manageproducts,group,managemembers,manageview,managepriv,whitelist,addwhitelist,team', 'exclude' => 'tree-browsetask');
$lang->waterfall->menu->settings['subMenu'] = new stdclass();
$lang->waterfall->menu->settings['subMenu']->view = array('link' => "$lang->overview|project|view|project=%s", 'alias' => 'edit');
$lang->waterfall->menu->settings['subMenu']->products = array('link' => "{$lang->productCommon}|project|manageProducts|project=%s", 'alias' => 'manageproducts');
$lang->waterfall->menu->settings['subMenu']->members = array('link' => "{$lang->team->common}|project|team|project=%s", 'alias' => 'managemembers,team');
$lang->waterfall->menu->settings['subMenu']->whitelist = array('link' => "{$lang->whitelist}|project|whitelist|project=%s", 'subModule' => 'personnel');
$lang->waterfall->menu->settings['subMenu']->stakeholder = array('link' => "{$lang->stakeholder->common}|stakeholder|browse|project=%s", 'subModule' => 'stakeholder');
$lang->waterfall->menu->settings['subMenu']->group = array('link' => "{$lang->priv}|project|group|project=%s", 'alias' => 'group,manageview,managepriv');
$lang->waterfall->menu->settings['subMenu']->module = array('link' => "{$lang->module}|tree|browse|product=%s&view=story");
$lang->waterfall->dividerMenu = ',programplan,build,dynamic,';
$lang->waterfall->menu->storyGroup['dropMenu'] = $lang->scrum->menu->storyGroup['dropMenu'];
+1 -1
View File
@@ -1374,7 +1374,7 @@ class doc extends control
*/
public function productSpace($objectID = 0, $libID = 0, $moduleID = 0, $browseType = 'all', $orderBy = 'status,id_desc', $param = 0, $recTotal = 0, $recPerPage = 20, $pageID = 1)
{
$products = $this->product->getPairs('nocode', 0, '', 'all');
$products = $this->product->getPairs('nocode');
$objectID = $this->product->saveState($objectID, $products);
echo $this->fetch('doc', 'tableContents', "type=product&objectID=$objectID&libID=$libID&moduleID=$moduleID&browseType=$browseType&orderBy=$orderBy&param=$param&recTotal=$recTotal&recPerPage=$recPerPage&pageID=$pageID");
+1 -1
View File
@@ -2830,7 +2830,7 @@ class docModel extends model
else
{
$libs = $this->getLibsByObject($type, 0, '', $appendLib);
if($libID == 0 and !empty($libs)) $libID = reset($libs)->id;
if(($libID == 0 or !isset($libs[$libID])) and !empty($libs)) $libID = reset($libs)->id;
if(isset($libs[$libID]))
{
$objectTitle = zget($libs[$libID], 'name', '');
+1 -1
View File
@@ -197,7 +197,7 @@ class group extends control
* @access public
* @return void
*/
public function managePriv($type = 'byGroup', $param = 0, $menu = '', $version = '')
public function managePriv($type = 'byPackage', $param = 0, $menu = '', $version = '')
{
if($type == 'byGroup' or $type == 'byPackage') $groupID = $param;
+12 -9
View File
@@ -1602,9 +1602,8 @@ class groupModel extends model
{
$modules = $this->getPrivManagerPairs('module', $view);
$modules = array_keys($modules);
$modules = implode(',', $modules);
$privs = $this->dao->select("t1.id, t1.module, t1.method, CONCAT(t1.module, '-', t1.method) AS action, IF(t3.type = 'module', 0, t1.parent) as parent, t1.order, t2.`key`, t2.`value`, t2.desc, IF(t3.type = 'module', t3.code, t4.code) as parentCode, IF(t3.type = 'module', 999, INSTR('$modules', t4.code)) as moduleOrder")->from(TABLE_PRIV)->alias('t1')
$privs = $this->dao->select("t1.id, t1.module, t1.method, CONCAT(t1.module, '-', t1.method) AS action, IF(t3.type = 'module', 0, t1.parent) as parent, t1.order, t2.`key`, t2.`value`, t2.desc, IF(t3.type = 'module', t3.code, t4.code) as parentCode")->from(TABLE_PRIV)->alias('t1')
->leftJoin(TABLE_PRIVLANG)->alias('t2')->on('t1.id=t2.objectID')
->leftJoin(TABLE_PRIVMANAGER)->alias('t3')->on('t1.parent=t3.id')
->leftJoin(TABLE_PRIVMANAGER)->alias('t4')->on('t3.parent=t4.id')
@@ -1623,10 +1622,12 @@ class groupModel extends model
->markRight(2)
->andWhere('t1.edition')->like("%,{$this->config->edition},%")
->andWhere('t1.vision')->like("%,{$this->config->vision},%")
->orderBy("moduleOrder asc, t3.order asc, `order` asc")
->orderBy("t3.order asc, `order` asc")
->page($pager)
->fetchAll('action');
return $privs;
->fetchGroup('parentCode', 'action');
$privList = array(); foreach($modules as $module) $privList = array_merge($privList, zget($privs, $module, array()));
return $privList;
}
/**
@@ -2209,8 +2210,7 @@ class groupModel extends model
{
$modulePairs = $this->getPrivManagerPairs('module');
$modules = array_keys($modulePairs);
$modules = implode(',', $modules);
$relatedPrivs = $this->dao->select("t1.relationPriv,t1.type,t2.parent,t2.module,t2.method,t2.`order`,t3.`key`,t3.value, IF(t4.type = 'module', 999, INSTR('$modules', t5.code)) as moduleOrder")->from(TABLE_PRIVRELATION)->alias('t1')
$privs = $this->dao->select("t1.relationPriv,t1.type,t2.parent,t2.module,t2.method,t2.`order`,t3.`key`,t3.value, IF(t4.type = 'module', t4.code, t5.code) as parentCode")->from(TABLE_PRIVRELATION)->alias('t1')
->leftJoin(TABLE_PRIV)->alias('t2')->on('t1.relationPriv=t2.id')
->leftJoin(TABLE_PRIVLANG)->alias('t3')->on('t1.relationPriv=t3.objectID')
->leftJoin(TABLE_PRIVMANAGER)->alias('t4')->on('t2.parent=t4.id')
@@ -2238,8 +2238,11 @@ class groupModel extends model
->andWhere('t5.type')->eq('view')
->beginIF(!empty($view) and $view != 'general')->andWhere('t1.module')->in($modules)->fi()
->markRight(2)
->orderBy('moduleOrder asc, t2.`order`_asc, t1.`type` desc')
->fetchAll('relationPriv');
->orderBy('t2.`order`_asc, t1.`type` desc')
->fetchGroup('parentCode', 'relationPriv');
$relatedPrivs = array();
foreach($modules as $module) $relatedPrivs = array_merge($relatedPrivs, zget($privs, $module, array()));
$privList = empty($type) ? array('depend' => array(), 'recommend' => array()) : array($type => array());
if(empty($relatedPrivs)) return $privList;
+1 -1
View File
@@ -54,7 +54,7 @@
<?php echo "<button class='btn disabled'><i class='icon icon-copy disabled' title='{$lang->group->copy}'></i></button>";?>
<?php else:?>
<?php common::printIcon('group', 'manageView', "groupID=$group->id", $group, 'list', 'eye');?>
<?php common::printIcon('group', 'managepriv', "type=byGroup&param=$group->id", $group, 'list', 'lock');?>
<?php common::printIcon('group', 'managepriv', "type=byPackage&param=$group->id", $group, 'list', 'lock');?>
<?php common::printIcon('group', 'manageMember', "groupID=$group->id", $group, 'list', 'persons', '', "iframe", true, "data-width='90%'");?>
<?php common::printIcon('group', 'edit', "groupID=$group->id", $group, 'list', '', '', "iframe", true, "data-width='550'");?>
<?php common::printIcon('group', 'copy', "groupID=$group->id", $group, 'list', '', '', "iframe", true, "data-width='550'");?>
+1 -1
View File
@@ -80,8 +80,8 @@
<div id='mainContainer'>
<div class='main main-content'>
<div class="btn-group">
<?php echo html::a(inlink('managePriv', "type=byGroupbyPackage&param=$groupID&menu=$menu&version=$version"), "<i class='icon-without-authority-pack'></i>", '', "class='btn btn-icon switchBtn text-primary'");?>
<?php echo html::a(inlink('managePriv', "type=byPackage&param=$groupID&menu=$menu&version=$version"), "<i class='icon-has-authority-pack'></i>", '', "class='btn btn-icon switchBtn'");?>
<?php echo html::a(inlink('managePriv', "type=byGroupbyPackage&param=$groupID&menu=$menu&version=$version"), "<i class='icon-without-authority-pack'></i>", '', "class='btn btn-icon switchBtn text-primary'");?>
</div>
<table class='table table-hover table-striped table-bordered' id='privList'>
<thead>
+1 -1
View File
@@ -80,8 +80,8 @@
<div id='mainContainer'>
<div class='main main-content'>
<div class="btn-group">
<?php echo html::a(inlink('managePriv', "type=byGroup&param=$groupID&menu=$menu&version=$version"), "<i class='icon-without-authority-pack'></i>", '', "class='btn btn-icon switchBtn'");?>
<?php echo html::a(inlink('managePriv', "type=byPackage&param=$groupID&menu=$menu&version=$version"), "<i class='icon-has-authority-pack'></i>", '', "class='btn btn-icon switchBtn text-primary'");?>
<?php echo html::a(inlink('managePriv', "type=byGroup&param=$groupID&menu=$menu&version=$version"), "<i class='icon-without-authority-pack'></i>", '', "class='btn btn-icon switchBtn'");?>
</div>
<table class='table table-hover table-striped table-bordered' id='privPackageList'>
<thead>
+3 -3
View File
@@ -4516,7 +4516,7 @@ class testcaseModel extends model
'removeNamespace' => true, // Remove namespace from resulting keys
'namespaceSeparator' => ':', // Change separator to something other than a colon
'attributePrefix' => '', // Distinguish between attributes and nodes with the same name
'alwaysArray' => [], // Array of XML tag names which should always become arrays
'alwaysArray' => array(), // Array of XML tag names which should always become arrays
'autoArray' => true, // Create arrays for tags which appear more than once
'textContent' => 'text', // Key used for the text content of elements
'autoText' => true, // Skip textContent key if node has no attributes or child nodes
@@ -4529,7 +4529,7 @@ class testcaseModel extends model
$namespaces[''] = null; // Add empty base namespace
/* Get attributes from all namespaces. */
$attributesArray = [];
$attributesArray = array();
foreach($namespaces as $prefix => $namespace)
{
if($options['removeNamespace']) $prefix = '';
@@ -4545,7 +4545,7 @@ class testcaseModel extends model
}
// Get child nodes from all namespaces
$tagsArray = [];
$tagsArray = array();
foreach($namespaces as $prefix => $namespace)
{
if($options['removeNamespace']) $prefix = '';
+3 -3
View File
@@ -387,7 +387,7 @@ $('#module' + moduleID).closest('li').addClass('active');
$('#' + caseBrowseType + 'Tab').addClass('btn-active-text').find('.text').after(" <span class='label label-light label-badge'><?php echo $pager->recTotal;?></span>");
function runAutocase()
{
var caseIDList = [];
var caseIDList = array();
$.each($('input[name^=caseIDList]:checked'),function(){
caseIDList.push($(this).val());
});
@@ -452,8 +452,8 @@ function toOrder(sourceId,targetId)
{
if(!checkProduct(sourceId, targetId)) return;
var origOrders = [];
var newOrders = [];
var origOrders = array();
var newOrders = array();
var productID = 0;
$('#caseTableList > tr').each(function(i, elem){