* Fix project get pairs method.
This commit is contained in:
@@ -815,9 +815,14 @@ class programModel extends model
|
||||
* @access public
|
||||
* @return object
|
||||
*/
|
||||
public function getPRJPairs($projectID = 0)
|
||||
public function getPRJPairs($programID = 0)
|
||||
{
|
||||
return $this->dao->select('id,name')->from(TABLE_PROJECT)->where('id')->eq($projectID)->fetch();
|
||||
return $this->dao->select('id, name')->from(TABLE_PROJECT)
|
||||
->where('type')->eq('project')
|
||||
->andWhere('deleted')->eq(0)
|
||||
->beginIF($programID)->andWhere('parent')->eq($programID)->fi()
|
||||
->beginIF(!$this->app->user->admin)->andWhere('id')->in($this->app->user->view->programs)->fi()
|
||||
->fetchPairs();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -90,7 +90,7 @@ class repo extends control
|
||||
|
||||
$this->view->groups = $this->loadModel('group')->getPairs();
|
||||
$this->view->users = $this->loadModel('user')->getPairs('noletter|noempty|nodeleted');
|
||||
$this->view->programs = $this->loadModel('program')->getPairs();
|
||||
$this->view->programs = $this->loadModel('program')->getPRJPairs();
|
||||
|
||||
$this->view->title = $this->lang->repo->common . $this->lang->colon . $this->lang->repo->create;
|
||||
$this->view->position[] = html::a(inlink('maintain'), $this->lang->repo->common);
|
||||
|
||||
@@ -590,7 +590,8 @@ class todo extends control
|
||||
public function ajaxGetProgramID($objectID, $objectType)
|
||||
{
|
||||
$table = $objectType == 'project' ? TABLE_PROJECT : TABLE_PRODUCT;
|
||||
die($this->dao->select('program')->from($table)->where('id')->eq($objectID)->fetch('program'));
|
||||
$field = $objectType == 'project' ? 'parent' : 'program';
|
||||
die($this->dao->select($field)->from($table)->where('id')->eq($objectID)->fetch($field));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user