diff --git a/module/metric/model.php b/module/metric/model.php index 00147273ad..79c3771356 100755 --- a/module/metric/model.php +++ b/module/metric/model.php @@ -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();