|
@@ -966,6 +966,7 @@ class TableAcl extends Core_AclBase {
|
|
|
uasort($this->_fields, array($this, 'sortFieldsCallback'));
|
|
uasort($this->_fields, array($this, 'sortFieldsCallback'));
|
|
|
|
|
|
|
|
$this->_fixTypes();
|
|
$this->_fixTypes();
|
|
|
|
|
+ DBG::_('DBG_SCH', '>1', "INIT::after fixTypes({$this->_zasobID})", $this->_types, __CLASS__, __FUNCTION__, __LINE__ );
|
|
|
|
|
|
|
|
$this->save();
|
|
$this->save();
|
|
|
}
|
|
}
|
|
@@ -978,6 +979,20 @@ class TableAcl extends Core_AclBase {
|
|
|
if ($this->_schemaClass) $this->_types = $this->_schemaClass->fixTypes($this->_types);
|
|
if ($this->_schemaClass) $this->_types = $this->_schemaClass->fixTypes($this->_types);
|
|
|
//DBG::_(true, true, "this->_types", $this->_types, __CLASS__, __FUNCTION__, __LINE__);
|
|
//DBG::_(true, true, "this->_types", $this->_types, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
|
|
|
|
|
|
|
+ // fixGeomTypesFromSimpleType
|
|
|
|
|
+ foreach ($this->_types as $fieldName => $field) {
|
|
|
|
|
+ // [the_geom] => Array(
|
|
|
|
|
+ // [type] => geometry
|
|
|
|
|
+ // [null] => 1
|
|
|
|
|
+ // [default] =>
|
|
|
|
|
+ // [simpleType] => linestring
|
|
|
|
|
+ if ('geometry' == $field['type'] && !empty($field['simpleType'])) {
|
|
|
|
|
+ switch ($field['simpleType']) {
|
|
|
|
|
+ case 'gml:LineStringPropertyType': $this->_types[ $fieldName ][ 'type' ] = 'linestring'; break;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
$fieldIds = array_keys($this->_fields);
|
|
$fieldIds = array_keys($this->_fields);
|
|
|
Lib::loadClass('Typespecial');
|
|
Lib::loadClass('Typespecial');
|
|
|
$vColsIdList = Typespecial::initFields($fieldIds);
|
|
$vColsIdList = Typespecial::initFields($fieldIds);
|
|
@@ -1133,28 +1148,19 @@ class TableAcl extends Core_AclBase {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function getFieldTypeById($fieldID) {
|
|
public function getFieldTypeById($fieldID) {
|
|
|
- if (!array_key_exists($fieldID, $this->_fields)) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- $colName = $this->_fields[$fieldID]['name'];
|
|
|
|
|
- if (!array_key_exists($colName, $this->_types)) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- return $this->_types[$colName];
|
|
|
|
|
|
|
+ if (!array_key_exists($fieldID, $this->_fields)) return null;
|
|
|
|
|
+ $fieldName = $this->_fields[$fieldID]['name'];
|
|
|
|
|
+ if (!array_key_exists($fieldName, $this->_types)) return null;
|
|
|
|
|
+ return $this->_types[$fieldName];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getFieldType($colName) {
|
|
|
|
|
- if (!array_key_exists($colName, $this->_types)) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
- return $this->_types[$colName];
|
|
|
|
|
|
|
+ public function getFieldType($fieldName) {
|
|
|
|
|
+ if (!array_key_exists($fieldName, $this->_types)) return null;
|
|
|
|
|
+ return $this->_types[$fieldName];
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function hasFieldType($colName) {
|
|
|
|
|
- if (array_key_exists($colName, $this->_types)) {
|
|
|
|
|
- return true;
|
|
|
|
|
- }
|
|
|
|
|
- return false;
|
|
|
|
|
|
|
+ public function hasFieldType($fieldName) {
|
|
|
|
|
+ return (array_key_exists($fieldName, $this->_types));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function getVisibleFieldList() { return $this->getVisibleFieldListByIdZasob(); }
|
|
public function getVisibleFieldList() { return $this->getVisibleFieldListByIdZasob(); }
|
|
@@ -1386,8 +1392,8 @@ class TableAcl extends Core_AclBase {
|
|
|
return $ds->isGeomField($fldName);
|
|
return $ds->isGeomField($fldName);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function getGeomFieldType($fldName) {
|
|
|
|
|
- $dbGeomType = $this->getFieldType($fldName);
|
|
|
|
|
|
|
+ public function getGeomFieldType($fieldName) {
|
|
|
|
|
+ $dbGeomType = $this->getFieldType($fieldName);
|
|
|
$dbGeomType = (!empty($dbGeomType['type']))? $dbGeomType['type'] : '';
|
|
$dbGeomType = (!empty($dbGeomType['type']))? $dbGeomType['type'] : '';
|
|
|
$geomType = strtolower($dbGeomType);
|
|
$geomType = strtolower($dbGeomType);
|
|
|
return $geomType;
|
|
return $geomType;
|