|
@@ -551,26 +551,11 @@ class TableAjax extends ViewAjax {
|
|
|
|
|
|
|
|
public function ajaxTask($task) {
|
|
public function ajaxTask($task) {
|
|
|
switch ($task) {
|
|
switch ($task) {
|
|
|
- case 'EDIT_INLINE': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxInlineEdit', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'EDIT_INLINE_SAVE': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxEditInlineSave', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'COPY': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxCopy', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'CREATE_SAVE': { // TODO: mv to _route = ViewTableAjax & _task = createSaveAjax
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxCreateSave', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'HIST': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxHist', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ case 'EDIT_INLINE': return $this->sendAjaxResponseJson('ajax__EDIT_INLINE__Task', $_REQUEST);
|
|
|
|
|
+ case 'EDIT_INLINE_SAVE': return $this->sendAjaxResponseJson('ajax__EDIT_INLINE_SAVE__Task', $_REQUEST);
|
|
|
|
|
+ case 'COPY': return $this->sendAjaxResponseJson('ajax__CUPY__Task', $_REQUEST);
|
|
|
|
|
+ case 'CREATE_SAVE': return $this->sendAjaxResponseJson('ajax__CREATE_SAVE__Task', $_REQUEST); // TODO: mv to _route = ViewTableAjax & _task = createSaveAjax
|
|
|
|
|
+ case 'HIST': return $this->sendAjaxResponseJson('ajax__HIST__Task', $_REQUEST);
|
|
|
case 'FILES': {
|
|
case 'FILES': {
|
|
|
try {
|
|
try {
|
|
|
$id = V::get('ID', 0, $_REQUEST, 'int');
|
|
$id = V::get('ID', 0, $_REQUEST, 'int');
|
|
@@ -587,18 +572,9 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- case 'FILES_UPLOAD': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxFileUpload', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'FILES_LIST': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxFileList', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'filePermsRefresh': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxFilePermsRefresh', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ case 'FILES_UPLOAD': return $this->sendAjaxResponseJson('ajax__FILES_UPLOAD__Task', $_REQUEST);
|
|
|
|
|
+ case 'FILES_LIST': return $this->sendAjaxResponseJson('ajax__FILES_LIST__Task', $_REQUEST);
|
|
|
|
|
+ case 'filePermsRefresh': return $this->sendAjaxResponseJson('ajax__filePermsRefresh__Task', $_REQUEST);
|
|
|
case 'FILES_CONN_TBL_LIST': {
|
|
case 'FILES_CONN_TBL_LIST': {
|
|
|
$id = V::get('ID', 0, $_REQUEST, 'int');
|
|
$id = V::get('ID', 0, $_REQUEST, 'int');
|
|
|
if ($id > 0) {
|
|
if ($id > 0) {
|
|
@@ -617,20 +593,10 @@ class TableAjax extends ViewAjax {
|
|
|
}
|
|
}
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
- case 'HIDDEN_COLS_SAVE': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxHiddenColsSave', $_POST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'PAGE_SIZE_SAVE': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxPageSizeSave', $_POST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- case 'THE_GEOM_SAVE': {
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxTheGeomSave', $_REQUEST);
|
|
|
|
|
- break;
|
|
|
|
|
- }
|
|
|
|
|
- default:
|
|
|
|
|
- $this->sendAjaxResponseJson('ajaxData', $_REQUEST);
|
|
|
|
|
|
|
+ case 'HIDDEN_COLS_SAVE': return $this->sendAjaxResponseJson('ajax__HIDDEN_COLS_SAVE__Task', $_POST);
|
|
|
|
|
+ case 'PAGE_SIZE_SAVE': return $this->sendAjaxResponseJson('ajax__PAGE_SIZE_SAVE__Task', $_POST);
|
|
|
|
|
+ case 'THE_GEOM_SAVE': return $this->sendAjaxResponseJson('ajax__THE_GEOM_SAVE__Task', $_REQUEST);
|
|
|
|
|
+ default: return $this->sendAjaxResponseJson('ajaxData', $_REQUEST);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -639,7 +605,7 @@ class TableAjax extends ViewAjax {
|
|
|
* @param $rowID - $_GET['ID']
|
|
* @param $rowID - $_GET['ID']
|
|
|
* @param $fieldName - $_GET['col']
|
|
* @param $fieldName - $_GET['col']
|
|
|
*/
|
|
*/
|
|
|
- private function ajaxInlineEdit() {
|
|
|
|
|
|
|
+ private function ajax__EDIT_INLINE__Task() {
|
|
|
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
|
|
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
|
|
|
|
|
|
|
|
$args = $_REQUEST;
|
|
$args = $_REQUEST;
|
|
@@ -737,7 +703,7 @@ class TableAjax extends ViewAjax {
|
|
|
return $response;
|
|
return $response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function ajaxEditInlineSave($args) {
|
|
|
|
|
|
|
+ private function ajax__EDIT_INLINE_SAVE__Task($args) {
|
|
|
$primaryKeyField = $this->_acl->getPrimaryKeyField();
|
|
$primaryKeyField = $this->_acl->getPrimaryKeyField();
|
|
|
$primaryKey = V::get($primaryKeyField, 0, $args, 'int');
|
|
$primaryKey = V::get($primaryKeyField, 0, $args, 'int');
|
|
|
$fieldName = V::get('col', '', $_REQUEST);
|
|
$fieldName = V::get('col', '', $_REQUEST);
|
|
@@ -1217,8 +1183,7 @@ jQuery(document).ready(function(){
|
|
|
exit;
|
|
exit;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function ajaxCreateSave($args) {
|
|
|
|
|
- DBG::log($args, 'array', "ajaxCreateSave");
|
|
|
|
|
|
|
+ private function ajax__CREATE_SAVE__Task($args) {
|
|
|
$acl = $this->_acl;
|
|
$acl = $this->_acl;
|
|
|
$response = new stdClass();
|
|
$response = new stdClass();
|
|
|
$createdId = null;
|
|
$createdId = null;
|
|
@@ -1246,7 +1211,7 @@ jQuery(document).ready(function(){
|
|
|
return $response;
|
|
return $response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function ajaxCopy($args) {
|
|
|
|
|
|
|
+ private function ajax__CUPY__Task($args) {
|
|
|
$acl = $this->_acl;
|
|
$acl = $this->_acl;
|
|
|
$id = V::get('ID', 0, $_REQUEST, 'int');
|
|
$id = V::get('ID', 0, $_REQUEST, 'int');
|
|
|
if ($id <= 0) {
|
|
if ($id <= 0) {
|
|
@@ -1285,7 +1250,7 @@ jQuery(document).ready(function(){
|
|
|
return $response;
|
|
return $response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function ajaxHist($args) {
|
|
|
|
|
|
|
+ private function ajax__HIST__Task($args) {
|
|
|
$jsonResponse = array();
|
|
$jsonResponse = array();
|
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
|
$acl = $this->_acl;
|
|
$acl = $this->_acl;
|
|
@@ -1354,7 +1319,7 @@ jQuery(document).ready(function(){
|
|
|
return $jsonResponse;
|
|
return $jsonResponse;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function ajaxFileUpload($args) {
|
|
|
|
|
|
|
+ public function ajax__FILES_UPLOAD__Task($args) {
|
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
|
if ($id <= 0) throw new HttpException("404", 404);
|
|
if ($id <= 0) throw new HttpException("404", 404);
|
|
|
$dbID = $this->_acl->getDB();
|
|
$dbID = $this->_acl->getDB();
|
|
@@ -1402,7 +1367,7 @@ jQuery(document).ready(function(){
|
|
|
return $retJson;
|
|
return $retJson;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public function ajaxFileList($args) {
|
|
|
|
|
|
|
+ public function ajax__FILES_LIST__Task($args) {
|
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
|
if ($id <= 0) throw new HttpException("404", 404);
|
|
if ($id <= 0) throw new HttpException("404", 404);
|
|
|
$dbID = $this->_acl->getDB();
|
|
$dbID = $this->_acl->getDB();
|
|
@@ -1428,7 +1393,7 @@ jQuery(document).ready(function(){
|
|
|
return $jsonFiles;
|
|
return $jsonFiles;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function ajaxFilePermsRefresh($args) {
|
|
|
|
|
|
|
+ private function ajax__filePermsRefresh__Task($args) {
|
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
$id = V::get('ID', 0, $args, 'int');
|
|
|
if ($id <= 0) throw new HttpException("Wrong param ID", 404);
|
|
if ($id <= 0) throw new HttpException("Wrong param ID", 404);
|
|
|
|
|
|
|
@@ -2240,7 +2205,7 @@ jQuery(document).ready(function(){
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // @see ajaxHiddenColsSave
|
|
|
|
|
|
|
+ // @see ajax__HIDDEN_COLS_SAVE__Task
|
|
|
if (UserProfile::isHiddenColumn($acl->getID(), $fieldID)
|
|
if (UserProfile::isHiddenColumn($acl->getID(), $fieldID)
|
|
|
|| ($gui__hideRefFields && 'ref:' === substr($columnConfig->xsdType, 0, strlen('ref:')))
|
|
|| ($gui__hideRefFields && 'ref:' === substr($columnConfig->xsdType, 0, strlen('ref:')))
|
|
|
) {
|
|
) {
|
|
@@ -2457,7 +2422,7 @@ jQuery(document).ready(function(){
|
|
|
* set hidden cols in $_SESSION['USER_PROFILE'][$this->_zasobID];
|
|
* set hidden cols in $_SESSION['USER_PROFILE'][$this->_zasobID];
|
|
|
* $_SESSION['USER_PROFILE'][$this->_zasobID][fld_id] => boolean
|
|
* $_SESSION['USER_PROFILE'][$this->_zasobID][fld_id] => boolean
|
|
|
*/
|
|
*/
|
|
|
- private function ajaxHiddenColsSave($args) { // $args[ idField ] => 'SHOW' | 'HIDE'
|
|
|
|
|
|
|
+ private function ajax__HIDDEN_COLS_SAVE__Task($args) { // $args[ idField ] => 'SHOW' | 'HIDE'
|
|
|
$response = new stdClass();
|
|
$response = new stdClass();
|
|
|
|
|
|
|
|
if (empty($args)) {
|
|
if (empty($args)) {
|
|
@@ -2489,7 +2454,7 @@ jQuery(document).ready(function(){
|
|
|
return $response;
|
|
return $response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function ajaxPageSizeSave($args) {
|
|
|
|
|
|
|
+ private function ajax__PAGE_SIZE_SAVE__Task($args) {
|
|
|
$response = new stdClass();
|
|
$response = new stdClass();
|
|
|
|
|
|
|
|
if (empty($args)) {
|
|
if (empty($args)) {
|
|
@@ -2515,7 +2480,7 @@ jQuery(document).ready(function(){
|
|
|
return $response;
|
|
return $response;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- private function ajaxTheGeomSave($args) {
|
|
|
|
|
|
|
+ private function ajax__THE_GEOM_SAVE__Task($args) {
|
|
|
$primaryKeyField = $this->_acl->getPrimaryKeyField();
|
|
$primaryKeyField = $this->_acl->getPrimaryKeyField();
|
|
|
$primaryKey = V::get($primaryKeyField, 0, $args, 'int');
|
|
$primaryKey = V::get($primaryKeyField, 0, $args, 'int');
|
|
|
$polygon = V::get('polygon', 0, $args);
|
|
$polygon = V::get('polygon', 0, $args);
|