Browse Source

fixed Core_AclHelper::getAclByNamespace for table object types default_db__x3A__

Piotr Labudda 9 years ago
parent
commit
dc5282d51f

+ 1 - 1
SE/se-lib/Core/AclHelper.php

@@ -278,7 +278,7 @@ class Core_AclHelper {// Helper class for Acl
       $nsPrefix = $sourceName;
     	if (1 == count($nsEx)) {
         $sourceName = 'table_objects';// TODO: another source name to read from simpleSchema @see Core_AclSimpleSchemaBase
-        $nsPrefix = 'default_db__x3A__' . $objName;
+        $nsPrefix = 'default_db__x3A__' . $nsEx[0];
       }
       // $objName = $nsEx[1];// 'default_db/ZALICZKA:Zaliczka' => ('objects', 'Zaliczka') - possible name conflicts
       $nsUrl = trim($baseNsUri . '/default_db/' . implode("/", $nsEx), '/');

+ 36 - 0
SE/se-lib/Schema/DefaultDb/zaliczka/ZaliczkaAnulowanaStorageAcl.php

@@ -0,0 +1,36 @@
+<?php
+
+Lib::loadClass('Core_AclSimpleSchemaBase');// extends Core_AclBase
+Lib::loadClass('Core_AclHelper');
+Lib::loadClass('Schema_DefaultDb_zaliczka_ZaliczkaStorageAcl');
+
+class Schema_DefaultDb_zaliczka_ZaliczkaAnulowanaStorageAcl extends Schema_DefaultDb_zaliczka_ZaliczkaStorageAcl {
+
+  public $_simpleSchema = [
+    'root' => [
+      '@namespace' => 'default_db/ZALICZKA/ZaliczkaAnulowana',// Api_WfsNs::getBaseWfsUri() . '/default_db/Zaliczka'
+      '@derived' => [
+        'default_db/ZALICZKA/Zaliczka'
+      ],
+      'id' => 'xsd:integer',
+      'created' => [ '@type' => 'xsd:date', '@alias' => 'A_RECORD_CREATE_DATE' ],
+      'worker' => [ '@ref' => 'default_objects/AccessOwner' ],// 'alias_ref:default_objects:AccessOwner'
+      // 'worker' => [ '@ref' => 'Worker' ],
+      'kwota' => [ '@type' => 'xsd:decimal', '@totalDigits' => 16, '@fractionDigits' => 2 ],
+      'nierozliczona_kwota' => [ '@type' => 'xsd:decimal', '@totalDigits' => 16, '@fractionDigits' => 2 ],
+      'pozycja' => [ '@ref' => 'default_db/ZALICZKA_POZYCJA/ZaliczkaPozycja', '@maxOccurs' => 'unbounded' ]
+    ],
+    'Korespondencja' => [
+      '@namespace' => 'default_db/IN7_DZIENNIK_KORESP',
+      'id' => [ '@type' => 'xsd:integer', '@alias' => 'ID' ],
+      'title' => [ '@type' => 'xsd:string', '@alias' => 'K_ZAWARTOS' ],
+      'kategoriaKosztu' => [ '@type' => 'xsd:string', '@alias' => 'KATEGORIA_KOSZTU' ]
+    ],
+    'Projekt' => [
+      '@namespace' => 'default_db/IN7_MK_BAZA_DYSTRYBUCJI',
+      'id' => [ '@type' => 'xsd:integer', '@alias' => 'ID' ],
+      'nrBudowy' => [ '@type' => 'xsd:string', '@alias' => 'M_DIST_DEALNUM' ],// TODO: ? M_DIST_DESC (szerszy opis)
+    ],
+  ];
+
+}