Exemplo n.º 1
0
 /**
  * Return the data for a single customer
  */
 public function getLookupData($id = null)
 {
     R3EcoGisHelper::includeHelperClass('obj.global_consumption_row.php');
     R3EcoGisHelper::includeHelperClass('obj.global_plain_row.php');
     $lkp = array();
     $lkp['ft_id_values'] = R3EcoGisHelper::getWorkFundingTypeList($_SESSION['do_id']);
     if ($this->auth->getParam('mu_id') == '') {
         $lkp['pr_values'] = R3EcoGisHelper::getProvinceList($this->do_id);
         $lkp['mu_values'] = R3EcoGisHelper::getMunicipalityAndMunicipalityCollectionList($this->do_id);
     } else {
         $lkp['mu_values'] = array($this->auth->getParam('mu_id') => '');
     }
     $mu_id = $this->auth->getParam('mu_id');
     if ($this->act == 'add' && count($lkp['mu_values']) == 1) {
         $mu_id = key($lkp['mu_values']);
     } else {
         if ($this->act == 'mod' || $this->act == 'show') {
             $mu_id = $this->data['mu_id'];
         }
     }
     $lkp['gc_parent_values'] = R3EcoGisGlobalPlainHelper::getCategoriesListByparentId($_SESSION['do_id']);
     $lkp['consumption_energy_source_list'] = R3EcoGisGlobalConsumptionHelper::getEnergySourceList($_SESSION['do_id'], 'CONSUMPTION', array('order' => 'ges_name, gest_order, ges_order, ges.ges_id, es_order, es_name, es.es_id, udm_order, udm_name, udm.udm_id'));
     $lkp['production_energy_source_list'] = R3EcoGisActionCatalogHelper::getProductionEnergySourceList($_SESSION['do_id']);
     if ($this->act != 'add') {
         $lkp['gc_values'] = R3EcoGisGlobalPlainHelper::getCategoriesListByparentId($_SESSION['do_id'], $this->data['gc_parent_id']);
         $lkp['ac_object_values'] = R3EcoGisActionCatalogHelper::getSubCategoriesListById($_SESSION['do_id'], $this->data['mu_id'], $this->data['gc_id']);
         $lkp['gpa_values'] = R3EcoGisGlobalPlainHelper::getPlainActionList($_SESSION['do_id'], $this->data['gc_id']);
         if ($this->data['esu_id_production'] != '') {
             $lkp['es_id_production_values'] = array();
             $lkp['udm_id_production_values'] = array();
             foreach ($lkp['production_energy_source_list'][$this->data['ges_id_production']]['source'] as $esKey => $esVal) {
                 $lkp['es_id_production_values'][$esKey] = $esVal['name'];
                 foreach ($esVal['udm'] as $udmKey => $udmVal) {
                     $lkp['udm_id_production_values'][$udmKey] = $udmVal['name'];
                 }
             }
         }
     } else {
         if ($this->bu_id != '') {
             $lkp['gpa_values'] = R3EcoGisGlobalPlainHelper::getPlainActionList($_SESSION['do_id'], $this->data['gc_id']);
         }
     }
     $lkp['ac_related_actions_list'] = array();
     if (!empty($this->data['mu_id'])) {
         $lkp['ac_related_actions_list'] = $this->getActionListForRelatedSelection($this->data['mu_id'], $this->data['ac_id']);
     }
     return $lkp;
 }