* finish task #2459.

This commit is contained in:
chenfeiCF
2016-02-23 21:46:26 +08:00
parent 0269715534
commit 7683db7228
4 changed files with 45 additions and 5 deletions
+16 -2
View File
@@ -115,16 +115,17 @@ class deptModel extends model
*
* @param int $rootDeptID
* @param string $userFunc
* @param int $groupID
* @access public
* @return string
*/
public function getTreeMenu($rootDeptID = 0, $userFunc)
public function getTreeMenu($rootDeptID = 0, $userFunc, $groupID = 0)
{
$deptMenu = array();
$stmt = $this->dbh->query($this->buildMenuQuery($rootDeptID));
while($dept = $stmt->fetch())
{
$linkHtml = call_user_func($userFunc, $dept);
$linkHtml = call_user_func($userFunc, $dept, $groupID);
if(isset($deptMenu[$dept->id]) and !empty($deptMenu[$dept->id]))
{
@@ -202,6 +203,19 @@ class deptModel extends model
return $linkHtml;
}
/**
* Create the group Link.
*
* @param int $dept
* @param int $groupID
* @access public
* @return string
*/
public function createGroupLink($dept, $groupID)
{
return html::a(helper::createLink('group', 'managemember', "groupID=$groupID&deptID={$dept->id}"), $dept->name, '_self', "id='dept{$dept->id}'");
}
/**
* Get sons of a department.
*