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

added p5:allow_write to DescribeFeatureTypeAdvanced in wfs-data

Piotr Labudda 10 лет назад
Родитель
Сommit
587136de0a
1 измененных файлов с 6 добавлено и 2 удалено
  1. 6 2
      SE/se-lib/Api/WfsServerBase.php

+ 6 - 2
SE/se-lib/Api/WfsServerBase.php

@@ -1453,8 +1453,9 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
 				$elNode->setAttribute('type', $fldType);
 
 				if (!$simple) {
-					if (!empty($p5Attributes[$fldName]['id_zasob'])) {
-						$elNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:id_zasob", $p5Attributes[$fldName]['id_zasob']);
+					$idZasob = (!empty($p5Attributes[$fldName]['id_zasob']))? (int)$p5Attributes[$fldName]['id_zasob'] : null;
+					if ($idZasob > 0) {
+						$elNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:id_zasob", $idZasob);
 					}
 					if (!empty($p5Attributes[$fldName]['label'])) {
 						$elNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:label", $p5Attributes[$fldName]['label']);
@@ -1462,6 +1463,9 @@ if($DBG){echo 'L.' . __LINE__ . ' $validateConvertedTransactionXsdString:';print
 					if (!empty($p5Attributes[$fldName]['description'])) {
 						$elNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:description", $p5Attributes[$fldName]['description']);
 					}
+					if ($idZasob > 0 && $acl->hasFieldPerm($idZasob, 'W')) {
+						$elNode->setAttributeNS($rootWfsNsUri, "{$rootWfsNs}:allow_write", "true");
+					}
 				}
 			}