Przeglądaj źródła

added support for p5Type: geom in TableAjax

Piotr Labudda 8 lat temu
rodzic
commit
9ef63e1a5a

+ 11 - 2
SE/se-lib/AntAclBase.php

@@ -329,7 +329,16 @@ class AntAclBase extends Core_AclBase {
 
 
 	public function isGeomField($fieldName) {
-		return ('the_geom' === $fieldName); // TODO: check by xsdType
+		$xsdType = $this->getXsdFieldType($fieldName);
+		switch ($xsdType) {
+			case "gml:PolygonPropertyType":
+			case "gml:LineStringPropertyType":
+			case "gml:PointPropertyType":
+			case "p5Type:polygon":
+			case "p5Type:lineString":
+			case "p5Type:point": return true;
+			default: return false;
+		}
 	}
 	public function isEnumerationField($fieldName) {
 		$xsdType = $this->getXsdFieldType($fieldName);
@@ -428,7 +437,7 @@ class AntAclBase extends Core_AclBase {
 	}
 
 	public function hasFieldPerm($fieldID, $perm) { // TODO: legacy
-		$field = $this->getField();
+		$field = $this->getField($fieldID);
 		if (!$field) return false;
 		try {
 			$fieldAclInfo = $this->getAclInfo($fieldName);

+ 6 - 0
SE/se-lib/TableAjax.php

@@ -2138,6 +2138,7 @@ jQuery(document).ready(function(){
 							} break;
 						}
 						break;
+					case 'gml': $columnConfig->type = 'geom'; break;
 					case 'p5Type':
 						switch ($typeName) {
 							case 'enum': $columnConfig->type = 'string'; break;
@@ -2151,6 +2152,11 @@ jQuery(document).ready(function(){
 								$columnConfig->formatByValue = $acl->getXsdFieldParam($col, 'formatByValue');
 								if ($aliasMap = $acl->getXsdFieldParam($col, 'aliasMap')) $columnConfig->aliasMap = $aliasMap;
 							} break;
+							case 'polygon':
+							case 'lineString':
+							case 'point': {
+								$columnConfig->type = 'geom';
+							} break;
 						}
 						break;
 				}

+ 3 - 0
SE/se-lib/TableAjax.php.TableAjax.js

@@ -499,6 +499,9 @@ var TableAjax = function() {
 			case "gml:PolygonPropertyType":
 			case "gml:LineStringPropertyType":
 			case "gml:PointPropertyType":
+			case "p5Type:polygon":
+			case "p5Type:lineString":
+			case "p5Type:point":
 			case "geom":
 				fieldWidget = (function(fldName, fieldProps) {
 					var _fieldName = fldName,