Explorar o código

fixed WfsBiAudit

Piotr Labudda %!s(int64=8) %!d(string=hai) anos
pai
achega
66072e8f41
Modificáronse 1 ficheiros con 4 adicións e 2 borrados
  1. 4 2
      SE/se-lib/Route/WfsBiAudit.php

+ 4 - 2
SE/se-lib/Route/WfsBiAudit.php

@@ -244,6 +244,8 @@ public function objectStructView($item) {
 	public function addAclInfo($dataNode, $typeName, $primaryKey, $skipFields = []) {
 		try {
 			$acl = ACL::getAclByTypeName($typeName);
+			list($nsPrefix, $nsBaseName) = explode(':', $typeName);
+			// list($nsSourceName, $nsBaseTable) = explode('__x3A__', $nsPrefix);
 			$item = $acl->buildQuery([
 				'cols' => array_values($acl->getFieldListByIdZasob()),
 			])->getItem($primaryKey);
@@ -264,7 +266,7 @@ public function objectStructView($item) {
 				if (in_array($fieldName, $skipFields)) continue;
 				// $this->addAttribute($dataNode, 'xlink:href', "https://biuro.biall-net.pl/wfs/default_db/{$row['REMOTE_TABLE']}?BI_audit_ALL_ref_RELATIONS={$relation}#{$row['REMOTE_TABLE']}.{$row['REMOTE_ID']}");
 				if (is_scalar($value)) {
-					$this->addChild($dataNode, "default_db__x3A__{$row['REMOTE_TABLE']}:{$fieldName}", $value);
+					$this->addChild($dataNode, "{$nsPrefix}:{$fieldName}", $value);
 				} else if (is_array($value) && false !== strpos($fieldName, ':')) {
 					$this->addRootXmlnsTablePrefix($fieldName);
 
@@ -281,7 +283,7 @@ public function objectStructView($item) {
 						}
 					}
 				} else if (NULL === $value) {
-					$this->addChild($dataNode, $fieldName); // xs:nil ?
+					$this->addChild($dataNode, "{$nsPrefix}:{$fieldName}"); // xs:nil ?
 				} else {
 					$this->addChild($dataNode, $fieldName, "<!-- TODO: " . var_export($value, true) . " -->");
 				}