From ad8ebb0fe79a9e55e6290fe0a21fbc11c5da4a17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Wed, 5 Sep 2012 10:45:45 +0200 Subject: [PATCH 1/4] Translated using Weblate. --- po/sl.po | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/po/sl.po b/po/sl.po index 801812f898..705ccce11c 100644 --- a/po/sl.po +++ b/po/sl.po @@ -4,16 +4,15 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.4-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-10-16 14:37+0200\n" -"PO-Revision-Date: 2012-09-05 10:45+0200\n" -"Last-Translator: Michal Čihař \n" -"Language-Team: Slovenian \n" +"PO-Revision-Date: 2012-10-27 11:05+0200\n" +"Last-Translator: Domen \n" +"Language-Team: Slovenian \n" "Language: sl\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" -"%100==4 ? 2 : 3);\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || " +"n%100==4 ? 2 : 3);\n" "X-Generator: Weblate 1.2\n" #: browse_foreigners.php:35 browse_foreigners.php:53 js/messages.php:353 @@ -8538,7 +8537,6 @@ msgstr "" "razcepiti nizov, kar lahko vodi v nepričakovane rezultate." #: main.php:292 -#, fuzzy #| msgid "" #| "Your PHP parameter [a@http://php.net/manual/en/session.configuration." #| "php#ini.session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] is lower " @@ -8550,10 +8548,11 @@ msgid "" "cookie validity configured in phpMyAdmin, because of this, your login will " "expire sooner than configured in phpMyAdmin." msgstr "" -"Vaš parameter PHP[a@http://php.net/manual/en/session.configuration.php#ini." -"session.gc-maxlifetime@_blank]session.gc_maxlifetime[/a] je nižji od " -"veljavnosti piškotkov, določene v phpMyAdminu. Zaradi tega se bo vaša " -"prijava iztekla prej, kot je določeno v phpMyAdminu." +"Vaš parameter PHP " +"[a@http://php.net/manual/en/session.configuration.php#ini.session.gc-" +"maxlifetime@_blank]session.gc_maxlifetime[/a] je nižji od veljavnosti " +"piškotkov, določene v phpMyAdminu. Zaradi tega se bo vaša prijava iztekla " +"prej, kot je določeno v phpMyAdminu." #: main.php:299 msgid "" From c39d7b122766ac09c79712b2242ad099bc77a8a7 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Sun, 28 Oct 2012 02:42:04 +0530 Subject: [PATCH 2/4] Fix bug #3571970 - Display chart and number of rows to plot --- ChangeLog | 1 + js/tbl_chart.js | 79 ++++++++++++++++++++++++++++++++++++++----------- tbl_chart.php | 63 ++++++++++++++++++++++++++++----------- 3 files changed, 108 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index a2312adc6d..ffc1f797ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,7 @@ phpMyAdmin - ChangeLog - bug #3576322 [search] Invalid select query generated for tables with ENUM fields - bug #3577468 [display] Incorrect imagejpeg Syntax Breaks Image Transformation - bug #3578776 [search] Editing SQL not possible when no records found +- bug #3571970 [interface] Display chart and number of rows to plot 3.5.3.0 (2012-10-08) - bug #3539044 [interface] Browse mode "Show" button gives blank page if no results anymore diff --git a/js/tbl_chart.js b/js/tbl_chart.js index ce7a4c633c..6e395e72c1 100644 --- a/js/tbl_chart.js +++ b/js/tbl_chart.js @@ -4,10 +4,13 @@ var chart_xaxis_idx = -1; var chart_series; var chart_series_index = -1; var temp_chart_title; +var currentChart = null; +var chart_data = null; +var nonJqplotSettings = null; +var currentSettings = null; + $(document).ready(function() { - var currentChart = null; - var chart_data = jQuery.parseJSON($('#querychart').html()); chart_series = 'columns'; chart_xaxis_idx = $('select[name="chartXAxis"]').attr('value'); @@ -24,15 +27,15 @@ $(document).ready(function() { currentChart.replot( {resetAxes: true}) }); - var nonJqplotSettings = { + nonJqplotSettings = { chart: { type: 'line', width: $('#resizer').width() - 20, height: $('#resizer').height() - 20 } - } + }; - var currentSettings = { + currentSettings = { grid: { drawBorder: false, shadow: false, @@ -57,7 +60,7 @@ $(document).ready(function() { placement: 'outsideGrid', location: 'se' } - } + }; $('#querychart').html(''); @@ -118,20 +121,62 @@ $(document).ready(function() { drawChart(); }); - function drawChart() { - nonJqplotSettings.chart.width = $('#resizer').width() - 20; - nonJqplotSettings.chart.height = $('#resizer').height() - 20; +}); - // todo: a better way using .replot() ? - if (currentChart != null) { - currentChart.destroy(); - } - currentChart = PMA_queryChart(chart_data, currentSettings, nonJqplotSettings); +/** + * Ajax Event handler for 'Go' button click + * + */ +$("#tblchartform").live('submit', function(event) { + + if(!checkFormElementInRange(this, 'session_max_rows', PMA_messages['strNotValidRowNumber'], 1) + || !checkFormElementInRange(this, 'pos', PMA_messages['strNotValidRowNumber'], 0-1)) { + return false; } - drawChart(); - $('#querychart').show(); -}); + var $form = $(this); + if (! checkSqlQuery($form[0])) { + return false; + } + + // remove any div containing a previous error message + $('.error').remove(); + + var $msgbox = PMA_ajaxShowMessage(); + + PMA_prepareForAjaxRequest($form); + + $.post($form.attr('action'), $form.serialize() , function(data) { + if (data.success == true) { + $('.success').fadeOut(); + + if (typeof data.chartData != 'undefined') { + chart_data = jQuery.parseJSON(data.chartData); + drawChart(); + $('#querychart').show(); + } + } else { + PMA_ajaxRemoveMessage($msgbox); + PMA_ajaxShowMessage(data.error, false); + chart_data = null; + drawChart(); + } + PMA_ajaxRemoveMessage($msgbox); + }, "json"); // end $.post() + + return false; +}); // end + +function drawChart() { + nonJqplotSettings.chart.width = $('#resizer').width() - 20; + nonJqplotSettings.chart.height = $('#resizer').height() - 20; + + // todo: a better way using .replot() ? + if (currentChart != null) { + currentChart.destroy(); + } + currentChart = PMA_queryChart(chart_data, currentSettings, nonJqplotSettings); +} function in_array(element,array) { diff --git a/tbl_chart.php b/tbl_chart.php index c3c9210d70..af1dd08a73 100644 --- a/tbl_chart.php +++ b/tbl_chart.php @@ -18,6 +18,43 @@ if (! defined('PMA_NO_VARIABLES_IMPORT')) { * */ require_once './libraries/common.inc.php'; +require_once './libraries/common.lib.php'; + +/* + * Execute the query and return the result + */ +if(isset($_REQUEST['ajax_request']) && isset($_REQUEST['pos']) && isset($_REQUEST['session_max_rows'])) { + + if (strlen($GLOBALS['table']) && strlen($GLOBALS['db'])) { + include './libraries/tbl_common.php'; + } + else { + PMA_ajaxResponse(__('Error'), false); + } + + $sql_limit_to_append = ' LIMIT ' . $_REQUEST['pos'] . ', ' . $_REQUEST['session_max_rows'] . " "; + $sql_query .= $sql_limit_to_append; + + $data = array(); + $result = PMA_DBI_try_query($sql_query); + while ($row = PMA_DBI_fetch_assoc($result)) { + $data[] = $row; + } + if(empty($data)) + PMA_ajaxResponse(__('Error'), false); + + $sanitized_data = array(); + foreach ($data as $data_row_number => $data_row) { + $tmp_row = array(); + foreach ($data_row as $data_column => $data_value) { + $tmp_row[htmlspecialchars($data_column)] = htmlspecialchars($data_value); + } + $sanitized_data[] = $tmp_row; + } + $extra_data['chartData'] = json_encode($sanitized_data); + unset($sanitized_data); + PMA_ajaxResponse(null, true, $extra_data); +} $GLOBALS['js_include'][] = 'tbl_chart.js'; $GLOBALS['js_include'][] = 'jqplot/jquery.jqplot.js'; @@ -56,11 +93,7 @@ if (strlen($GLOBALS['table'])) { include './libraries/server_links.inc.php'; } -/* - * Execute the query and return the result - */ $data = array(); - $result = PMA_DBI_try_query($sql_query); while ($row = PMA_DBI_fetch_assoc($result)) { $data[] = $row; @@ -86,7 +119,7 @@ url_query = '';
-
+
@@ -146,23 +179,17 @@ url_query = '';
- +
+ +
+ +
+ +

 

- $data_row) { - $tmp_row = array(); - foreach ($data_row as $data_column => $data_value) { - $tmp_row[htmlspecialchars($data_column)] = htmlspecialchars($data_value); - } - $sanitized_data[] = $tmp_row; -} -echo json_encode($sanitized_data); -unset($sanitized_data); -?>
From cc5ac635c8743ecd6b8b50c86ff8e8547cc56bdb Mon Sep 17 00:00:00 2001 From: Mathias Nervik Date: Sat, 27 Oct 2012 08:40:55 +0200 Subject: [PATCH 3/4] Translated using Weblate. --- po/nb.po | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/po/nb.po b/po/nb.po index 58d6b7262b..b7ef6316bb 100644 --- a/po/nb.po +++ b/po/nb.po @@ -4,8 +4,8 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.4-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-10-16 14:37+0200\n" -"PO-Revision-Date: 2012-10-19 10:46+0200\n" -"Last-Translator: Thor Andre Gretland \n" +"PO-Revision-Date: 2012-10-27 08:40+0200\n" +"Last-Translator: Mathias Nervik \n" "Language-Team: Norwegian Bokmål " "\n" "Language: nb\n" @@ -1888,10 +1888,9 @@ msgid "Show search criteria" msgstr "Vis søkekriterier" #: js/messages.php:298 libraries/tbl_select.lib.php:110 -#, fuzzy #| msgid "Search" msgid "Zoom Search" -msgstr "Søk" +msgstr "Utvidet søk" #: js/messages.php:300 msgid "Each point represents a data row." @@ -4767,7 +4766,6 @@ msgid "Connect without password" msgstr "Koble til uten passord" #: libraries/config/messages.inc.php:406 -#, fuzzy #| msgid "" #| "n use MySQL wildcard characters (% and _), escape them if you want use ir " #| "literal instances, i.e. use 'my\\_db' and not 'my_db'" @@ -4778,8 +4776,11 @@ msgid "" "their names in order and use [kbd]*[/kbd] at the end to show the rest in " "alphabetical order." msgstr "" -"Du kan bruke MySQL jokertegn (% and _), escape dem hvis du ønsker å bruke " -"dem direkte, f.eks. bruk 'my\\_db' og ikke 'my_db'" +"Du kan sortere listen ved å legge inn navnene på databasene i rekkefølge, og " +"bruke [kbd]*[/kbd] til slutt for å vise resten i alfabetisk rekkefølge.\n" +"Merk: Du kan bruke MySQL jokertegn (% og _). Du må escape dem hvis du ønsker " +"å bruke dem som vanlige karakterer, f.eks. bruk 'my\\_db' og ikke 'my_db' " +"for å vise et understrek tegn. " #: libraries/config/messages.inc.php:407 msgid "Show only listed databases" From a66a56a8d9622f24053e3d6827aa8f52cb495dc5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michal=20=C4=8Ciha=C5=99?= Date: Thu, 25 Oct 2012 15:44:51 +0200 Subject: [PATCH 4/4] Translated using Weblate. --- po/pl.po | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/po/pl.po b/po/pl.po index d0f7e4e712..a91f2202e4 100644 --- a/po/pl.po +++ b/po/pl.po @@ -4,7 +4,7 @@ msgstr "" "Project-Id-Version: phpMyAdmin 3.5.4-dev\n" "Report-Msgid-Bugs-To: phpmyadmin-devel@lists.sourceforge.net\n" "POT-Creation-Date: 2012-10-16 14:37+0200\n" -"PO-Revision-Date: 2012-09-05 10:58+0200\n" +"PO-Revision-Date: 2012-10-25 15:44+0200\n" "Last-Translator: Michal Čihař \n" "Language-Team: Polish \n" "Language: pl\n" @@ -3295,7 +3295,7 @@ msgid "" "authentication" msgstr "" "Tajne hasło używane do szyfrowania ciasteczek przy uwierzytelnianiu przez " -"ciasteczka" +"[kbd]ciasteczka[/kbd]" #: libraries/config/messages.inc.php:25 msgid "Blowfish secret"