Merge branch 'code_review/001_mayue' into 'master'
* Optimize code. See merge request easycorp/zentaopms!1301
This commit is contained in:
@@ -805,8 +805,10 @@ class doc extends control
|
||||
|
||||
return print(html::select('users[]', $users, $whitelist, "class='form-control chosen' multiple"));
|
||||
}
|
||||
|
||||
return print(html::select('users[]', $users, $doclib->users, "class='form-control chosen' multiple"));
|
||||
else
|
||||
{
|
||||
return print(html::select('users[]', $users, $doclib->users, "class='form-control chosen' multiple"));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*/
|
||||
function loadModules(libID)
|
||||
{
|
||||
link = createLink('doc', 'ajaxGetModules', 'libID=' + libID);
|
||||
var link = createLink('doc', 'ajaxGetModules', 'libID=' + libID);
|
||||
$('#moduleBox').load(link, function(){$('#moduleBox').find('select').chosen()});
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ function toggleAcl(acl, type)
|
||||
|
||||
if(libType == 'project' && typeof(doclibID) != 'undefined')
|
||||
{
|
||||
link = createLink('doc', 'ajaxGetWhitelist', 'doclibID=' + doclibID + '&acl=' + acl);
|
||||
var link = createLink('doc', 'ajaxGetWhitelist', 'doclibID=' + doclibID + '&acl=' + acl);
|
||||
$.get(link, function(users)
|
||||
{
|
||||
$('#users').replaceWith(users);
|
||||
@@ -71,7 +71,7 @@ function toggleAcl(acl, type)
|
||||
*/
|
||||
function loadDocModule(libID)
|
||||
{
|
||||
link = createLink('doc', 'ajaxGetChild', 'libID=' + libID);
|
||||
var link = createLink('doc', 'ajaxGetChild', 'libID=' + libID);
|
||||
$.post(link, function(data)
|
||||
{
|
||||
$('#module').replaceWith(data);
|
||||
|
||||
@@ -1333,7 +1333,7 @@ class docModel extends model
|
||||
/* Sort project. */
|
||||
$orderedProjects = array();
|
||||
|
||||
/* Project permissions for DocLib whitelist */
|
||||
/* Project permissions for DocLib whitelist. */
|
||||
if($this->app->tab == 'doc')
|
||||
{
|
||||
$myObjects = $this->dao->select('t2.id, t2.name')->from(TABLE_DOCLIB)->alias('t1')
|
||||
|
||||
@@ -650,9 +650,9 @@ class program extends control
|
||||
/**
|
||||
* Ajax get program drop menu.
|
||||
*
|
||||
* @param int $programID
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @param int $programID
|
||||
* @param string $module
|
||||
* @param string $method
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
@@ -132,12 +132,12 @@ $config->project->maxCheckList = new stdclass();
|
||||
$config->project->maxCheckList->scrum = array('bug', 'execution', 'build', 'doc', 'release', 'testtask', 'case', 'issue', 'risk', 'meeting');
|
||||
$config->project->maxCheckList->waterfall = array('execution', 'design', 'doc', 'bug', 'case', 'build', 'release', 'testtask', 'review', 'build', 'researchplan', 'issue', 'risk', 'opportunity', 'auditplan', 'gapanalysis', 'meeting');
|
||||
|
||||
$config->project->removePriv['project'] = array('index', 'browse', 'kanban', 'create', 'batchEdit', 'qa', 'updateOrder', 'createGuide', 'programTitle', 'export');
|
||||
$config->project->removePriv['bug'] = array('browse', 'batchChangePlan', 'batchCreate', 'batchEdit', 'batchConfirm', 'batchResolve', 'batchClose', 'batchActivate', 'report', 'batchChangeModule', 'batchChangeBranch');
|
||||
$config->project->removePriv['testcase'] = array('browse', 'batchChangeModule', 'batchChangeBranch');
|
||||
$config->project->removePriv['testtask'] = array('browse', 'view', 'start', 'activate', 'block', 'close');
|
||||
$config->project->removePriv['doc'] = array('catalog', 'index');
|
||||
$config->project->removePriv['repo'] = array('edit', 'delete', 'maintain', 'setRules');
|
||||
$config->project->removePriv['testreport'] = array('browse');
|
||||
$config->project->removePriv['auditplan'] = array('delete');
|
||||
if(!isset($config->maxVersion)) $config->project->removePriv['stakeholder'] = array('issue', 'viewIssue', 'userIssue');
|
||||
$config->project->excludedPriv['project'] = array('index', 'browse', 'kanban', 'create', 'batchEdit', 'qa', 'updateOrder', 'createGuide', 'programTitle', 'export');
|
||||
$config->project->excludedPriv['bug'] = array('browse', 'batchChangePlan', 'batchCreate', 'batchEdit', 'batchConfirm', 'batchResolve', 'batchClose', 'batchActivate', 'report', 'batchChangeModule', 'batchChangeBranch');
|
||||
$config->project->excludedPriv['testcase'] = array('browse', 'batchChangeModule', 'batchChangeBranch');
|
||||
$config->project->excludedPriv['testtask'] = array('browse', 'view', 'start', 'activate', 'block', 'close');
|
||||
$config->project->excludedPriv['doc'] = array('catalog', 'index');
|
||||
$config->project->excludedPriv['repo'] = array('edit', 'delete', 'maintain', 'setRules');
|
||||
$config->project->excludedPriv['testreport'] = array('browse');
|
||||
$config->project->excludedPriv['auditplan'] = array('delete');
|
||||
if(!isset($config->maxVersion)) $config->project->excludedPriv['stakeholder'] = array('issue', 'viewIssue', 'userIssue');
|
||||
|
||||
@@ -1217,11 +1217,11 @@ class project extends control
|
||||
}
|
||||
else
|
||||
{
|
||||
if($project->model == 'scrum' and $module == 'projectstory') $this->config->project->removePriv[$module][] = 'track';
|
||||
if($project->model == 'scrum' and $module == 'projectstory') $this->config->project->excludedPriv[$module][] = 'track';
|
||||
|
||||
foreach($methods as $method => $label)
|
||||
{
|
||||
if(isset($this->config->project->removePriv[$module]) and in_array($method, $this->config->project->removePriv[$module])) unset($this->lang->resource->$module->$method);
|
||||
if(isset($this->config->project->excludedPriv[$module]) and in_array($method, $this->config->project->excludedPriv[$module])) unset($this->lang->resource->$module->$method);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1317,11 +1317,11 @@ class project extends control
|
||||
return $this->send(array('message' => $this->lang->saveSuccess, 'result' => 'success', 'locate' => $link));
|
||||
}
|
||||
|
||||
$project = $this->project->getById($projectID);
|
||||
$users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback');
|
||||
$roles = $this->user->getUserRoles(array_keys($users));
|
||||
$deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept);
|
||||
$userInfos = $this->user->getUserDisplayInfos(array_keys($users), $dept);
|
||||
$project = $this->project->getById($projectID);
|
||||
$users = $this->user->getPairs('noclosed|nodeleted|devfirst|nofeedback');
|
||||
$roles = $this->user->getUserRoles(array_keys($users));
|
||||
$deptUsers = $dept === '' ? array() : $this->dept->getDeptUserPairs($dept);
|
||||
$userInfoList = $this->user->getUserDisplayInfos(array_keys($users), $dept);
|
||||
|
||||
$currentMembers = $this->project->getTeamMembers($projectID);
|
||||
$members2Import = $this->project->getMembers2Import($copyProjectID, array_keys($currentMembers));
|
||||
@@ -1332,7 +1332,7 @@ class project extends control
|
||||
$this->view->project = $project;
|
||||
$this->view->users = $users;
|
||||
$this->view->deptUsers = $deptUsers;
|
||||
$this->view->userInfos = $userInfos;
|
||||
$this->view->userInfoList = $userInfoList;
|
||||
$this->view->roles = $roles;
|
||||
$this->view->dept = $dept;
|
||||
$this->view->depts = array('' => '') + $this->dept->getOptionMenu();
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<?php js::set('projectID', $project->id);?>
|
||||
<?php js::set('roles', $roles);?>
|
||||
<?php js::set('deptID', $dept);?>
|
||||
<?php js::set('pickerUsers', $userInfos);?>
|
||||
<?php js::set('pickerUsers', $userInfoList);?>
|
||||
<?php js::set('copyProjectID', $copyProjectID);?>
|
||||
<?php js::set('oldAccountList', array_keys($currentMembers));?>
|
||||
<?php js::set('unlinkExecutionMembers', $lang->project->unlinkExecutionMembers);?>
|
||||
|
||||
Reference in New Issue
Block a user