|
@@ -95,6 +95,7 @@ class Schema_SystemObjectFieldStorageAcl extends Core_AclSimpleSchemaBase {
|
|
|
switch ($objectItem['_type']) {
|
|
switch ($objectItem['_type']) {
|
|
|
case 'AntAcl': $this->updateCacheAntAcl($objectItem); break;
|
|
case 'AntAcl': $this->updateCacheAntAcl($objectItem); break;
|
|
|
case 'TableAcl': $this->updateCacheTableAcl($objectItem); break;
|
|
case 'TableAcl': $this->updateCacheTableAcl($objectItem); break;
|
|
|
|
|
+ case 'StorageAcl': $this->updateCacheStorageAcl($objectItem); break;
|
|
|
default: throw new Exception("TODO: Not Implemented type '{$objectItem['_type']}'");
|
|
default: throw new Exception("TODO: Not Implemented type '{$objectItem['_type']}'");
|
|
|
}
|
|
}
|
|
|
// TODO: mv from methods: SchemaFactory::loadDefaultObject('SystemObject')->updateItem([
|
|
// TODO: mv from methods: SchemaFactory::loadDefaultObject('SystemObject')->updateItem([
|
|
@@ -189,6 +190,64 @@ class Schema_SystemObjectFieldStorageAcl extends Core_AclSimpleSchemaBase {
|
|
|
echo UI::h('pre', ['style' => 'max-height:400px; overflow:scroll'], htmlspecialchars(ob_get_clean()));
|
|
echo UI::h('pre', ['style' => 'max-height:400px; overflow:scroll'], htmlspecialchars(ob_get_clean()));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+ public function updateCacheStorageAcl($item) {
|
|
|
|
|
+ Lib::loadClass('SchemaFactory');
|
|
|
|
|
+ $aclName = substr($item['namespace'], strlen('default_objects/'));
|
|
|
|
|
+ DBG::log($aclName, 'array', "\$aclName");
|
|
|
|
|
+ $fvAcl = SchemaFactory::loadDefaultObject($aclName);
|
|
|
|
|
+ DBG::log($fvAcl->getFields(), 'array', "\$fvAcl->getFields()");
|
|
|
|
|
+ foreach ($fvAcl->getFields() as $field) {
|
|
|
|
|
+ // 'name' => 'id',
|
|
|
|
|
+ // 'perms' => '',
|
|
|
|
|
+ // 'idZasob' => 10000,
|
|
|
|
|
+ // 'xsdType' => 'xsd:integer',
|
|
|
|
|
+ // 'label' => 'id',
|
|
|
|
|
+ $fieldName = $field['name'];
|
|
|
|
|
+ $xsdType = $field['xsdType'];
|
|
|
|
|
+ DB::getPDO()->insertOrUpdate($this->_rootTableName, [
|
|
|
|
|
+ 'namespace' => "{$item['namespace']}/{$fieldName}",
|
|
|
|
|
+ 'objectNamespace' => $item['namespace'],
|
|
|
|
|
+ 'idDatabase' => $item['idDatabase'],
|
|
|
|
|
+ '_rootTableName' => $item['_rootTableName'],
|
|
|
|
|
+ 'fieldNamespace' => $fieldName,
|
|
|
|
|
+ 'xsdType' => $xsdType,
|
|
|
|
|
+ // 'xsdRestrictions' => '',
|
|
|
|
|
+ // 'appInfo' => '',
|
|
|
|
|
+ // 'minOccurs' => '',
|
|
|
|
|
+ // 'maxOccurs' => '',
|
|
|
|
|
+ 'isActive' => 1
|
|
|
|
|
+ ]);
|
|
|
|
|
+ $listEnum = [];
|
|
|
|
|
+ if (!empty($listEnum)) {
|
|
|
|
|
+ DBG::nicePrint($listEnum, '$listEnum');
|
|
|
|
|
+ foreach ($listEnum as $value => $label) {
|
|
|
|
|
+ DB::getPDO()->insertOrUpdate("{$this->_rootTableName}_enum", [
|
|
|
|
|
+ 'namespace' => "{$item['namespace']}/{$fieldName}/@{$value}",
|
|
|
|
|
+ 'fieldNamespace' => $fieldName,
|
|
|
|
|
+ 'objectNamespace' => $item['namespace'],
|
|
|
|
|
+ 'value' => $value,
|
|
|
|
|
+ 'label' => $label,
|
|
|
|
|
+ 'isActive' => 1
|
|
|
|
|
+ ]);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ SchemaFactory::loadDefaultObject('SystemObject')->updateItem([
|
|
|
|
|
+ 'namespace' => $item['namespace'],
|
|
|
|
|
+ 'isStructInstalled' => 1
|
|
|
|
|
+ ]);
|
|
|
|
|
+ // $zasobTableName = substr($item['objectNamespace'], strlen('default_db/'));
|
|
|
|
|
+ // $zasobTableName = (false !== strpos($zasobTableName, '/'))
|
|
|
|
|
+ // ? $item['objectNamespace']
|
|
|
|
|
+ // : $zasobTableName;
|
|
|
|
|
+ // DB::getPDO()->execSql("
|
|
|
|
|
+ // update `{$this->_rootTableName}` t
|
|
|
|
|
+ // join CRM_LISTA_ZASOBOW zp on(zp.PARENT_ID = {$item['idDatabase']} and zp.`DESC` = '{$zasobTableName}')
|
|
|
|
|
+ // join CRM_LISTA_ZASOBOW z on(z.PARENT_ID = zp.ID and z.`DESC` = t.fieldNamespace)
|
|
|
|
|
+ // set t.idZasob = z.ID
|
|
|
|
|
+ // where t.objectNamespace = '{$item['namespace']}'
|
|
|
|
|
+ // ");
|
|
|
|
|
+ }
|
|
|
public function updateCacheTableAcl($item) {
|
|
public function updateCacheTableAcl($item) {
|
|
|
// TODO: xsdType - convert mysql type to xsdType, xsdRestrictions
|
|
// TODO: xsdType - convert mysql type to xsdType, xsdRestrictions
|
|
|
$xsdInfo = [];
|
|
$xsdInfo = [];
|