|
|
@@ -2728,11 +2728,11 @@ function hidePopover() {
|
|
|
break;
|
|
|
}
|
|
|
case 'THE_GEOM_REMOVE': {
|
|
|
- $this->sendAjaxResponseJson('sendTheGeomRemove', $_REQUEST);
|
|
|
+ $this->sendAjaxResponseJson('ajaxTheGeomRemove', $_REQUEST);
|
|
|
break;
|
|
|
}
|
|
|
default:
|
|
|
- $this->sendAjaxData($_REQUEST);
|
|
|
+ $this->sendAjaxResponseJson('ajaxData', $_REQUEST);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -4444,13 +4444,9 @@ jQuery(document).ready(function(){
|
|
|
exit;
|
|
|
}
|
|
|
|
|
|
- private function sendAjaxData($args) {
|
|
|
+ private function ajaxData($args) {
|
|
|
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
|
|
|
|
|
|
- header("Content-type: application/json");
|
|
|
-
|
|
|
- //sleep(1);// TODO: TEST
|
|
|
-
|
|
|
$pageSize = V::get('pageSize', 10, $args, 'int');
|
|
|
$page = V::get('page', 0, $args, 'int');
|
|
|
$currSortCol = V::get('currSortCol', '', $args);
|
|
|
@@ -4532,38 +4528,38 @@ jQuery(document).ready(function(){
|
|
|
$ind = 0;
|
|
|
foreach ($visibleCols as $fieldID => $col) {
|
|
|
$ind++;
|
|
|
- $jsonData->cols->{$col} = (object)array('index'=>$ind);
|
|
|
+ $columnConfig = (object)array('index'=>$ind);
|
|
|
if ($col == 'ID') {
|
|
|
// /SE/se-dev/index.php?MENU_INIT=USERS2_MARKETING_EDIT&ARG1=EDIT&ARG1_VAL=31105
|
|
|
- $jsonData->cols->{$col}->format = '<a href="#EDIT/{0}">{0}</a>';
|
|
|
- $jsonData->cols->{$col}->unique = true;
|
|
|
+ $columnConfig->format = '<a href="#EDIT/{0}">{0}</a>';
|
|
|
+ $columnConfig->unique = true;
|
|
|
}
|
|
|
else if (in_array($col, array('A_STATUS','A_STATUS_CURRENT','A_SERVICES_STATUS_CURRENT'))) {
|
|
|
- $jsonData->cols->{$col}->format = '<div class="cell-A_STATUS-{0}">{0}</div>';
|
|
|
+ $columnConfig->format = '<div class="cell-A_STATUS-{0}">{0}</div>';
|
|
|
}
|
|
|
else if (in_array($col, array('Status'))) {
|
|
|
// Ahmes problems Status colors
|
|
|
- $jsonData->cols->{$col}->format = '<div class="cell-Status-{0}">{0}</div>';
|
|
|
+ $columnConfig->format = '<div class="cell-Status-{0}">{0}</div>';
|
|
|
}
|
|
|
else if ($this->_dataSource->isGeomField($col)) {
|
|
|
- $jsonData->cols->{$col}->type = 'geom';
|
|
|
+ $columnConfig->type = 'geom';
|
|
|
}
|
|
|
if ('' !== ($label = $this->_acl->getFieldLabel($fieldID))) {
|
|
|
- $jsonData->cols->{$col}->friendly = $label;
|
|
|
+ $columnConfig->friendly = $label;
|
|
|
}
|
|
|
$colType = $this->_acl->getFieldType($col);
|
|
|
if ($colType) {// @see MarkTableAjaxFilterColType
|
|
|
if ($colType['type'] == 'date') {
|
|
|
- //$jsonData->cols->{$col}->type = 'date';// TODO: require datepicker
|
|
|
+ //$columnConfig->type = 'date';// TODO: require datepicker
|
|
|
}
|
|
|
} else {// typespecial - no type
|
|
|
- $jsonData->cols->{$col}->type = 'special';
|
|
|
+ $columnConfig->type = 'special';
|
|
|
}
|
|
|
|
|
|
$typeSpecial = Typespecial::getInstance($fieldID, $col);
|
|
|
if ($typeSpecial) {
|
|
|
if($DBG){echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">typeSpecial (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($typeSpecial);echo'</pre>';}
|
|
|
- $jsonData->cols->{$col}->_tsRetId = $typeSpecial->getReturnId();
|
|
|
+ $columnConfig->_tsRetId = $typeSpecial->getReturnId();
|
|
|
}
|
|
|
|
|
|
// @see sendHiddenColsSave
|
|
|
@@ -4571,10 +4567,12 @@ jQuery(document).ready(function(){
|
|
|
if (isset($_SESSION['USER_PROFILE'][$this->_zasobID])) {
|
|
|
if (isset($_SESSION['USER_PROFILE'][$this->_zasobID][$fieldID])) {
|
|
|
if ($_SESSION['USER_PROFILE'][$this->_zasobID][$fieldID] != 1) {
|
|
|
- $jsonData->cols->{$col}->hidden = true;
|
|
|
+ $columnConfig->hidden = true;
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ $jsonData->cols->{$col} = $columnConfig;
|
|
|
}
|
|
|
$jsonData->rows = array();
|
|
|
foreach ($items as $vItem) {
|
|
|
@@ -4595,8 +4593,7 @@ jQuery(document).ready(function(){
|
|
|
}
|
|
|
//echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">this->_dataSource (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($this->_dataSource);echo'</pre>';
|
|
|
//echo'<pre style="max-height:200px;overflow:auto;border:1px solid red;text-align:left;">jsonData (F.' . __FUNCTION__ . ':' . __LINE__ . '): ';print_r($jsonData);echo'</pre>';
|
|
|
- echo json_encode($jsonData);
|
|
|
- exit;
|
|
|
+ return $jsonData;
|
|
|
}
|
|
|
|
|
|
private function fixEmptyValueFromUser($fieldID) {// TODO: moved to TableAcl->fixEmptyValueFromUser
|
|
|
@@ -4727,7 +4724,7 @@ jQuery(document).ready(function(){
|
|
|
|
|
|
private function sendAjaxResponseJson($method, $args) {
|
|
|
try {
|
|
|
- $response = $this->ajaxTheGeomRemove($args);
|
|
|
+ $response = $this->{$method}($args);
|
|
|
}
|
|
|
catch (Exception $e) {
|
|
|
$response = new stdClass();
|
|
|
@@ -4742,6 +4739,7 @@ jQuery(document).ready(function(){
|
|
|
case 4033: header('HTTP/1.0 403.3 - Write access forbidden'); break;
|
|
|
default:
|
|
|
}
|
|
|
+ header('Content-type: application/json');
|
|
|
echo json_encode($response);
|
|
|
exit;
|
|
|
}
|