* adjust code for zentaopro.

This commit is contained in:
wangyidong
2016-06-13 14:11:03 +08:00
parent 88bb6e8df8
commit 3c8f0a4abf
2 changed files with 22 additions and 1 deletions
+14
View File
@@ -131,4 +131,18 @@ class dept extends control
die(js::reload('parent'));
}
}
/**
* Ajax get users
*
* @param int $dept
* @param string $user
* @access public
* @return void
*/
public function ajaxGetUsers($dept, $user = '')
{
$users = array('' => '') + $this->dept->getDeptUserPairs($dept);
die(html::select('user', $users, $user, "class='form-control chosen'"));
}
}
+8 -1
View File
@@ -505,7 +505,14 @@ class product extends control
*/
public function ajaxGetProjects($productID, $projectID = 0, $branch = 0)
{
$projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : $branch, $params = 'nodeleted');
if($productID == 0)
{
$projects = array(0 => '') + $this->loadModel('project')->getPairs();
}
else
{
$projects = $this->product->getProjectPairs($productID, $branch ? "0,$branch" : $branch, $params = 'nodeleted');
}
die(html::select('project', $projects, $projectID, 'class=form-control onchange=loadProjectRelated(this.value)'));
}