diff --git a/ChangeLog b/ChangeLog index 618bd1898c..bae0e6ef6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ phpMyAdmin - ChangeLog ====================== 4.5.0.0 (not yet released) ++ rfe Pagination for GIS visualization 4.4.0.0 (not yet released) + rfe #1553 InnoDB presently supports one FULLTEXT index creation at a time diff --git a/js/tbl_chart.js b/js/tbl_chart.js index 49d5f1685c..67f1d7646d 100644 --- a/js/tbl_chart.js +++ b/js/tbl_chart.js @@ -395,11 +395,6 @@ AJAX.registerOnload('tbl_chart.js', function () { * */ $(document).on('submit', "#tblchartform", function (event) { - if (!checkFormElementInRange(this, 'session_max_rows', PMA_messages.strNotValidRowNumber, 1) || - !checkFormElementInRange(this, 'pos', PMA_messages.strNotValidRowNumber, 0 - 1) - ) { - return false; - } var $form = $(this); if (codemirror_editor) { diff --git a/libraries/Util.class.php b/libraries/Util.class.php index 5c233600e4..af573eb8e0 100644 --- a/libraries/Util.class.php +++ b/libraries/Util.class.php @@ -4581,6 +4581,47 @@ class PMA_Util return $html; } + + /** + * Function to get html for the start row and number of rows panel + * + * @param string $sql_query sql query + * + * @return string html + */ + public static function getStartAndNumberOfRowsPanel($sql_query) + { + $html = '
'; + + $pos = isset($_REQUEST['pos']) ? $_REQUEST['pos'] : $_SESSION['tmpval']['pos']; + $html .= '' + . ''; + + if (isset($_REQUEST['session_max_rows'])) { + $rows = $_REQUEST['session_max_rows']; + } else { + if ($_SESSION['tmpval']['max_rows'] != 'all') { + $rows = $_SESSION['tmpval']['max_rows']; + } else { + $rows = $GLOBALS['cfg']['MaxRows']; + } + } + $html .= '' + . ''; + + $html .= '' + . ''; + + $html .= '
'; + + return $html; + } } ?> diff --git a/libraries/tbl_chart.lib.php b/libraries/tbl_chart.lib.php index d6d49451db..8862b33859 100644 --- a/libraries/tbl_chart.lib.php +++ b/libraries/tbl_chart.lib.php @@ -271,38 +271,6 @@ function PMA_getHtmlForAlternativeDataFormat($keys, $fields_meta, $numeric_types return $htmlString; } -/** - * Function to get html for the start row and number of rows options - * - * @param string $sql_query sql query - * - * @return string - */ -function PMA_getHtmlForStartAndNumberOfRowsOptions($sql_query) -{ - $htmlString = '

 

' - . '
' - . '
' - . '' - . '' - . '' - . '' - . '' - . '' - . '
' - . '
'; - - return $htmlString; -} - /** * Function to get html for the chart area div * @@ -370,7 +338,7 @@ function PMA_getHtmlForTableChartDisplay($url_query, $url_params, $keys, $htmlString .= PMA_getHtmlForAlternativeDataFormat( $keys, $fields_meta, $numeric_types, $xaxis ); - $htmlString .= PMA_getHtmlForStartAndNumberOfRowsOptions($sql_query); + $htmlString .= PMA_Util::getStartAndNumberOfRowsPanel($sql_query); $htmlString .= PMA_getHtmlForChartAreaDiv(); diff --git a/libraries/tbl_gis_visualization.lib.php b/libraries/tbl_gis_visualization.lib.php index 4e1c9c96bc..c078ff2739 100644 --- a/libraries/tbl_gis_visualization.lib.php +++ b/libraries/tbl_gis_visualization.lib.php @@ -39,9 +39,20 @@ function PMA_GIS_modifyQuery($sql_query, $visualizationSettings) . PMA_Util::backquote($visualizationSettings['spatialColumn']) . ') AS ' . PMA_Util::backquote('srid') . ' '; + $pos = isset($_REQUEST['pos']) ? $_REQUEST['pos'] : $_SESSION['tmpval']['pos']; + if (isset($_REQUEST['session_max_rows'])) { + $rows = $_REQUEST['session_max_rows']; + } else { + if ($_SESSION['tmpval']['max_rows'] != 'all') { + $rows = $_SESSION['tmpval']['max_rows']; + } else { + $rows = $GLOBALS['cfg']['MaxRows']; + } + } // Append the original query as the inner query $modified_query .= 'FROM (' . $sql_query . ') AS ' - . PMA_Util::backquote('temp_gis'); + . PMA_Util::backquote('temp_gis') . ' LIMIT ' + . $pos . ', ' . $rows; return $modified_query; } @@ -222,14 +233,12 @@ function PMA_getHtmlForGisVisualization( ); $html .= ''; - $html .= ''; - $html .= ''; - if (! $GLOBALS['PMA_Config']->isHttps()) { $isSelected = isset($visualizationSettings['choice']) ? true : false; $html .= PMA_getHtmlForUseOpenStreetMaps($isSelected); } + $html .= PMA_Util::getStartAndNumberOfRowsPanel($sql_query); + $html .= ''; $html .= '
'; diff --git a/test/libraries/PMA_tbl_chart_test.php b/test/libraries/PMA_tbl_chart_test.php index ff511f03f1..043762d013 100644 --- a/test/libraries/PMA_tbl_chart_test.php +++ b/test/libraries/PMA_tbl_chart_test.php @@ -259,7 +259,7 @@ class PMA_TblChartTest extends PHPUnit_Framework_TestCase $html ); $this->assertContains( - PMA_getHtmlForStartAndNumberOfRowsOptions($sql_query), + PMA_Util::getStartAndNumberOfRowsPanel($sql_query), $html ); $this->assertContains(