|
|
@@ -4,6 +4,7 @@
|
|
|
Lib::loadClass('RouteBase');
|
|
|
Lib::loadClass('Schema_TableFactory');
|
|
|
Lib::loadClass('Response');
|
|
|
+Lib::loadClass('UI');
|
|
|
|
|
|
/*
|
|
|
# Storage:
|
|
|
@@ -23,8 +24,9 @@ class Route_Storage extends RouteBase {
|
|
|
}
|
|
|
|
|
|
public function defaultAction() {
|
|
|
- SE_Layout::gora();
|
|
|
- SE_Layout::menu();
|
|
|
+ UI::gora();
|
|
|
+ UI::menu();
|
|
|
+ $this->navView();
|
|
|
try {
|
|
|
$storageList = $this->getStorageList();
|
|
|
if (empty($storageList)) throw new Exception("No storage defined");
|
|
|
@@ -40,25 +42,128 @@ class Route_Storage extends RouteBase {
|
|
|
$menuItem['xsd'] = '<a href="index.php?_route=Storage&_task=xsd&idStorage=' . $id . '" target="_blank">' . "xsd" . '</a>';
|
|
|
$storageMenu[] = $menuItem;
|
|
|
}
|
|
|
- $this->navView();
|
|
|
+ {// core object list
|
|
|
+ $menuItem = array();
|
|
|
+ //$menuItem['id'] = 'Obiekty';
|
|
|
+ $menuItem['nazwa'] = 'Obiekty podstawowe';
|
|
|
+ $menuItem['typ'] = 'OBJECTS';
|
|
|
+ $menuItem['tabele i widoki'] = '<a href="index.php?_route=Storage&_task=coreObjectList">' . "obiekty" . '</a>';
|
|
|
+ //$menuItem['views'] = '<a href="index.php?_route=Storage&_task=viewList&idStorage=' . $id . '">' . "views" . '</a>';
|
|
|
+ //$menuItem['raw info'] = '<a href="index.php?_route=Storage&_task=objectRawInfo">' . "raw info" . '</a>';
|
|
|
+ // TODO: $menuItem['xsd'] = '<a href="index.php?_route=Storage&_task=xsd&idStorage=' . $id . '" target="_blank">' . "xsd" . '</a>';
|
|
|
+ $storageMenu[] = $menuItem;
|
|
|
+ }
|
|
|
+ {// object list - for current company
|
|
|
+ $hostName = $_SERVER['SERVER_NAME'];
|
|
|
+ $cleanHostName = str_replace(array(".", "-"), '_', $hostName);
|
|
|
+ $menuItem = array();
|
|
|
+ //$menuItem['id'] = 'Obiekty';
|
|
|
+ $menuItem['nazwa'] = "Obiekty dla domeny '{$cleanHostName}'";
|
|
|
+ $menuItem['typ'] = 'OBJECTS';
|
|
|
+ $menuItem['tabele i widoki'] = '<a href="index.php?_route=Storage&_task=objectList">' . "obiekty" . '</a>';
|
|
|
+ //$menuItem['views'] = '<a href="index.php?_route=Storage&_task=viewList&idStorage=' . $id . '">' . "views" . '</a>';
|
|
|
+ //$menuItem['raw info'] = '<a href="index.php?_route=Storage&_task=objectRawInfo">' . "raw info" . '</a>';
|
|
|
+ // TODO: $menuItem['xsd'] = '<a href="index.php?_route=Storage&_task=xsd&idStorage=' . $id . '" target="_blank">' . "xsd" . '</a>';
|
|
|
+ $storageMenu[] = $menuItem;
|
|
|
+ }
|
|
|
DBG::table("storageMenu", $storageMenu, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
} catch (Exception $e) {
|
|
|
- SE_Layout::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ }
|
|
|
+ UI::dol();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function getCoreObjectFromFile($objectName) {
|
|
|
+ if ('default_db/' === substr($objectName, 0, 11)) {
|
|
|
+ return array('name' => substr($objectName, 11));
|
|
|
+ }
|
|
|
+
|
|
|
+ $filePath = APP_PATH_SCHEMA . "/gui/core/{$objectName}.json";
|
|
|
+ if (!file_exists($filePath)) throw new Exception("File not exists", 404);
|
|
|
+
|
|
|
+ $json = file_get_contents($filePath);
|
|
|
+ DBG::_('DBG', '>1', "{$objectName} filePath", $filePath, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ DBG::_('DBG', '>1', "{$objectName} file content", $json, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ $json = @json_decode($json, $assoc = true);
|
|
|
+ DBG::_('DBG', '>1', "{$objectName} json_last_error()", json_last_error(), __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ if (null == $json && 0 !== json_last_error()) throw new Exception("Parse json error for object '{$objectName}': " . json_last_error());
|
|
|
+ $jsonParent = array();
|
|
|
+ $parent = (is_array($json['parent_object']))? end($json['parent_object']) : $json['parent_object'];
|
|
|
+ $jsonParent = $this->getCoreObjectFromFile($parent);
|
|
|
+ return array_merge_recursive($jsonParent, $json);
|
|
|
+ }
|
|
|
+
|
|
|
+ public function coreObjectStructAction() {
|
|
|
+ UI::gora();
|
|
|
+ UI::menu();
|
|
|
+ $this->navView();
|
|
|
+ try {
|
|
|
+
|
|
|
+ $object = V::get('object', '', $_REQUEST, 'word');
|
|
|
+ if (empty($object)) throw new Exception("Missing Object name");
|
|
|
+ $json = $this->getCoreObjectFromFile($object);
|
|
|
+ DBG::_(true, true, "json", $json, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+
|
|
|
+
|
|
|
+ } catch (Exception $e) {
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
}
|
|
|
- SE_Layout::dol();
|
|
|
+ UI::dol();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function coreObjectListAction() {
|
|
|
+ UI::gora();
|
|
|
+ UI::menu();
|
|
|
+ $this->navView();
|
|
|
+ try {
|
|
|
+ $files = glob(APP_PATH_SCHEMA . "/gui/core/*.json", GLOB_NOSORT);
|
|
|
+ //DBG::_(true, true, "files", $files);
|
|
|
+ $objectList = array();
|
|
|
+ foreach ($files as $filePath) {
|
|
|
+ $objItem = array();
|
|
|
+ $fileName = basename($filePath);
|
|
|
+ $objName = substr($fileName, 0, -5);// remove ext '.json'
|
|
|
+ $objItem['name'] = $objName;
|
|
|
+ $objItem['file_name'] = $fileName;
|
|
|
+ $objItem['label'] = "";// TODO: read from json
|
|
|
+ $objItem['struktura'] = '<a href="index.php?_route=Storage&_task=coreObjectStruct&object=' . $objName . '">' . "struct" . '</a>';
|
|
|
+ $objectList[] = $objItem;
|
|
|
+ }
|
|
|
+ usort($objectList, function($rowA, $rowB) {
|
|
|
+ $a = $rowA['nazwa']; $b = $rowB['nazwa'];
|
|
|
+ if ($a == $b) return 0;
|
|
|
+ return ($a < $b) ? -1 : 1;
|
|
|
+ });
|
|
|
+
|
|
|
+ DBG::table("objectList", $objectList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
+ } catch (Exception $e) {
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ }
|
|
|
+ UI::dol();
|
|
|
+ }
|
|
|
+
|
|
|
+ public function objectListAction() {
|
|
|
+ UI::gora();
|
|
|
+ UI::menu();
|
|
|
+ try {
|
|
|
+
|
|
|
+ } catch (Exception $e) {
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ }
|
|
|
+ UI::dol();
|
|
|
}
|
|
|
|
|
|
public function tableListAction() {
|
|
|
- SE_Layout::gora();
|
|
|
- SE_Layout::menu();
|
|
|
+ UI::gora();
|
|
|
+ UI::menu();
|
|
|
+ $this->navView();
|
|
|
try {
|
|
|
$idStorage = V::get('idStorage', 0, $_REQUEST, 'int');
|
|
|
if (empty($idStorage)) throw new Exception("No id storage");
|
|
|
$storageList = $this->getStorageList();
|
|
|
if (empty($storageList)) throw new Exception("No storage defined");
|
|
|
- if (!array_key_exists($idStorage, $storageList)) throw new Exception("No id storage not exists");
|
|
|
+ if (!array_key_exists($idStorage, $storageList)) throw new Exception("Storage id='{$idStorage}' not exists");
|
|
|
|
|
|
- $this->navView();
|
|
|
$storagePdo = DB::getStorage($idStorage);
|
|
|
$viewRealList = $storagePdo->getViewList();
|
|
|
$tableRealList = $storagePdo->getTableList();
|
|
|
@@ -72,14 +177,13 @@ class Route_Storage extends RouteBase {
|
|
|
}
|
|
|
|
|
|
$emptyItem = array();
|
|
|
- $emptyItem['nazwa'] = '';//->urlTblStruct = $this->buildActionUrl('tableStruct', array('storageId'=>$storageId, 'tblName'=>$tblName));
|
|
|
+ $emptyItem['nazwa'] = '';
|
|
|
$emptyItem['type'] = '';
|
|
|
- $emptyItem['dodaj zasób'] = '';//->urlTblAddToZasoby = $this->buildAjaxActionUrl('addTableToZasoby', $urlParams);
|
|
|
- $emptyItem['struktura'] = '';//->urlTblRawStruct = $this->buildActionUrl('tableStructRaw', array('storageId'=>$storageId, 'tblName'=>$tblName));
|
|
|
- $emptyItem['objectTest'] = '';//->urlObjectTest = $this->buildActionUrl('objectTest', array('storageId'=>$storageId, 'tblName'=>$tblName));
|
|
|
- $emptyItem['xsd'] = '';//->urlTableXsd = $this->buildActionUrl('tableXsd', array('storageId'=>$storageId, 'tblName'=>$tblName, 'HEADER_NOT_INIT'=>'YES'));
|
|
|
- $emptyItem['id_zasob'] = '';//->zasobId = $zasobTableId;
|
|
|
- $emptyItem['isHist'] = '';//->isHistTable = ('_HIST' == substr($tblName, -5)) ? true : false;
|
|
|
+ $emptyItem['id_zasob'] = '';
|
|
|
+ $emptyItem['struktura'] = '';
|
|
|
+ $emptyItem['objectTest'] = '';
|
|
|
+ $emptyItem['xsd'] = '';
|
|
|
+ $emptyItem['isHist'] = '';
|
|
|
$emptyItem['uwagi'] = '';
|
|
|
|
|
|
$tableList = array();
|
|
|
@@ -100,8 +204,8 @@ class Route_Storage extends RouteBase {
|
|
|
} else {
|
|
|
$tblItem['uwagi'] .= 'TODO: ADD ZASOB';
|
|
|
$ajaxAddZasobLink = Request::getUriDirName() . "/index.php?_route=Storage&_task=addTableToZasoby&idStorage={$idStorage}&tblName={$tblName}";
|
|
|
- $onClick = "return p5UI__ButtonAjax(this, { href: '{$ajaxAddZasobLink}' })";
|
|
|
- $tblItem['dodaj zasób'] = '<a onclick="'.$onClick.'" class="btn btn-xs btn-primary" href="#">TODO: ADD ZASOB</a>';
|
|
|
+ $onClick = "return p5UI__ButtonAjax(this, 'p5UIBtnAjax:Storage:addToZasoby', { href: '{$ajaxAddZasobLink}' })";
|
|
|
+ $tblItem['id_zasob'] = '<a onclick="'.$onClick.'" class="btn btn-xs btn-primary" href="#">TODO: ADD ZASOB</a>';
|
|
|
}
|
|
|
$tableList[] = $tblItem;
|
|
|
}
|
|
|
@@ -118,7 +222,7 @@ class Route_Storage extends RouteBase {
|
|
|
$tblItem['id_zasob'] = $tblZasob['ID'];
|
|
|
} else {
|
|
|
$tblItem['uwagi'] .= 'TODO: ADD ZASOB';
|
|
|
- $tblItem['dodaj zasób'] = '<a href="#">TODO: ADD ZASOB</a>';
|
|
|
+ $tblItem['id_zasob'] = 'TODO: ADD ZASOB';
|
|
|
}
|
|
|
$tableList[] = $tblItem;
|
|
|
}
|
|
|
@@ -132,31 +236,40 @@ class Route_Storage extends RouteBase {
|
|
|
$tableList[] = $tblItem;
|
|
|
}
|
|
|
}
|
|
|
+ usort($tableList, function($rowA, $rowB) {
|
|
|
+ $a = $rowA['nazwa']; $b = $rowB['nazwa'];
|
|
|
+ if ($a == $b) return 0;
|
|
|
+ $a1 = substr($a, 0, 1); $b1 = substr($b, 0, 1);
|
|
|
+ if (('_' == $a1 || '_' == $b1) && $a1 != $b1) {
|
|
|
+ return ($a1 < $b1) ? 1 : -1;
|
|
|
+ }
|
|
|
+ return ($a < $b) ? -1 : 1;
|
|
|
+ });
|
|
|
DBG::table("tableList", $tableList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
?>
|
|
|
<script>
|
|
|
-jQuery(document).on('p5UI__ButtonAjax:click', function(e, n, payload) {
|
|
|
- console.log('event p5UI__ButtonAjax:click', n, payload);
|
|
|
+jQuery(document).on('p5UIBtnAjax:Storage:addToZasoby:click', function(e, n, payload) {
|
|
|
+ console.log('event p5UIBtnAjax:Storage:addToZasoby:click', n, payload);
|
|
|
});
|
|
|
-jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
- console.log('event p5UI__ButtonAjax:ajaxLoaded', n, payload);
|
|
|
+jQuery(document).on('p5UIBtnAjax:Storage:addToZasoby:ajaxLoaded', function(e, n, payload) {
|
|
|
+ console.log('event p5UIBtnAjax:Storage:addToZasoby:ajaxLoaded', n, payload);
|
|
|
if ('success' == payload.type && payload.body && payload.body.id > 0) {
|
|
|
- jQuery(n).parents('td').next('td').next('td').next('td').next('td').text(payload.body.id);
|
|
|
- jQuery(n).remove();
|
|
|
+ jQuery(n).parents('td').text(payload.body.id);
|
|
|
}
|
|
|
jQuery.notify(payload.msg, payload.type);
|
|
|
});
|
|
|
</script>
|
|
|
<?php
|
|
|
} catch (Exception $e) {
|
|
|
- SE_Layout::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
}
|
|
|
- SE_Layout::dol();
|
|
|
+ UI::dol();
|
|
|
}
|
|
|
|
|
|
public function rawInfoAction() {
|
|
|
- SE_Layout::gora();
|
|
|
- SE_Layout::menu();
|
|
|
+ UI::gora();
|
|
|
+ UI::menu();
|
|
|
+ $this->navView();
|
|
|
try {
|
|
|
$idStorage = V::get('idStorage', 0, $_REQUEST, 'int');
|
|
|
if (empty($idStorage)) throw new Exception("No id storage");
|
|
|
@@ -164,19 +277,19 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
if (empty($storageList)) throw new Exception("No storage defined");
|
|
|
if (!array_key_exists($idStorage, $storageList)) throw new Exception("No id storage not exists");
|
|
|
|
|
|
- $this->navView();
|
|
|
$storagePdo = DB::getStorage($idStorage);
|
|
|
$rawInfo = $storagePdo->getTableListWithInfo();
|
|
|
DBG::table("rawInfo", $rawInfo, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
} catch (Exception $e) {
|
|
|
- SE_Layout::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
}
|
|
|
- SE_Layout::dol();
|
|
|
+ UI::dol();
|
|
|
}
|
|
|
|
|
|
public function tableStructAction() {
|
|
|
- SE_Layout::gora();
|
|
|
- SE_Layout::menu();
|
|
|
+ UI::gora();
|
|
|
+ UI::menu();
|
|
|
+ $this->navView();
|
|
|
try {
|
|
|
$idStorage = V::get('idStorage', 0, $_REQUEST, 'int');
|
|
|
if (empty($idStorage)) throw new Exception("No id storage");
|
|
|
@@ -186,13 +299,12 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
$tblName = V::get('table', '', $_REQUEST, 'word');
|
|
|
if (empty($tblName)) throw new Exception("No table name");
|
|
|
|
|
|
- $this->navView();
|
|
|
$storagePdo = DB::getStorage($idStorage);
|
|
|
$tblStruct = $storagePdo->getTableStruct($tblName);
|
|
|
|
|
|
$idTable = $this->fetchTableId($idStorage, $tblName);
|
|
|
if ($idTable <= 0) {
|
|
|
- SE_Layout::alert('warning', "Zasob tabela '{$tblName}' nie istnieje");// TODO: add p5UI btn
|
|
|
+ UI::alert('warning', "Zasob tabela '{$tblName}' nie istnieje");// TODO: add p5UI btn
|
|
|
DBG::table("tblStruct", $tblStruct, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
throw new Exception("Zasob tabela '{$tblName}' nie istnieje");
|
|
|
}
|
|
|
@@ -208,7 +320,6 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
|
|
|
$emptyItem = array();
|
|
|
$emptyItem['name'] = '';
|
|
|
- $emptyItem['dodaj zasób'] = '';
|
|
|
$emptyItem['id_zasob'] = '';
|
|
|
$emptyItem['uwagi'] = '';
|
|
|
|
|
|
@@ -241,8 +352,8 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
} else {
|
|
|
$tblItem['uwagi'] .= '!Zasob';//'TODO: ADD ZASOB';
|
|
|
$ajaxAddZasobLink = Request::getUriDirName() . "/index.php?_route=Storage&_task=addCellToZasoby&idStorage={$idStorage}&tblName={$tblName}&cellName={$cellName}";
|
|
|
- $onClick = "return p5UI__ButtonAjax(this, { href: '{$ajaxAddZasobLink}' })";
|
|
|
- $tblItem['dodaj zasób'] = '<a onclick="'.$onClick.'" class="btn btn-xs btn-primary" href="#">TODO: ADD ZASOB</a>';
|
|
|
+ $onClick = "return p5UI__ButtonAjax(this, 'p5UIBtnAjax:Storage:addToZasoby', { href: '{$ajaxAddZasobLink}' })";
|
|
|
+ $tblItem['id_zasob'] = '<a onclick="'.$onClick.'" class="btn btn-xs btn-primary" href="#">TODO: ADD ZASOB</a>';
|
|
|
}
|
|
|
$tableList[] = $tblItem;
|
|
|
}
|
|
|
@@ -255,14 +366,25 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
$tableList[] = $tblItem;
|
|
|
}
|
|
|
}
|
|
|
+ usort($tableList, function($rowA, $rowB) {
|
|
|
+ $a = $rowA['name']; $b = $rowB['name'];
|
|
|
+ if ('ID' == $a) return -1;
|
|
|
+ if ('ID' == $b) return 1;
|
|
|
+ if ($a == $b) return 0;
|
|
|
+ $a1 = substr($a, 0, 1); $b1 = substr($b, 0, 1);
|
|
|
+ if (('_' == $a1 || '_' == $b1) && $a1 != $b1) {
|
|
|
+ return ($a1 < $b1) ? 1 : -1;
|
|
|
+ }
|
|
|
+ return ($a < $b) ? -1 : 1;
|
|
|
+ });
|
|
|
DBG::table("tableList", $tableList, __CLASS__, __FUNCTION__, __LINE__);
|
|
|
?>
|
|
|
<script>
|
|
|
-jQuery(document).on('p5UI__ButtonAjax:click', function(e, n, payload) {
|
|
|
- console.log('event p5UI__ButtonAjax:click', n, payload);
|
|
|
+jQuery(document).on('p5UIBtnAjax:Storage:addToZasoby:click', function(e, n, payload) {
|
|
|
+ console.log('event p5UIBtnAjax:Storage:addToZasoby:click', n, payload);
|
|
|
});
|
|
|
-jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
- console.log('event p5UI__ButtonAjax:ajaxLoaded', n, payload);
|
|
|
+jQuery(document).on('p5UIBtnAjax:Storage:addToZasoby:ajaxLoaded', function(e, n, payload) {
|
|
|
+ console.log('event p5UIBtnAjax:Storage:addToZasoby:ajaxLoaded', n, payload);
|
|
|
if ('success' == payload.type && payload.body && payload.body.id > 0) {
|
|
|
jQuery(n).parents('td').next('td').text(payload.body.id);
|
|
|
jQuery(n).remove();
|
|
|
@@ -274,9 +396,9 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
<?php
|
|
|
|
|
|
} catch (Exception $e) {
|
|
|
- SE_Layout::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
+ UI::alert('danger', "Error #" . $e->getCode() . "|" . $e->getLine() . ": " . $e->getMessage());
|
|
|
}
|
|
|
- SE_Layout::dol();
|
|
|
+ UI::dol();
|
|
|
}
|
|
|
|
|
|
public function xsdAction() {
|
|
|
@@ -516,6 +638,7 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
$backDisabled = false;
|
|
|
$idStorage = V::get('idStorage', 0, $_REQUEST, 'int');
|
|
|
$tblName = V::get('table', '', $_REQUEST, 'word');
|
|
|
+ $objName = V::get('object', '', $_REQUEST, 'word');
|
|
|
switch ($task) {
|
|
|
case 'tableList':
|
|
|
case 'viewList':
|
|
|
@@ -529,12 +652,21 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
$backLink = "index.php?_route=Storage&_task=tableList&idStorage={$idStorage}";
|
|
|
$currentLink = "index.php?_route=Storage&_task={$task}&idStorage={$idStorage}&table={$tblName}";
|
|
|
break;
|
|
|
+ case 'objectStruct': break;
|
|
|
+ case 'coreObjectStruct':
|
|
|
+ $backLabel = "Obiekty podstawowe";
|
|
|
+ $backLink = "index.php?_route=Storage&_task=coreObjectList";
|
|
|
+ $currentLink = "index.php?_route=Storage&_task={$task}&object={$objName}";
|
|
|
+ break;
|
|
|
}
|
|
|
switch ($task) {
|
|
|
case 'tableList': $currentLabel = "Tabele [{$idStorage}]"; break;
|
|
|
case 'viewList': $currentLabel = "Widoki [{$idStorage}]"; break;
|
|
|
case 'rawInfo': $currentLabel = "Raw info [{$idStorage}]"; break;
|
|
|
case 'tableStruct': $currentLabel = "Struktura tabeli '{$tblName}'"; break;
|
|
|
+ case 'coreObjectList': $currentLabel = "Obiekty podstawowe"; break;
|
|
|
+ case 'coreObjectStruct': $currentLabel = "Obiekt '{$objName}'"; break;
|
|
|
+ case 'objectList': $currentLabel = "Obiekty z aktualnej domeny"; break;// TODO: domain from $_GET
|
|
|
}
|
|
|
}
|
|
|
?>
|
|
|
@@ -589,6 +721,7 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
public function addTableToZasobyAction() {// sends JSON
|
|
|
$response = new stdClass();
|
|
|
try {
|
|
|
+ $response->id = 123; throw new AlertSuccessException("TEST: Utworzono pomyślnie rekord nr 123");
|
|
|
$idStorage = V::get('storageId', '', $_GET);
|
|
|
$tblName = V::get('tblName', '', $_GET, 'word');
|
|
|
if (empty($tblName)) throw new HttpException("Wrong table name");
|
|
|
@@ -661,6 +794,7 @@ jQuery(document).on('p5UI__ButtonAjax:ajaxLoaded', function(e, n, payload) {
|
|
|
public function addCellToZasobyAction() {// sends JSON
|
|
|
$response = new stdClass();
|
|
|
try {
|
|
|
+ $response->id = 123; throw new AlertSuccessException("TEST: Utworzono pomyślnie rekord nr 123");
|
|
|
$idStorage = V::get('storageId', '', $_GET);
|
|
|
$tblName = V::get('tblName', '', $_GET, 'word');
|
|
|
$cellName = V::get('cellName', '', $_GET, 'word');
|