* Optimize code.
This commit is contained in:
@@ -2621,7 +2621,6 @@ EOD;
|
||||
if($program->auth == 'extend') $this->app->user->rights['rights'] = array_merge_recursive($programRightGroup, $rights);
|
||||
if($program->auth == 'reset')
|
||||
{
|
||||
if(!$program->multiple) $this->config->project->includedPriv = $this->config->project->noSprintPriv;
|
||||
/* If priv way is reset, unset common program priv, and cover by program priv. */
|
||||
$projectPrivs = $this->loadModel('project')->processProjectPrivs($program->multiple ? $program->model : 'noSprint');
|
||||
foreach($projectPrivs as $module => $methods)
|
||||
|
||||
@@ -1560,7 +1560,6 @@ class project extends control
|
||||
}
|
||||
if($project->model == 'scrum') unset($this->lang->resource->projectstory->track);
|
||||
|
||||
if(!$project->multiple) $this->config->project->includedPriv = $this->config->project->noSprintPriv;
|
||||
if(!$project->multiple and !$project->hasProduct)
|
||||
{
|
||||
unset($this->lang->resource->story->batchChangePlan);
|
||||
|
||||
@@ -937,12 +937,14 @@ class projectModel extends model
|
||||
/**
|
||||
* Process the project privs according to the project model.
|
||||
*
|
||||
* @param string $model sprint | waterfall
|
||||
* @param string $model sprint | waterfall | noSprint
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function processProjectPrivs($model = 'waterfall')
|
||||
{
|
||||
if($model == 'noSprint') $this->config->project->includedPriv = $this->config->project->noSprintPriv;
|
||||
|
||||
$this->app->loadLang('group');
|
||||
|
||||
$privs = new stdclass();
|
||||
|
||||
Reference in New Issue
Block a user