* Adjustment Code.
This commit is contained in:
@@ -48,7 +48,7 @@ class companyModel extends model
|
||||
{
|
||||
return $this->dao->select('*')->from(TABLE_COMPANY)->orderBy('id')->limit(1)->fetch();
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get company info by id.
|
||||
*
|
||||
@@ -127,7 +127,6 @@ class companyModel extends model
|
||||
return $pairs;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update a company.
|
||||
*
|
||||
|
||||
@@ -34,7 +34,7 @@ class deptModel extends model
|
||||
*/
|
||||
public function getDeptPairs($deptID = 0)
|
||||
{
|
||||
return $this->dao->select('id,name')->from(TABLE_DEPT)->fetchPairs('id', 'name');
|
||||
return $this->dao->select('id,name')->from(TABLE_DEPT)->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -204,6 +204,42 @@ class groupModel extends model
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the ID of the group that has access to the program.
|
||||
*
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getAccessProgramGroup()
|
||||
{
|
||||
$accessibleGroup = $this->getList();
|
||||
$accessibleGroupID = array(0);
|
||||
foreach($accessibleGroup as $group)
|
||||
{
|
||||
if($group->acl) $group->acl = json_decode($group->acl, true);
|
||||
if(!isset($group->acl) || !is_array($group->acl)) $group->acl = array();
|
||||
|
||||
if(empty($group->acl))
|
||||
{
|
||||
$accessibleGroupID[] = $group->id;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!isset($group->acl['views']) || empty($group->acl['views']))
|
||||
{
|
||||
$accessibleGroupID[] = $group->id;
|
||||
continue;
|
||||
}
|
||||
|
||||
if(in_array('program', $group->acl['views']))
|
||||
{
|
||||
$accessibleGroupID[] = $group->id;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
return $accessibleGroupID;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete a group.
|
||||
*
|
||||
|
||||
@@ -3,12 +3,10 @@ global $lang;
|
||||
$config->personnel->accessible = new stdClass();
|
||||
$config->personnel->accessible->search['module'] = 'accessible';
|
||||
$config->personnel->accessible->search['fields']['realname'] = $lang->personnel->realName;
|
||||
$config->personnel->accessible->search['fields']['dept'] = $lang->personnel->department;
|
||||
$config->personnel->accessible->search['fields']['role'] = $lang->personnel->job;
|
||||
$config->personnel->accessible->search['fields']['account'] = $lang->personnel->userName;
|
||||
$config->personnel->accessible->search['fields']['gender'] = $lang->personnel->genders;
|
||||
|
||||
$config->personnel->accessible->search['params']['dept'] = array('operator' => '=', 'control' => 'select', 'values' => '');
|
||||
$config->personnel->accessible->search['params']['realname'] = array('operator' => '=', 'control' => 'input', 'values' => '');
|
||||
$config->personnel->accessible->search['params']['account'] = array('operator' => '=', 'control' => 'input', 'values' => '');
|
||||
$config->personnel->accessible->search['params']['role'] = array('operator' => '=', 'control' => 'select', 'values' => '');
|
||||
|
||||
@@ -18,14 +18,13 @@ class personnel extends control
|
||||
* @param int $deptID
|
||||
* @param string $browseType
|
||||
* @param int $param
|
||||
* @param string $orderBy
|
||||
* @param int $recTotal
|
||||
* @param int $recPerPage
|
||||
* @param int $pageID
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function accessible($programID = 0, $deptID = 0, $browseType='browse', $param = 0, $orderBy = 't2.id_desc', $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
public function accessible($programID = 0, $deptID = 0, $browseType='browse', $param = 0, $recTotal = 0, $recPerPage = 15, $pageID = 1)
|
||||
{
|
||||
$this->loadModel('program');
|
||||
$this->app->loadLang('user');
|
||||
@@ -40,14 +39,10 @@ class personnel extends control
|
||||
/* Build the search form. */
|
||||
$queryID = $browseType == 'bysearch' ? (int)$param : 0;
|
||||
$actionURL = $this->createLink('personnel', 'accessible', "pargramID=$programID&deptID=$deptID&browseType=bysearch&quertID=myQueryID");
|
||||
$deptList = $this->loadModel('dept')->getDeptPairs($deptID);
|
||||
$this->config->personnel->accessible->search['params']['dept']['values'] = $deptList;
|
||||
$this->config->personnel->accessible->search['params']['role']['values'] = $this->lang->user->roleList;
|
||||
$this->config->personnel->accessible->search['params']['gender']['values'] = $this->lang->user->genderList;
|
||||
$this->personnel->buildSearchForm($queryID, $actionURL);
|
||||
|
||||
$personnelList = $this->personnel->getAccessiblePersonnel($programID, $deptID, $browseType, $orderBy, $queryID, $pager);
|
||||
|
||||
$this->view->title = $this->lang->personnel->accessible;
|
||||
$this->view->position[] = $this->lang->personnel->accessible;
|
||||
|
||||
@@ -58,12 +53,11 @@ class personnel extends control
|
||||
$this->view->pageID = $pageID;
|
||||
$this->view->pager = $pager;
|
||||
$this->view->param = $param;
|
||||
$this->view->orderBy = $orderBy;
|
||||
$this->view->browseType = $browseType;
|
||||
$this->view->personnelList = $personnelList;
|
||||
$this->view->deptList = $deptList;
|
||||
$this->view->personnelList = $this->personnel->getAccessiblePersonnel($programID, $deptID, $browseType, $queryID, $pager);
|
||||
$this->view->deptList = $this->loadModel('dept')->getOptionMenu();
|
||||
$this->view->dept = $this->dept->getByID($deptID);
|
||||
$this->view->deptTree = $this->personnel->getTreeMenu($deptID = 0, array('personnelModel', 'createMemberLink'), $programID);
|
||||
$this->view->deptTree = $this->dept->getTreeMenu($deptID = 0, array(new personnelModel, 'createMemberLink'), $programID);
|
||||
|
||||
$this->display();
|
||||
}
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
<?php
|
||||
$lang->personnel->accessible = 'List of accessible';
|
||||
$lang->personnel->putInto = 'Input personnel list';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Job';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'Name';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data.';
|
||||
|
||||
$lang->personnel->inputLabel['all'] = 'All';
|
||||
$lang->personnel->inputLabel['noempty'] = 'No empty';
|
||||
$lang->personnel->inputLabel['parent'] = 'Direct project';
|
||||
$lang->personnel->inputLabel['scrum'] = 'Scrum project';
|
||||
$lang->personnel->inputLabel['waterfall'] = 'Waterfall project';
|
||||
$lang->personnel->common = 'Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
<?php
|
||||
$lang->personnel->accessible = 'List of accessible';
|
||||
$lang->personnel->putInto = 'Input personnel list';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Job';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'Name';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data.';
|
||||
|
||||
$lang->personnel->inputLabel['all'] = 'All';
|
||||
$lang->personnel->inputLabel['noempty'] = 'No empty';
|
||||
$lang->personnel->inputLabel['parent'] = 'Direct project';
|
||||
$lang->personnel->inputLabel['scrum'] = 'Scrum project';
|
||||
$lang->personnel->inputLabel['waterfall'] = 'Waterfall project';
|
||||
$lang->personnel->common = 'Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
<?php
|
||||
$lang->personnel->accessible = 'List of accessible';
|
||||
$lang->personnel->putInto = 'Input personnel list';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Job';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'Name';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data.';
|
||||
|
||||
$lang->personnel->inputLabel['all'] = 'All';
|
||||
$lang->personnel->inputLabel['noempty'] = 'No empty';
|
||||
$lang->personnel->inputLabel['parent'] = 'Direct project';
|
||||
$lang->personnel->inputLabel['scrum'] = 'Scrum project';
|
||||
$lang->personnel->inputLabel['waterfall'] = 'Waterfall project';
|
||||
$lang->personnel->common = 'Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
|
||||
@@ -1,21 +1,17 @@
|
||||
<?php
|
||||
$lang->personnel->accessible = 'List of accessible';
|
||||
$lang->personnel->putInto = 'Input personnel list';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Job';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'Name';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data.';
|
||||
|
||||
$lang->personnel->inputLabel['all'] = 'All';
|
||||
$lang->personnel->inputLabel['noempty'] = 'No empty';
|
||||
$lang->personnel->inputLabel['parent'] = 'Direct project';
|
||||
$lang->personnel->inputLabel['scrum'] = 'Scrum project';
|
||||
$lang->personnel->inputLabel['waterfall'] = 'Waterfall project';
|
||||
$lang->personnel->common = 'Personnel';
|
||||
$lang->personnel->accessible = 'Acess List';
|
||||
$lang->personnel->putInto = 'Input Resource';
|
||||
$lang->personnel->department = 'Department';
|
||||
$lang->personnel->realName = 'Name';
|
||||
$lang->personnel->userName = 'Account';
|
||||
$lang->personnel->job = 'Position';
|
||||
$lang->personnel->genders = 'Gender';
|
||||
$lang->personnel->project = 'Project';
|
||||
$lang->personnel->sprint = 'Sprint/Stage';
|
||||
$lang->personnel->user = 'User';
|
||||
$lang->personnel->role = 'Role';
|
||||
$lang->personnel->search = 'Search';
|
||||
$lang->personnel->program = 'Program';
|
||||
$lang->personnel->emptyTip = 'No data';
|
||||
$lang->personnel->childrenStage = 'Child stage';
|
||||
|
||||
@@ -15,10 +15,3 @@ $lang->personnel->search = '搜索';
|
||||
$lang->personnel->program = '项目集';
|
||||
$lang->personnel->emptyTip = '暂无';
|
||||
$lang->personnel->childrenStage = '子阶段';
|
||||
|
||||
$lang->personnel->inputLabel['all'] = '全部';
|
||||
$lang->personnel->inputLabel['noempty'] = '非空项目';
|
||||
$lang->personnel->inputLabel['parent'] = '直属项目';
|
||||
$lang->personnel->inputLabel['scrum'] = 'Scrum项目';
|
||||
$lang->personnel->inputLabel['waterfall'] = '瀑布项目';
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
$lang->personnel->common = '人員';
|
||||
$lang->personnel->accessible = '可訪問人員列表';
|
||||
$lang->personnel->putInto = '投入人員列表';
|
||||
$lang->personnel->department = '部門';
|
||||
@@ -14,10 +15,3 @@ $lang->personnel->search = '搜索';
|
||||
$lang->personnel->program = '項目集';
|
||||
$lang->personnel->emptyTip = '暫無';
|
||||
$lang->personnel->childrenStage = '子階段';
|
||||
|
||||
$lang->personnel->inputLabel['all'] = '全部';
|
||||
$lang->personnel->inputLabel['noempty'] = '非空項目';
|
||||
$lang->personnel->inputLabel['parent'] = '直屬項目';
|
||||
$lang->personnel->inputLabel['scrum'] = 'Scrum項目';
|
||||
$lang->personnel->inputLabel['waterfall'] = '瀑布項目';
|
||||
|
||||
|
||||
+29
-81
@@ -23,7 +23,7 @@ class personnelModel extends model
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getAccessiblePersonnel($programID = 0, $deptID = 0, $browseType = 'all', $orderBy = 't2.id_desc', $queryID = 0, $pager)
|
||||
public function getAccessiblePersonnel($programID = 0, $deptID = 0, $browseType = 'all', $queryID = 0, $pager)
|
||||
{
|
||||
$accessibleQuery = '';
|
||||
if($browseType == 'bysearch')
|
||||
@@ -38,14 +38,33 @@ class personnelModel extends model
|
||||
$accessibleQuery = $this->session->accessibleQuery;
|
||||
}
|
||||
|
||||
$personnelList = $this->dao->select('t2.id,t2.dept,t2.account,t2.role,t2.realname,t2.gender')->from(TABLE_USERVIEW)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account')
|
||||
->where('t1.programs')->like(',%' . $programID . ',%')
|
||||
->beginIF($deptID > 0)->andWhere('t2.dept')->eq($deptID)->fi()
|
||||
->beginIF($browseType == 'bysearch')->andWhere($accessibleQuery)->fi()
|
||||
->orderBy($orderBy)
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
/* Determine who can be accessed based on access control. */
|
||||
$program = $this->loadModel('program')->getPGMByID($programID);
|
||||
if($program->acl == 'private')
|
||||
{
|
||||
$personnelList = $this->dao->select('t2.id,t2.dept,t2.account,t2.role,t2.realname,t2.gender')->from(TABLE_USERVIEW)->alias('t1')
|
||||
->leftJoin(TABLE_USER)->alias('t2')->on('t1.account=t2.account')
|
||||
->where("CONCAT(',', t1.programs, ',')")->like("%,$programID,%")
|
||||
->beginIF($deptID > 0)->andWhere('t2.dept')->eq($deptID)->fi()
|
||||
->beginIF($browseType == 'bysearch')->andWhere($accessibleQuery)->fi()
|
||||
->page($pager)
|
||||
->fetchAll();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* The program is public, and users are judged to be accessible by permission groups. */
|
||||
$accessibleGroupID = $this->loadModel('group')->getAccessProgramGroup();
|
||||
$personnelList = $this->dao->select('t1.account,t3.role,t3.dept,t3.realname,t3.gender,t3.id')->from(TABLE_USERGROUP)->alias('t1')
|
||||
->leftJoin(TABLE_GROUPPRIV)->alias('t2')->on('t1.group = t2.group')
|
||||
->leftJoin(TABLE_USER)->alias('t3')->on('t1.account = t3.account')
|
||||
->where('t1.group')->in($accessibleGroupID)
|
||||
->andWhere('t2.module')->eq('program')
|
||||
->andWhere('t2.method')->eq('PGMBrowse')
|
||||
->beginIF($deptID > 0)->andWhere('t3.dept')->eq($deptID)->fi()
|
||||
->beginIF($browseType == 'bysearch')->andWhere($accessibleQuery)->fi()
|
||||
->page($pager)
|
||||
->fetchAll('account');
|
||||
}
|
||||
|
||||
return $personnelList;
|
||||
}
|
||||
@@ -67,10 +86,6 @@ class personnelModel extends model
|
||||
$projects = $this->dao->select('id,model,type,parent,path,name')->from(TABLE_PROJECT)
|
||||
->where('type')->eq('project')
|
||||
->andWhere('path')->like("%,$programID,%")
|
||||
->beginIF($browseType == 'scrum')->andWhere('model')->eq('scrum')->fi()
|
||||
->beginIF($browseType == 'waterfall')->andWhere('model')->eq('waterfall')->fi()
|
||||
->beginIF($browseType == 'parent')->andWhere('parent')->eq($programID)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->projects)->fi()
|
||||
->andWhere('deleted')->eq('0')
|
||||
->orderBy($orderBy)
|
||||
->fetchAll('id');
|
||||
@@ -85,7 +100,7 @@ class personnelModel extends model
|
||||
$personnelList['objectRows'] = $sprintAndStage['objectRows'];
|
||||
|
||||
/* Get the program name for each level. */
|
||||
$programNameList = $this->loadModel('program')->getPGMPairs();
|
||||
$programNameList = $this->dao->select('id, name')->from(TABLE_PROGRAM)->where('type')->eq('program')->andWhere('deleted')->eq(0)->fetchPairs();
|
||||
foreach($personnelList['projects'] as $id => $project)
|
||||
{
|
||||
$path = explode(',', $project->path);
|
||||
@@ -113,11 +128,9 @@ class personnelModel extends model
|
||||
public function getSprintAndStage($projects)
|
||||
{
|
||||
/* Get all sprints and iterations under the project. */
|
||||
$userViewID = array_merge(array(0), explode(',', $this->app->user->view->stages), explode(',', $this->app->user->view->sprints));
|
||||
$projectKeys = array_keys($projects);
|
||||
$projectObjet = $this->dao->select('id,project,model,type,parent,path,grade,name')->from(TABLE_PROJECT)
|
||||
->where('project')->in($projectKeys)
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($userViewID)->fi()
|
||||
->andWhere('deleted')->eq('0')
|
||||
->orderBy('id_desc')
|
||||
->fetchAll();
|
||||
@@ -180,71 +193,6 @@ class personnelModel extends model
|
||||
return array('sprintAndStage' => $sprintAndStage, 'childrenStage' => $childrenStage, 'teams' => $teams, 'objectRows' => $objectRows);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the treemenu of departments.
|
||||
*
|
||||
* @param int $deptID
|
||||
* @param string $userFunc
|
||||
* @param int $param
|
||||
* @access public
|
||||
* @return string
|
||||
*/
|
||||
public function getTreeMenu($deptID = 0, $userFunc, $param = 0)
|
||||
{
|
||||
$deptMenu = array();
|
||||
$stmt = $this->dbh->query($this->buildMenuQuery($deptID));
|
||||
while($dept = $stmt->fetch())
|
||||
{
|
||||
$linkHtml = call_user_func($userFunc, $dept, $param);
|
||||
|
||||
if(isset($deptMenu[$dept->id]) and !empty($deptMenu[$dept->id]))
|
||||
{
|
||||
if(!isset($deptMenu[$dept->parent])) $deptMenu[$dept->parent] = '';
|
||||
$deptMenu[$dept->parent] .= "<li>$linkHtml";
|
||||
$deptMenu[$dept->parent] .= "<ul>".$deptMenu[$dept->id]."</ul>\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
if(isset($deptMenu[$dept->parent]) and !empty($deptMenu[$dept->parent]))
|
||||
{
|
||||
$deptMenu[$dept->parent] .= "<li>$linkHtml\n";
|
||||
}
|
||||
else
|
||||
{
|
||||
$deptMenu[$dept->parent] = "<li>$linkHtml\n";
|
||||
}
|
||||
}
|
||||
$deptMenu[$dept->parent] .= "</li>\n";
|
||||
}
|
||||
|
||||
krsort($deptMenu);
|
||||
$deptMenu = array_pop($deptMenu);
|
||||
$lastMenu = "<ul class='tree' data-ride='tree' data-name='tree-dept'>{$deptMenu}</ul>\n";
|
||||
return $lastMenu;
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the query.
|
||||
*
|
||||
* @param int $rootDeptID
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function buildMenuQuery($rootDeptID)
|
||||
{
|
||||
$rootDept = $this->loadModel('dept')->getByID($rootDeptID);
|
||||
if(!$rootDept)
|
||||
{
|
||||
$rootDept = new stdclass();
|
||||
$rootDept->path = '';
|
||||
}
|
||||
|
||||
return $this->dao->select('*')->from(TABLE_DEPT)
|
||||
->beginIF($rootDeptID > 0)->where('path')->like($rootDept->path . '%')->fi()
|
||||
->orderBy('grade desc, `order`')
|
||||
->get();
|
||||
}
|
||||
|
||||
/**
|
||||
* Create access links by department.
|
||||
*
|
||||
|
||||
@@ -34,14 +34,13 @@ js::set('deptID', $deptID);
|
||||
<?php if(!empty($personnelList)):?>
|
||||
<div id="queryBox" class="cell" data-module="accessible"></div>
|
||||
<form class="main-table table-personnel" action="" data-ride="table">
|
||||
<?php $vars = "programID=$programID&deptID=$deptID&browseType=$browseType¶m=$param&orderBy=%s&recTotal={$pager->recTotal}&recPerPage={$pager->recPerPage}";?>
|
||||
<table id="accessibleList" class="table has-sort-head">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="c-id"><?php common::printOrderLink('t2.id', $orderBy, $vars, $lang->idAB);?></th>
|
||||
<th class="w-120px"><?php echo common::printOrderLink('t2.dept', $orderBy, $vars, $lang->personnel->department);?></th>
|
||||
<th class="w-100px"><?php echo $lang->personnel->realName;?></th>
|
||||
<th class="w-100px"><?php echo $lang->personnel->userName;?></th>
|
||||
<th class="c-id w-40px"><?php echo $lang->idAB;?></th>
|
||||
<th class="w-120px"><?php echo $lang->personnel->department;?></th>
|
||||
<th class="w-80px"><?php echo $lang->personnel->realName;?></th>
|
||||
<th class="w-80px"><?php echo $lang->personnel->userName;?></th>
|
||||
<th class="w-80px"><?php echo $lang->personnel->job;?></th>
|
||||
<th class="w-60px"><?php echo $lang->personnel->genders;?></th>
|
||||
</tr>
|
||||
|
||||
@@ -14,17 +14,6 @@
|
||||
.main-table tbody>tr:hover { background-color: #fff; }
|
||||
.main-table tbody>tr:nth-child(odd):hover { background-color: #f5f5f5; }
|
||||
</style>
|
||||
<div id="mainMenu" class="clearfix">
|
||||
<div class="btn-toolbar pull-left">
|
||||
<?php
|
||||
foreach($lang->personnel->inputLabel as $label => $labelName)
|
||||
{
|
||||
$active = $browseType == $label ? 'btn-active-text' : '';
|
||||
echo html::a($this->createLink('personnel', 'putInto', "programID=$programID&browseType=$label"), '<span class="text">' . $labelName . '</span>', '', "class='btn btn-link $active'");
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div id="mainContent" class="main-row fade">
|
||||
<?php if(!empty($inputPersonnel['projects'])):?>
|
||||
<div class="main-col">
|
||||
|
||||
@@ -161,7 +161,7 @@ class programModel extends model
|
||||
* Get program pairs.
|
||||
*
|
||||
* @access public
|
||||
* @return void
|
||||
* @return array
|
||||
*/
|
||||
public function getPGMPairs()
|
||||
{
|
||||
|
||||
@@ -74,7 +74,7 @@ class programplanModel extends model
|
||||
->beginIF($browseType == 'all')->andWhere('project')->eq($programID)->fi()
|
||||
->beginIF($browseType == 'parent')->andWhere('parent')->eq($programID)->fi()
|
||||
->beginIF($browseType == 'children')->andWhere('parent')->eq($planID)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->stages)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->sprints)->fi()
|
||||
->beginIF($productID)->andWhere('id')->in($projects)->fi()
|
||||
->andWhere('deleted')->eq(0)
|
||||
->orderBy($orderBy)
|
||||
@@ -534,7 +534,7 @@ class programplanModel extends model
|
||||
->where('id')->eq($planID)
|
||||
->exec();
|
||||
|
||||
if($data->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'stage');
|
||||
if($data->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'sprints');
|
||||
|
||||
if($planChanged)
|
||||
{
|
||||
@@ -571,7 +571,7 @@ class programplanModel extends model
|
||||
$planID = $this->dao->lastInsertID();
|
||||
|
||||
$this->setTreePath($planID);
|
||||
if($data->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'stage');
|
||||
if($data->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'sprints');
|
||||
|
||||
$this->post->set('products', array(0 => $productID));
|
||||
$this->loadModel('project')->updateProducts($planID);
|
||||
@@ -675,7 +675,7 @@ class programplanModel extends model
|
||||
|
||||
if(dao::isError()) return false;
|
||||
$this->setTreePath($planID);
|
||||
if($plan->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'stage');
|
||||
if($plan->acl != 'open') $this->loadModel('user')->updateUserView($planID, 'sprints');
|
||||
|
||||
if($planChanged)
|
||||
{
|
||||
|
||||
@@ -2385,6 +2385,7 @@ class project extends control
|
||||
*/
|
||||
public function all($status = 'undone', $projectID = 0, $orderBy = 'order_desc', $productID = 0, $recTotal = 0, $recPerPage = 10, $pageID = 1)
|
||||
{
|
||||
$this->app->loadLang('my');
|
||||
if($this->projects)
|
||||
{
|
||||
$project = $this->commonAction($projectID);
|
||||
@@ -2396,9 +2397,9 @@ class project extends control
|
||||
$this->app->loadClass('pager', $static = true);
|
||||
$pager = new pager($recTotal, $recPerPage, $pageID);
|
||||
|
||||
$this->app->loadLang('my');
|
||||
$this->view->title = $this->lang->project->allProject;
|
||||
$this->view->position[] = $this->lang->project->allProject;
|
||||
|
||||
$this->view->projectStats = $this->project->getProjectStats($status == 'byproduct' ? 'all' : $status, $productID, 0, 30, $orderBy, $pager);
|
||||
$this->view->products = array(0 => $this->lang->product->select) + $this->loadModel('product')->getPairs('', $this->session->PRJ);
|
||||
$this->view->productID = $productID;
|
||||
|
||||
@@ -921,11 +921,11 @@ class projectModel extends model
|
||||
/**
|
||||
* Get project stats.
|
||||
*
|
||||
* @param string $status
|
||||
* @param int $productID
|
||||
* @param int $itemCounts
|
||||
* @param string $orderBy
|
||||
* @param int $pager
|
||||
* @param string $status
|
||||
* @param int $productID
|
||||
* @param int $itemCounts
|
||||
* @param string $orderBy
|
||||
* @param object $pager
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user