|
|
@@ -13,6 +13,7 @@ class TableAjax extends ViewAjax {
|
|
|
private $_cnf = '';// Column
|
|
|
private $_htmlID = '';
|
|
|
private $_rowFunctions = array();
|
|
|
+ private $_pageSize = 10;
|
|
|
private $_pageSizes = array();
|
|
|
private $_filterInit = null;
|
|
|
private $_forceFilterInit = null;
|
|
|
@@ -23,6 +24,12 @@ class TableAjax extends ViewAjax {
|
|
|
$this->_acl = $tblAcl;
|
|
|
$this->_zasobID = $tblAcl->getID();
|
|
|
|
|
|
+ $this->_pageSize = 10;
|
|
|
+ {
|
|
|
+ UserProfile::load();
|
|
|
+ $tableAjaxSettings = UserProfile::getTableAjaxSettings();
|
|
|
+ $this->_pageSize = V::get('pageSize', 10, $tableAjaxSettings, 'int');
|
|
|
+ }
|
|
|
$this->_pageSizes = array(10, 20, 50, 100);// default page sizes
|
|
|
$this->_filterInit = new stdClass();
|
|
|
|
|
|
@@ -2304,6 +2311,8 @@ class TableAjax extends ViewAjax {
|
|
|
publ.loadPage(1, priv.options.pageSize);
|
|
|
|
|
|
jQuery(_uiNodeCont).trigger('TableAjax:render', ['body', 'foot_pagination']);
|
|
|
+
|
|
|
+ priv.saveProfilePageSize(priv.options.pageSize);
|
|
|
};
|
|
|
|
|
|
/*
|
|
|
@@ -2324,6 +2333,29 @@ class TableAjax extends ViewAjax {
|
|
|
priv.sort();
|
|
|
};
|
|
|
|
|
|
+ priv.saveProfilePageSize = function(pageSize) {
|
|
|
+ var reqData = {};
|
|
|
+ reqData.pageSize = pageSize;
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ data: reqData,
|
|
|
+ type: "POST",
|
|
|
+ dataType: 'json',
|
|
|
+ // async: true,
|
|
|
+ url: 'index-ajax.php?_zasobID=<?php echo $this->_zasobID; ?>&_cls=<?php echo __CLASS__; ?>&_hash=<?php echo $this->_htmlID; ?>&_task=PAGE_SIZE_SAVE'
|
|
|
+ })
|
|
|
+ .done(function(data, textStatus, jqXHR){
|
|
|
+ if (data && data.type && data.type == 'info') {
|
|
|
+ jQuery.notify('Nie wprowadzono żadnych zmian', 'info');
|
|
|
+ } else {
|
|
|
+ jQuery.notify('Zapisano ustawienia', 'success');
|
|
|
+ }
|
|
|
+ })
|
|
|
+ .fail(function(){
|
|
|
+ jQuery.notify('Wystąpił błąd podczas zapisywania ustawień', 'error');
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
priv.saveHiddenCols = function() {
|
|
|
var reqData = {};
|
|
|
|
|
|
@@ -2720,6 +2752,7 @@ class TableAjax extends ViewAjax {
|
|
|
$filterInit = $this->_filterInit;
|
|
|
$forceFilterInit = $this->_forceFilterInit;
|
|
|
$pageSizes = $this->_pageSizes;
|
|
|
+ $pageSize = $this->_pageSize;
|
|
|
$rowFunctions = $this->_showRowFunctionsJson();
|
|
|
$exportFields = $this->_showExportFieldsJson();
|
|
|
?>
|
|
|
@@ -2735,6 +2768,7 @@ jQuery(document).ready(function(){
|
|
|
height: 400,
|
|
|
sorting: true,
|
|
|
paging: true,
|
|
|
+ pageSize: <?php echo $pageSize; ?>,
|
|
|
pageSizes: <?php echo json_encode($pageSizes); ?>,
|
|
|
tblFunctions: {
|
|
|
shortdesc: {
|
|
|
@@ -3365,6 +3399,10 @@ function <?php echo $jsToogleFiltrProcesuFunctionName; ?>(n) {
|
|
|
$this->sendAjaxResponseJson('ajaxHiddenColsSave', $_POST);
|
|
|
break;
|
|
|
}
|
|
|
+ case 'PAGE_SIZE_SAVE': {
|
|
|
+ $this->sendAjaxResponseJson('ajaxPageSizeSave', $_POST);
|
|
|
+ break;
|
|
|
+ }
|
|
|
case 'THE_GEOM_SAVE': {
|
|
|
$this->sendAjaxResponseJson('ajaxTheGeomSave', $_REQUEST);
|
|
|
break;
|
|
|
@@ -5202,7 +5240,7 @@ jQuery(document).ready(function(){
|
|
|
private function ajaxData($args) {
|
|
|
$DBG = ('1' == V::get('DBG', '', $_REQUEST));
|
|
|
|
|
|
- $pageSize = V::get('pageSize', 10, $args, 'int');
|
|
|
+ $pageSize = V::get('pageSize', $this->_pageSize, $args, 'int');
|
|
|
$page = V::get('page', 0, $args, 'int');
|
|
|
$currSortCol = V::get('currSortCol', '', $args);
|
|
|
$currSortFlip = V::get('currSortFlip', '', $args);
|
|
|
@@ -5427,10 +5465,7 @@ jQuery(document).ready(function(){
|
|
|
unset($_SESSION['USER_PROFILE']["{$this->_tbl}_COLUMN"]);
|
|
|
}
|
|
|
|
|
|
- $colVis = array();
|
|
|
- if (array_key_exists($this->_zasobID, $_SESSION['USER_PROFILE'])) {
|
|
|
- $colVis = $_SESSION['USER_PROFILE'][$this->_zasobID];
|
|
|
- }
|
|
|
+ $colVis = UserProfile::getHiddenCols($this->_zasobID);
|
|
|
|
|
|
$fields = $this->_acl->getFields();
|
|
|
foreach ($fields as $kFldId => $vFld) {
|
|
|
@@ -5451,6 +5486,32 @@ jQuery(document).ready(function(){
|
|
|
return $response;
|
|
|
}
|
|
|
|
|
|
+ private function ajaxPageSizeSave($args) {
|
|
|
+ $response = new stdClass();
|
|
|
+
|
|
|
+ if (empty($args)) {
|
|
|
+ $response->type = 'info';
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
+ $pageSize = V::get('pageSize', 0, $args, 'int');
|
|
|
+
|
|
|
+ UserProfile::load();
|
|
|
+
|
|
|
+ // clean up old, wrong values
|
|
|
+ if (array_key_exists("{$this->_tbl}_COLUMN", $_SESSION['USER_PROFILE'])) {
|
|
|
+ unset($_SESSION['USER_PROFILE']["{$this->_tbl}_COLUMN"]);
|
|
|
+ }
|
|
|
+
|
|
|
+ $tableAjaxSettings = UserProfile::getTableAjaxSettings();
|
|
|
+ $tableAjaxSettings['pageSize'] = $pageSize;
|
|
|
+
|
|
|
+ UserProfile::setTableAjaxSettings($tableAjaxSettings);
|
|
|
+ UserProfile::save();
|
|
|
+
|
|
|
+ $response->type = 'success';
|
|
|
+ return $response;
|
|
|
+ }
|
|
|
+
|
|
|
private function ajaxTheGeomSave($args) {
|
|
|
$primaryKeyField = $this->_acl->getPrimaryKeyField();
|
|
|
$primaryKey = V::get($primaryKeyField, 0, $args, 'int');
|