Beispiel #1
0
 /**
  * Return the data for a single customer
  */
 public function getLookupData()
 {
     $lkp = array();
     $db = ezcDbInstance::get();
     $constraint = array('esu_allow_in_building IS TRUE', $this->data['em_is_production'] == 'T' ? "esu_is_production IS TRUE" : "esu_is_consumption IS TRUE");
     $lkp['em_production_values'] = array('F' => _('Consumo'), 'T' => _('Produzione'));
     $lkp['us_values'] = R3EcogisHelper::getUtilitySupplierList($this->do_id, $this->mu_id, $this->kind);
     $lkp['es_values'] = R3EcoGisHelper::getEnergySourceList($this->do_id, $this->kind, array('constraints' => $constraint));
     if ($this->data['us_id'] > 0) {
         $lkp['up_values'] = R3EcoGisHelper::getUtilityProductList($this->do_id, $this->data['us_id'], $this->kind);
     }
     if (isset($lkp['es_values']) && count($lkp['es_values']) == 1 || $this->data['es_id'] > 0) {
         $lkp['udm_values'] = R3EcogisHelper::getEnergyUDMListByEnergySource($this->do_id, $this->kind, $this->act == 'add' ? key($lkp['es_values']) : $this->data['es_id']);
     }
     return $lkp;
 }