This commit is contained in:
zhujinyong
2021-08-11 11:41:43 +08:00
22 changed files with 161 additions and 63 deletions
+2 -2
View File
@@ -98,8 +98,8 @@ $config->hourPointCommonList['vi'][0] = 'giờ';
$config->hourPointCommonList['vi'][1] = 'điểm';
$config->hourPointCommonList['vi'][2] = 'function point';
$config->manualUrl['home'] = 'https://www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao';
$config->manualUrl['int'] = 'https://www.zentao.pm/book/zentaomanual/zentao-installation-11.html?fullScreen=zentao';
$config->manualUrl['home'] = 'https://www.zentao.net/book/zentaopmshelp.html?fullScreen=zentao&theme=' . $_COOKIE['theme'];
$config->manualUrl['int'] = 'https://www.zentao.pm/book/zentaomanual/zentao-installation-11.html?fullScreen=zentao&theme=' . $_COOKIE['theme'];
/* Supported charsets. */
$config->charsets['zh-cn']['utf-8'] = 'UTF-8';
+9 -6
View File
@@ -104,13 +104,16 @@ if(empty($type)) $type = 'product';
echo $html;
?>
<?php
if($type == 'book')
if(!empty($libs))
{
common::printLink('doc', 'manageBook', "bookID=$libID", $lang->doc->manageBook, '', "class='btn btn-info btn-wide'");
}
elseif(!empty($libs))
{
common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);
if($type == 'book')
{
common::printLink('doc', 'manageBook', "bookID=$libID", $lang->doc->manageBook, '', "class='btn btn-info btn-wide'");
}
else
{
common::printLink('tree', 'browse', "rootID=$libID&view=doc", $lang->doc->manageType, '', "class='btn btn-info btn-wide iframe'", '', true);
}
}
?>
</div>
+3 -2
View File
@@ -2904,10 +2904,11 @@ class execution extends control
*
* @param int $executionID
* @param int $deptID
* @param int $copyID
* @access public
* @return void
*/
public function addWhitelist($executionID = 0, $deptID = 0)
public function addWhitelist($executionID = 0, $deptID = 0, $copyID = 0)
{
/* use first execution if executionID does not exist. */
if(!isset($this->executions[$executionID])) $executionID = key($this->executions);
@@ -2915,7 +2916,7 @@ class execution extends control
/* Set the menu. If the executionID = 0, use the indexMenu instead. */
$this->execution->setMenu($executionID);
echo $this->fetch('personnel', 'addWhitelist', "objectID=$executionID&dept=$deptID&objectType=sprint&module=execution");
echo $this->fetch('personnel', 'addWhitelist', "objectID=$executionID&dept=$deptID&copyID=$copyID&objectType=sprint&module=execution");
}
/*
+1
View File
@@ -98,6 +98,7 @@ $lang->execution->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->execution->recent = 'Recent visits: ';
$lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . 'available to copy.';
$lang->execution->noTeam = 'No team members at the moment';
$lang->execution->or = ' or ';
$lang->execution->start = 'Start';
$lang->execution->activate = 'Aktivieren';
+1
View File
@@ -99,6 +99,7 @@ $lang->execution->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->execution->recent = 'Recent visits: ';
$lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . 'available to copy.';
$lang->execution->noTeam = 'No team members at the moment';
$lang->execution->or = ' or ';
$lang->execution->start = 'Start';
$lang->execution->activate = 'Activate';
+1
View File
@@ -98,6 +98,7 @@ $lang->execution->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->execution->recent = 'Recent visits: ';
$lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . 'available to copy.';
$lang->execution->noTeam = 'No team members at the moment';
$lang->execution->or = ' or ';
$lang->execution->start = 'Démarrer';
$lang->execution->activate = 'Activer';
+1
View File
@@ -99,6 +99,7 @@ $lang->execution->noLinkProduct = "Stage not linked {$lang->productCommon}";
$lang->execution->recent = 'Recent visits: ';
$lang->execution->copyNoExecution = 'There are no ' . $lang->executionCommon . 'available to copy.';
$lang->execution->noTeam = 'No team members at the moment';
$lang->execution->or = ' or ';
$lang->execution->start = 'Bắt đầu';
$lang->execution->activate = 'Kích hoạt';
+1
View File
@@ -99,6 +99,7 @@ $lang->execution->noLinkProduct = "阶段没有关联{$lang->productCommon}";
$lang->execution->recent = '近期访问:';
$lang->execution->copyNoExecution = '没有可用的' . $lang->executionCommon . '来复制';
$lang->execution->noTeam = '暂时没有团队成员';
$lang->execution->or = '或';
$lang->execution->start = "开始";
$lang->execution->activate = "激活";
+1 -1
View File
@@ -463,7 +463,7 @@
{
var $item = $(this);
var isDivider = $item.hasClass('divider');
var height = isDivider ? 17 : 40;
var height = isDivider ? 17 : $item.outerHeight();
currentHeight += height;
if(currentHeight > maxHeight)
{
+31 -12
View File
@@ -145,6 +145,7 @@ class personnel extends control
*
* @param int $objectID
* @param int $deptID
* @param int $copyID
* @param string $objectType program|project|product|sprint
* @param string $module
* @param int $programID
@@ -152,7 +153,7 @@ class personnel extends control
* @access public
* @return void
*/
public function addWhitelist($objectID = 0, $deptID = 0, $objectType = 'program', $module = 'personnel', $programID = 0, $from = '')
public function addWhitelist($objectID = 0, $deptID = 0, $copyID = 0, $objectType = 'program', $module = 'personnel', $programID = 0, $from = '')
{
if($this->app->openApp == 'program')
{
@@ -180,20 +181,38 @@ class personnel extends control
$this->loadModel('dept');
$deptUsers = empty($deptID) ? array() : $this->dept->getDeptUserPairs($deptID);
$copyObjectType = $objectType;
if($copyObjectType == 'sprint')
{
$object = $this->loadModel('project')->getByID($copyID);
if(!empty($object)) $copyObjectType = 'project';
}
$copyUsers = empty($copyID) ? array() : $this->personnel->getWhitelistAccount($copyID, $copyObjectType);
$appendUsers = array_unique($deptUsers + $copyUsers);
$objectName = $this->lang->projectCommon . $this->lang->execution->or . $this->lang->execution->common;
if($objectType == 'program') $objectName = $this->lang->program->common;
if($objectType == 'product') $objectName = $this->lang->productCommon;
if($objectType == 'project') $objectName = $this->lang->projectCommon;
$this->lang->personnel->selectObjectTips = sprintf($this->lang->personnel->selectObjectTips, $objectName);
$this->view->title = $this->lang->personnel->addWhitelist;
$this->view->position[] = $this->lang->personnel->addWhitelist;
$this->view->objectID = $objectID;
$this->view->objectType = $objectType;
$this->view->module = $module;
$this->view->deptID = $deptID;
$this->view->deptUsers = $deptUsers;
$this->view->whitelist = $this->personnel->getWhitelist($objectID, $objectType);
$this->view->depts = $this->dept->getOptionMenu();
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
$this->view->dept = $this->dept->getByID($deptID);
$this->view->programID = $programID;
$this->view->from = $from;
$this->view->objectID = $objectID;
$this->view->objectType = $objectType;
$this->view->objectName = $objectName;
$this->view->objects = array('' => '') + $this->personnel->getCopyObjects($objectID, $objectType);
$this->view->module = $module;
$this->view->deptID = $deptID;
$this->view->appendUsers = $appendUsers;
$this->view->whitelist = $this->personnel->getWhitelist($objectID, $objectType);
$this->view->depts = $this->dept->getOptionMenu();
$this->view->users = $this->loadModel('user')->getPairs('noclosed|nodeleted');
$this->view->dept = $this->dept->getByID($deptID);
$this->view->programID = $programID;
$this->view->from = $from;
$this->view->copyID = $copyID;
$this->display();
}
+8 -7
View File
@@ -1,15 +1,16 @@
/**
* Users by department.
* Users by dept,execution,project,product or program.
*
* @param object dept
* @param object $object
* @access public
* @return void
*/
function setDeptUsers(dept)
function setObjectUsers()
{
var deptID = $(dept).val();
var link = createLink(module, moduleMethod, 'objectID=' + objectID + '&deptID=' + deptID + '&objectType=' + objectType + '&module=' + module);
if(module == 'program') link = createLink(module, moduleMethod, 'objectID=' + objectID + '&deptID=' + deptID + '&programID=' + programID + '&from=' + from);
var copyID = $('#object').val();
var deptID = $('#dept').val();
var link = createLink(module, moduleMethod, 'objectID=' + objectID + '&deptID=' + deptID + '&copyID=' + copyID + '&objectType=' + objectType + '&module=' + module);
if(module == 'program') link = createLink(module, moduleMethod, 'objectID=' + objectID + '&deptID=' + deptID + '&copyID=' + copyID + '&programID=' + programID + '&from=' + from);
location.href = link;
}
+6 -4
View File
@@ -30,9 +30,11 @@ $lang->personnel->resolved = 'Resolved';
$lang->personnel->UR = $lang->URCommon;
$lang->personnel->SR = $lang->SRCommon;
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->unbindWhitelist = 'Remove Whitelist';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->copy = 'Copy Whitelist';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->selectObjectTips = 'Select %s to copy its whitelist';
+6 -4
View File
@@ -30,9 +30,11 @@ $lang->personnel->resolved = 'Resolved';
$lang->personnel->UR = $lang->URCommon;
$lang->personnel->SR = $lang->SRCommon;
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->unbindWhitelist = 'Remove Whitelist';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->copy = 'Copy Whitelist';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->selectObjectTips = 'Select %s to copy its whitelist';
+6 -4
View File
@@ -30,9 +30,11 @@ $lang->personnel->resolved = 'Resolved';
$lang->personnel->UR = $lang->URCommon;
$lang->personnel->SR = $lang->SRCommon;
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->unbindWhitelist = 'Remove Whitelist';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->copy = 'Copy Whitelist';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->selectObjectTips = 'Select %s to copy its whitelist';
+6 -4
View File
@@ -30,9 +30,11 @@ $lang->personnel->resolved = 'Resolved';
$lang->personnel->UR = $lang->URCommon;
$lang->personnel->SR = $lang->SRCommon;
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->whitelist = 'Whitelist';
$lang->personnel->addWhitelist = 'Add Whitelist';
$lang->personnel->unbindWhitelist = 'Remove Whitelist';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->confirmDelete = 'Confirm removal of the user from the whitelist?';
$lang->personnel->copy = 'Copy Whitelist';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->openedPGMTip = 'The program is public and can be accessed by users with Program privileges.';
$lang->personnel->selectObjectTips = 'Select %s to copy its whitelist';
+6 -4
View File
@@ -30,9 +30,11 @@ $lang->personnel->resolved = '解决';
$lang->personnel->UR = $lang->URCommon;
$lang->personnel->SR = $lang->SRCommon;
$lang->personnel->whitelist = '白名单列表';
$lang->personnel->addWhitelist = '添加白名单';
$lang->personnel->whitelist = '白名单列表';
$lang->personnel->addWhitelist = '添加白名单';
$lang->personnel->unbindWhitelist = '删除白名单';
$lang->personnel->confirmDelete = '确认将该用户移除白名单?';
$lang->personnel->confirmDelete = '确认将该用户移除白名单?';
$lang->personnel->copy = '复制白名单';
$lang->personnel->openedPGMTip = '该项目集是公开状态,有项目集视图权限的人员即可访问。';
$lang->personnel->openedPGMTip = '该项目集是公开状态,有项目集视图权限的人员即可访问。';
$lang->personnel->selectObjectTips = '请选择一个%s白名单来复制';
+52
View File
@@ -456,6 +456,58 @@ class personnelModel extends model
->fetchGroup('root', 'id');
}
/**
* Get objects to copy whitelist.
*
* @param int $objectID
* @param int $objectType
* @access public
* @return array
*/
public function getCopyObjects($objectID, $objectType)
{
$objects = array();
if($objectType == 'sprint')
{
$parentID = 0;
if($this->config->systemMode == 'new') $parentID = $this->dao->select('project')->from(TABLE_EXECUTION)->where('id')->eq($objectID)->fetch('project');
$objects = $this->dao->select('id,name')->from(TABLE_EXECUTION)
->where('(project')->eq($parentID)
->orWhere('id')->eq($parentID)
->markRight(1)
->andWhere('(id')->in($this->app->user->view->projects)
->orWhere('id')->in($this->app->user->view->sprints)
->markRight(1)
->andWhere('deleted')->eq(0)
->orderBy('type')
->fetchPairs();
foreach($objects as $id => &$object)
{
if($id == $parentID) $object = $this->lang->projectCommon . '-' . $object;
if($id != $parentID) $object = $this->lang->execution->common . '-' . $object;
}
}
elseif($objectType == 'project')
{
$parentID = $this->dao->select('parent')->from(TABLE_PROJECT)->where('id')->eq($objectID)->fetch('parent');
$objects = $this->loadModel('project')->getPairsByProgram($parentID);
}
elseif($objectType == 'product')
{
$parentID = $this->dao->select('program')->from(TABLE_PRODUCT)->where('id')->eq($objectID)->fetch('program');
$objects = $this->loadModel('product')->getPairs('', $parentID);
}
elseif($objectType == 'program')
{
$objects = $this->loadModel('program')->getPairs();
}
unset($objects[$objectID]);
return $objects;
}
/**
* Access to program set invest staff.
*
+10 -5
View File
@@ -13,18 +13,23 @@
<?php include '../../common/view/header.html.php';?>
<?php js::set('objectID', $objectID);?>
<?php js::set('objectType', $objectType);?>
<style>.w-350px {width: 350px;}</style>
<div id='mainMenu' class='clearfix'>
<div class='btn-toolbar pull-left'>
<span class='btn btn-link btn-active-text'>
<?php echo html::a("javascript:viod(0)", "<span class='text'> {$lang->personnel->addWhitelist}</span>");?>
</span>
<div class='input-group space w-200px'>
<span class='input-group-addon'><?php echo $lang->execution->selectDept?></span>
<?php echo html::select('dept', $depts, $deptID, "class='form-control chosen' onchange='setDeptUsers(this)' data-placeholder='{$lang->execution->selectDeptTitle}'");?>
<?php echo html::select('dept', $depts, $deptID, "class='form-control chosen' onchange='setObjectUsers()' data-placeholder='{$lang->execution->selectDeptTitle}'");?>
</div>
<div class='input-group space w-350px'>
<span class='input-group-addon'><?php echo $lang->personnel->copy?></span>
<?php echo html::select('object', $objects, $copyID, "class='form-control chosen' onchange='setObjectUsers()' data-placeholder='{$lang->personnel->selectObjectTips}'");?>
</div>
</div>
</div>
<div id='mainContent' class='main-content'>
<div class="main-header">
<h2><?php echo $lang->personnel->addWhitelist;?></h2>
</div>
<form class='main-form form-ajax' method='post' target='hiddenwin' id="whitelistForm">
<table class='table table-form'>
<thead>
@@ -53,7 +58,7 @@
?>
<?php endforeach;?>
<?php foreach($deptUsers as $account => $realname):?>
<?php foreach($appendUsers as $account => $realname):?>
<?php if(isset($whitelistUsers[$account])) continue;?>
<tr id="whitelist<?php echo $i;?>" data-id="<?php echo $i;?>">
<td>
+1 -1
View File
@@ -19,7 +19,7 @@
<?php echo html::a($this->createLink($module, 'whitelist', $vars), '<span class="text">' . $lang->personnel->whitelist . '</span>', '', "class='btn btn-link btn-active-text' $openApp");?>
</div>
<div class="btn-toolbar pull-right">
<?php $vars = $module == 'program' ? "objectID=$objectID&deptID=0&programID=$programID&from=$from" : "objectID=$objectID";?>
<?php $vars = $module == 'program' ? "objectID=$objectID&deptID=0&copyID=0&programID=$programID&from=$from" : "objectID=$objectID";?>
<?php common::printLink($module, 'addWhitelist', $vars, "<i class='icon icon-plus'></i> " . $lang->personnel->addWhitelist, '', "class='btn btn-primary' $openApp");?>
</div>
</div>
+4 -3
View File
@@ -1186,16 +1186,17 @@ class product extends control
*
* @param int $productID
* @param int $deptID
* @param int $copyID
* @param string $branch
* @access public
* @return void
*/
public function addWhitelist($productID = 0, $deptID = 0, $branch = '')
public function addWhitelist($productID = 0, $deptID = 0, $copyID = 0)
{
$this->product->setMenu($productID, $branch);
$this->product->setMenu($productID);
$this->lang->modulePageNav = '';
echo $this->fetch('personnel', 'addWhitelist', "objectID=$productID&dept=$deptID&objectType=product&module=product");
echo $this->fetch('personnel', 'addWhitelist', "objectID=$productID&dept=$deptID&copyID=$copyID&objectType=product&module=product");
}
/*
+3 -2
View File
@@ -1504,14 +1504,15 @@ class project extends control
*
* @param int $projectID
* @param int $deptID
* @param int $copyID
* @param int $programID
* @param int $from
* @access public
* @return void
*/
public function addWhitelist($projectID = 0, $deptID = 0, $programID = 0, $from = 'project')
public function addWhitelist($projectID = 0, $deptID = 0, $copyID = 0, $programID = 0, $from = 'project')
{
echo $this->fetch('personnel', 'addWhitelist', "objectID=$projectID&dept=$deptID&objectType=project&module=project&programID=$programID&from=$from");
echo $this->fetch('personnel', 'addWhitelist', "objectID=$projectID&dept=$deptID&copyID=$copyID&objectType=project&module=project&programID=$programID&from=$from");
}
/*
+2 -2
View File
File diff suppressed because one or more lines are too long