|
@@ -10,9 +10,34 @@ Lib::loadClass('Api_WfsNs');
|
|
|
Lib::loadClass('Core_AclHelper');
|
|
Lib::loadClass('Core_AclHelper');
|
|
|
Lib::loadClass('Route_UrlAction');
|
|
Lib::loadClass('Route_UrlAction');
|
|
|
Lib::loadClass('Router');
|
|
Lib::loadClass('Router');
|
|
|
|
|
+Lib::loadClass('Typespecial');
|
|
|
|
|
+Lib::loadClass('UserProfile');
|
|
|
|
|
|
|
|
class Route_ViewTableAjax extends RouteBase {
|
|
class Route_ViewTableAjax extends RouteBase {
|
|
|
|
|
|
|
|
|
|
+ public function getTableAjaxWidget($acl) {
|
|
|
|
|
+ $syncUrl = Request::getPathUri() . 'index.php?_route=ViewTableAjax&namespace=' . $acl->getNamespace();
|
|
|
|
|
+ $tbl = new TableAjax($acl);
|
|
|
|
|
+ $tblLabel = $acl->getNamespace();
|
|
|
|
|
+ if ('default_db' == $acl->getSourceName()) {
|
|
|
|
|
+ $tblLabel = array();
|
|
|
|
|
+ $zasobObj = ProcesHelper::getZasobTableInfo($acl->getID());
|
|
|
|
|
+ if (!$zasobObj) throw new Exception("Zasob TABELA ID=" . $acl->getID() . " nie istnieje");
|
|
|
|
|
+ if (!empty($zasobObj->DESC_PL)) $tblLabel []= $zasobObj->DESC_PL;
|
|
|
|
|
+ if (!empty($zasobObj->OPIS)) $tblLabel []= $zasobObj->OPIS;
|
|
|
|
|
+ $tblLabel = implode(" - ", $tblLabel);
|
|
|
|
|
+ }
|
|
|
|
|
+ $tbl->setSyncUrl($syncUrl);
|
|
|
|
|
+ $tbl->setLabel($tblLabel);
|
|
|
|
|
+ $tbl->setFilterInit($filterInit);
|
|
|
|
|
+ $tbl->addRowFunction('edit');
|
|
|
|
|
+ $tbl->addRowFunction('hist');
|
|
|
|
|
+ $tbl->addRowFunction('files');
|
|
|
|
|
+ $tbl->addRowFunction('cp');
|
|
|
|
|
+ $tbl->addRowFunction('msgs');
|
|
|
|
|
+ return $tbl;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public function defaultAction() {
|
|
public function defaultAction() {
|
|
|
UI::gora();
|
|
UI::gora();
|
|
|
UI::menu();
|
|
UI::menu();
|
|
@@ -42,16 +67,9 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- $tbl = new TableAjax($acl);
|
|
|
|
|
- $tblLabel = $typeName;
|
|
|
|
|
- if ('default_db' == $acl->getSourceName()) {
|
|
|
|
|
- $tblLabel = array();
|
|
|
|
|
- $zasobObj = ProcesHelper::getZasobTableInfo($acl->getID());
|
|
|
|
|
- if (!$zasobObj) throw new Exception("Zasob TABELA ID=" . $acl->getID() . " nie istnieje");
|
|
|
|
|
- if (!empty($zasobObj->DESC_PL)) $tblLabel []= $zasobObj->DESC_PL;
|
|
|
|
|
- if (!empty($zasobObj->OPIS)) $tblLabel []= $zasobObj->OPIS;
|
|
|
|
|
- $tblLabel = implode(" - ", $tblLabel);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $tbl = $this->getTableAjaxWidget($acl);
|
|
|
|
|
+ if (!empty($forceFilterInit)) $tbl->setForceFilterInit($forceFilterInit);
|
|
|
|
|
+ echo $tbl->render();
|
|
|
|
|
|
|
|
if (DBG::isActive() && V::get('DBG_ACL', '', $_GET)) {// test load perms
|
|
if (DBG::isActive() && V::get('DBG_ACL', '', $_GET)) {// test load perms
|
|
|
Lib::loadClass('DebugExecutionTime');
|
|
Lib::loadClass('DebugExecutionTime');
|
|
@@ -103,17 +121,6 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
$dbgExecTime->printDebug();
|
|
$dbgExecTime->printDebug();
|
|
|
UI::endContainer();
|
|
UI::endContainer();
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- $tbl->setSyncUrl(Request::getPathUri() . 'index.php?_route=ViewTableAjax&namespace=' . $acl->getNamespace());
|
|
|
|
|
- $tbl->setLabel($tblLabel);
|
|
|
|
|
- $tbl->setFilterInit($filterInit);
|
|
|
|
|
- if (!empty($forceFilterInit)) $tbl->setForceFilterInit($forceFilterInit);
|
|
|
|
|
- $tbl->addRowFunction('edit');
|
|
|
|
|
- $tbl->addRowFunction('hist');
|
|
|
|
|
- $tbl->addRowFunction('files');
|
|
|
|
|
- $tbl->addRowFunction('cp');
|
|
|
|
|
- $tbl->addRowFunction('msgs');
|
|
|
|
|
- echo $tbl->render();
|
|
|
|
|
} catch (Exception $e) {
|
|
} catch (Exception $e) {
|
|
|
UI::startContainer();
|
|
UI::startContainer();
|
|
|
UI::alert('danger', "<strong>Wystąpiły błędy!</strong> " . $e->getMessage());
|
|
UI::alert('danger', "<strong>Wystąpiły błędy!</strong> " . $e->getMessage());
|
|
@@ -255,24 +262,7 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
$namespace = V::get('namespace', '', $args, 'word');
|
|
$namespace = V::get('namespace', '', $args, 'word');
|
|
|
if (!$namespace) throw new HttpException("Bad Request - missing namespace", 400);
|
|
if (!$namespace) throw new HttpException("Bad Request - missing namespace", 400);
|
|
|
$acl = Core_AclHelper::getAclByNamespace($namespace);
|
|
$acl = Core_AclHelper::getAclByNamespace($namespace);
|
|
|
- $tbl = new TableAjax($acl);
|
|
|
|
|
- $tblLabel = $typeName;
|
|
|
|
|
- if ('default_db' == $acl->getSourceName()) {
|
|
|
|
|
- $tblLabel = array();
|
|
|
|
|
- $zasobObj = ProcesHelper::getZasobTableInfo($acl->getID());
|
|
|
|
|
- if (!$zasobObj) throw new Exception("Zasob TABELA ID=" . $acl->getID() . " nie istnieje");
|
|
|
|
|
- if (!empty($zasobObj->DESC_PL)) $tblLabel []= $zasobObj->DESC_PL;
|
|
|
|
|
- if (!empty($zasobObj->OPIS)) $tblLabel []= $zasobObj->OPIS;
|
|
|
|
|
- $tblLabel = implode(" - ", $tblLabel);
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $tbl->setSyncUrl(Request::getPathUri() . 'index.php?_route=ViewTableAjax&namespace=' . $acl->getNamespace());
|
|
|
|
|
- $tbl->setLabel($tblLabel);
|
|
|
|
|
- $tbl->addRowFunction('edit');
|
|
|
|
|
- $tbl->addRowFunction('hist');
|
|
|
|
|
- $tbl->addRowFunction('files');
|
|
|
|
|
- $tbl->addRowFunction('cp');
|
|
|
|
|
- $tbl->addRowFunction('msgs');
|
|
|
|
|
|
|
+ $tbl = $this->getTableAjaxWidget($acl);
|
|
|
$tbl->sendAjaxEdit($id, $args);
|
|
$tbl->sendAjaxEdit($id, $args);
|
|
|
}
|
|
}
|
|
|
public function editSaveAjaxAction() {
|
|
public function editSaveAjaxAction() {
|
|
@@ -318,6 +308,14 @@ class Route_ViewTableAjax extends RouteBase {
|
|
|
return $response;
|
|
return $response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public function loadDataAjaxAction() {
|
|
|
|
|
+ $namespace = V::get('namespace', '', $_REQUEST, 'word');
|
|
|
|
|
+ if (!$namespace) throw new HttpException("Bad Request - missing namespace", 400);
|
|
|
|
|
+ $acl = Core_AclHelper::getAclByNamespace($namespace);
|
|
|
|
|
+ $tbl = $this->getTableAjaxWidget($acl);
|
|
|
|
|
+ Response::sendTryCatchJson(array($tbl, 'ajaxData'), $args = $_GET);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* @param string $typeName - 'p5_default_db:TEST_PERMS'
|
|
* @param string $typeName - 'p5_default_db:TEST_PERMS'
|
|
|
*/
|
|
*/
|