From d80fa9452eff45d6b6dda4cfa67cd5fb8fe658a5 Mon Sep 17 00:00:00 2001 From: Spun Nakandala Date: Mon, 22 Jul 2013 22:50:50 +0530 Subject: [PATCH 1/4] taken care by sql.js in client side --- js/sql.js | 4 +++- tbl_row_action.php | 12 ------------ 2 files changed, 3 insertions(+), 13 deletions(-) diff --git a/js/sql.js b/js/sql.js index e561ba5bf5..59a398814a 100644 --- a/js/sql.js +++ b/js/sql.js @@ -361,7 +361,9 @@ AJAX.registerOnload('sql.js', function () { /** * Ajax Event for table row change * */ - $("#resultsForm.ajax .mult_submit[value=edit]").live('click', function (event) { + $("#resultsForm.ajax .mult_submit[value=edit]," + + "#resultsForm.ajax .mult_submit[value=delete]," + + "#resultsForm.ajax .mult_submit[value=export]").live('click', function (event) { event.preventDefault(); /*Check whether atleast one row is selected for change*/ diff --git a/tbl_row_action.php b/tbl_row_action.php index b9ccaa4a3c..400f116e8c 100644 --- a/tbl_row_action.php +++ b/tbl_row_action.php @@ -12,18 +12,6 @@ require_once 'libraries/common.inc.php'; require_once 'libraries/mysql_charsets.inc.php'; -/** - * No rows were selected => show again the query and tell that user. - */ -if (! PMA_isValid($_REQUEST['rows_to_delete'], 'array') - && ! isset($_REQUEST['mult_btn']) -) { - $disp_message = __('No rows selected'); - $disp_query = ''; - include 'sql.php'; - exit; -} - if (isset($_REQUEST['submit_mult'])) { $submit_mult = $_REQUEST['submit_mult']; // workaround for IE problem: From 6a053b562796929fb77adba454d7b971d24f6d4c Mon Sep 17 00:00:00 2001 From: Spun Nakandala Date: Mon, 22 Jul 2013 22:52:57 +0530 Subject: [PATCH 2/4] replace include 'sql.php' with method calls to sql.lib.php --- tbl_row_action.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/tbl_row_action.php b/tbl_row_action.php index 400f116e8c..121f05a18b 100644 --- a/tbl_row_action.php +++ b/tbl_row_action.php @@ -11,6 +11,7 @@ */ require_once 'libraries/common.inc.php'; require_once 'libraries/mysql_charsets.inc.php'; +require_once 'libraries/sql.lib.php'; if (isset($_REQUEST['submit_mult'])) { $submit_mult = $_REQUEST['submit_mult']; @@ -124,8 +125,16 @@ if (!empty($submit_mult)) { unset($submit_mult, $_REQUEST['mult_btn']); $active_page = 'sql.php'; - include 'sql.php'; - break; + /** + * Parse and analyze the query + */ + require_once 'libraries/parse_analyze.inc.php'; + + PMA_executeQueryAndSendQueryResponse( + $analyzed_sql_results, false, $db, $table, null, null, null, false, null, + null, null, null, $goto, $pmaThemeImage, null, null, null, $sql_query, + null, null + ); } } ?> From 96836745c42f9040116c7f7f7ff5f777ad26ba96 Mon Sep 17 00:00:00 2001 From: Spun Nakandala Date: Tue, 23 Jul 2013 00:17:52 +0530 Subject: [PATCH 3/4] error coorected --- js/sql.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/js/sql.js b/js/sql.js index 59a398814a..81ad2cb638 100644 --- a/js/sql.js +++ b/js/sql.js @@ -361,9 +361,7 @@ AJAX.registerOnload('sql.js', function () { /** * Ajax Event for table row change * */ - $("#resultsForm.ajax .mult_submit[value=edit]," + - "#resultsForm.ajax .mult_submit[value=delete]," + - "#resultsForm.ajax .mult_submit[value=export]").live('click', function (event) { + $("#resultsForm.ajax .mult_submit[value=edit]").live('click', function (event) { event.preventDefault(); /*Check whether atleast one row is selected for change*/ @@ -428,6 +426,17 @@ AJAX.registerOnload('sql.js', function () { } }); + /** + * Checks whether atleast one row is selected for slected row editing and export + */ + $("#resultsForm.ajax .mult_submit[value=delete]," + + "#resultsForm.ajax .mult_submit[value=export]").live('click', function (event) { + /*Check whether atleast one row is selected for change*/ + if (!$("#table_results tbody tr, #table_results tbody tr td").hasClass("marked")) { + event.preventDefault(); + PMA_ajaxShowMessage(PMA_messages.strNoRowSelected); + } + }); /** * Click action for "Go" button in ajax dialog insertForm -> insertRowTable */ From a025fe1781cdeccfec79e5f83414748b6305b92a Mon Sep 17 00:00:00 2001 From: Spun Nakandala Date: Tue, 23 Jul 2013 00:26:02 +0530 Subject: [PATCH 4/4] typo corrected --- js/sql.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/sql.js b/js/sql.js index 81ad2cb638..a27c9c66b5 100644 --- a/js/sql.js +++ b/js/sql.js @@ -427,7 +427,7 @@ AJAX.registerOnload('sql.js', function () { }); /** - * Checks whether atleast one row is selected for slected row editing and export + * Checks whether atleast one row is selected for selcted row editing and export */ $("#resultsForm.ajax .mult_submit[value=delete]," + "#resultsForm.ajax .mult_submit[value=export]").live('click', function (event) {