* Get program list with hierarchy in screen's metric.
This commit is contained in:
@@ -974,14 +974,15 @@ class metricModel extends model
|
||||
* Get object pairs by scope.
|
||||
*
|
||||
* @param string $scope
|
||||
* @param bool $deptWithHierarchy
|
||||
* @param bool $withHierarchy
|
||||
* @access public
|
||||
* @return array
|
||||
*/
|
||||
public function getPairsByScope($scope, $deptWithHierarchy = false)
|
||||
public function getPairsByScope($scope, $withHierarchy = false)
|
||||
{
|
||||
if(empty($scope) || $scope == 'system') return array();
|
||||
if($scope == 'dept' && $deptWithHierarchy) $scope = 'deptWithHierarchy';
|
||||
if($scope == 'dept' && $withHierarchy) $scope = 'deptWithHierarchy';
|
||||
if($scope == 'program' && $withHierarchy) $scope = 'programWithHierarchy';
|
||||
|
||||
$objectPairs = array();
|
||||
switch($scope)
|
||||
@@ -1001,6 +1002,9 @@ class metricModel extends model
|
||||
->andWhere('type')->eq('program')
|
||||
->fetchPairs();
|
||||
break;
|
||||
case 'programWithHierarchy':
|
||||
$objectPairs = $this->loadModel('program')->getParentPairs();
|
||||
break;
|
||||
case 'product':
|
||||
$objectPairs = $this->dao->select('id, name')->from(TABLE_PRODUCT)
|
||||
->where('deleted')->eq(0)->fetchPairs();
|
||||
|
||||
Reference in New Issue
Block a user