|
|
@@ -14,6 +14,7 @@ Lib::loadClass('ACL');
|
|
|
*/
|
|
|
class Core_AclBase {
|
|
|
|
|
|
+ public $_zasobID = 0;
|
|
|
public $_rootTableName = null;
|
|
|
|
|
|
public function getNamespace() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
|
|
|
@@ -25,39 +26,7 @@ class Core_AclBase {
|
|
|
public function getSimpleSchema() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
|
|
|
// TODO: get more xsd restrictions like minOccurs, maxOccurs, nillable and restrictions
|
|
|
|
|
|
- public function getID() {
|
|
|
- throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501);
|
|
|
- if ('default_objects' == $this->getSourceName()) {// TODO: RMM - moved to Storage -> SystemObject->updateCache()
|
|
|
- $idZasobDatabase = DB::getPDO()->getZasobId();
|
|
|
- $namespace = $this->getNamespace();
|
|
|
- $sqlNamespace = DB::getPDO()->quote($namespace, PDO::PARAM_STR);
|
|
|
- $idZasob = DB::getPDO()->fetchValue("
|
|
|
- select z.ID
|
|
|
- from CRM_LISTA_ZASOBOW z
|
|
|
- where z.`TYPE` = 'TABELA'
|
|
|
- and z.`DESC` = {$sqlNamespace}
|
|
|
- and z.PARENT_ID = {$idZasobDatabase}
|
|
|
- and z.A_STATUS not in('DELETED')
|
|
|
- ");
|
|
|
- if ($idZasob) return $idZasob;
|
|
|
- $idZasob = DB::getPDO()->insert('CRM_LISTA_ZASOBOW', [
|
|
|
- 'PARENT_ID' => $idZasobDatabase,
|
|
|
- 'DESC' => $namespace,
|
|
|
- 'TYPE' => "TABELA",
|
|
|
- 'A_RECORD_CREATE_AUTHOR' => User::getLogin(),
|
|
|
- 'A_RECORD_CREATE_DATE' => "NOW()"
|
|
|
- ]);
|
|
|
- DB::getPDO()->insert('CRM_LISTA_ZASOBOW_HIST', [
|
|
|
- 'ID_USERS2' => $idZasob,
|
|
|
- 'PARENT_ID' => $idZasobDatabase,
|
|
|
- 'DESC' => $namespace,
|
|
|
- 'TYPE' => "TABELA",
|
|
|
- 'A_RECORD_CREATE_AUTHOR' => User::getLogin(),
|
|
|
- 'A_RECORD_CREATE_DATE' => "NOW()"
|
|
|
- ]);
|
|
|
- return $idZasob;
|
|
|
- }
|
|
|
- }
|
|
|
+ public function getID() { return $this->_zasobID; }
|
|
|
public function init($force = false) { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
|
|
|
public function isInitialized() { throw new HttpException("Acl function " . __FUNCTION__ . " Not implemented", 501); }
|
|
|
public function getFields() {// @returns array - $this->_fields // TODO: mved to getFieldListByIdZasob
|