a.binder 8 rokov pred
rodič
commit
7d343aec92

+ 39 - 0
SE/se-lib/Route/UrlAction/defaultIn7MkBazaDystrybucji.php

@@ -44,11 +44,50 @@ class Route_UrlAction_defaultIn7MkBazaDystrybucji extends RouteBase {
 
 		SE_Layout::dol();
 	}
+	
+		
+
+	
 
 	private function test() {
 		echo "<pre>";
 		print_r($this->OBJECT);
+		$namespace = 'default_db/IN7_MK_BAZA_DYSTRYBUCJI/IN7_MK_BAZA_DYSTRYBUCJI';
+		$item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
+          print_r($item);
 		echo "</pre>";
 	}
+	
+	
+	
+	public static function getRefTables($tableFrom) { //copied from BiAuditGenerate.php
+		static $refTables = [];
+		if (!isset($refTables[$tableFrom])) {
+			$namespace = "default_db/{$tableFrom}/{$tableFrom}";
+			try {
+				$item = SchemaFactory::loadDefaultObject('SystemObject')->getItem($namespace, [ 'propertyName' => '*,field' ]);
+				if (!($item['hasStruct'] && $item['isStructInstalled'] && $item['isObjectActive'])) throw new Exception("Object error");
+				$fields = $item['field'];
+
+				$_refTables = [];
+				foreach ($fields as $field) {
+					list($type, $child) = explode(":", $field['xsdType'], 2);
+					if ($type == "ref" && $field['idZasob'] && $field['isActive'] && (!$field['isLocal'])) {
+						try {
+							$_refTable = ACL::getRefTable($namespace, $child);
+							$_refTables[] = $_refTable;
+						} catch (Exception $e) {
+						}
+					}
+				}
+				$refTables[$tableFrom] = $_refTables;
+			} catch (Exception $e) {
+				$refTables[$tableFrom] = [];
+			}
+		}
+		return $refTables[$tableFrom];
+	}
+	
+	
 
 }