Просмотр исходного кода

fixed geom_fields in Data_Source and TableAcl

Piotr Labudda 9 лет назад
Родитель
Сommit
2835bf40ba
2 измененных файлов с 10 добавлено и 14 удалено
  1. 1 9
      SE/se-lib/Data_Source.php
  2. 9 5
      SE/se-lib/TableAcl.php

+ 1 - 9
SE/se-lib/Data_Source.php

@@ -24,7 +24,6 @@ class Data_Source {
 	var $_sql_offset;
 	var $_sql_left_join;// TODO: left join in table
 	var $_isAccessFltrAllowed = null;
-	private $_geomFields = array();
 	private $_fieldOwner = null;
 	private $_fieldGroupWrite = null;
 	private $_fieldGroupRead = null;
@@ -37,8 +36,6 @@ class Data_Source {
 			$this->_db = DB::getDB();
 		}
 		$this->_default_sql_limit = 10;
-
-		$this->_geomFields = array('the_geom');
 		$this->_showMsgsSpecialFilter = true;// TODO: allow by acl, procesy?
 	}
 
@@ -184,7 +181,6 @@ class Data_Source {
 			}
 			$sqlCols = implode(", ", $sqlColsList);
 		}
-		DBG::_('DBG_DS', '>2', "sqlCols", $sqlCols, __CLASS__, __FUNCTION__, __LINE__);
 		return $sqlCols;
 	}
 
@@ -922,12 +918,8 @@ class Data_Source {
 		return $insert_id;
 	}
 
-	public function getGeomFields() {
-		return $this->_geomFields;
-	}
-
 	public function isGeomField($fldName) {
-		return in_array($fldName, $this->_geomFields);
+		return ('the_geom' == $fldName);
 	}
 
 	public function isCsvNumericField($fldName) {

+ 9 - 5
SE/se-lib/TableAcl.php

@@ -975,6 +975,15 @@ class TableAcl extends Core_AclBase {
 		return (bool)$this->_schemaClass;
 	}
 
+	public function getLocalFieldList() {
+		$this->getFields();
+		return array_keys($this->_types);
+	}
+	public function isLocalField($fieldName) {
+		$this->getFields();
+		return array_key_exists($fieldName, $this->_types);
+	}
+
 	public function init($force = false) {
 		// DBG::log("DBG INIT - init ({$this->_zasobID}, {$this->_rootTableName})");
 	}
@@ -1530,11 +1539,6 @@ class TableAcl extends Core_AclBase {
 		return $ds->getSpecialFilters();
 	}
 
-	public function getGeomFields() {
-		$ds = $this->getDataSource();
-		return $ds->getGeomFields();
-	}
-
 	public function isGeomField($fldName) {
 		$ds = $this->getDataSource();
 		return $ds->isGeomField($fldName);