From 045499bd7533da31f262c5e5de739e31d9f08985 Mon Sep 17 00:00:00 2001 From: Thilanka Kaushalya Date: Fri, 24 Jun 2011 14:54:46 +0530 Subject: [PATCH 1/9] Ajaxify the multi row export in table --- js/messages.php | 1 + js/sql.js | 96 ++++++++++++++++++++++++++++++++++++++++++++++++- sql.php | 1 + 3 files changed, 97 insertions(+), 1 deletion(-) diff --git a/js/messages.php b/js/messages.php index 6863532a27..063081e494 100644 --- a/js/messages.php +++ b/js/messages.php @@ -132,6 +132,7 @@ $js_messages['strSave'] = __('Save'); $js_messages['strHide'] = __('Hide'); $js_messages['strNoRowSelected'] = __('No rows selected'); $js_messages['strChangeTbl'] = __('Change'); +$js_messages['strExportTbl'] = __('Export'); /* For tbl_select.js */ $js_messages['strHideSearchCriteria'] = __('Hide search criteria'); diff --git a/js/sql.js b/js/sql.js index 080a2e4ab7..2b3662d8b2 100644 --- a/js/sql.js +++ b/js/sql.js @@ -1156,7 +1156,7 @@ rowsDeleteForm }) // end $.post() }) // end insert table button "Go" -/** +/**$("#buttonYes.ajax").live('click' * Click action for #buttonYes button in ajax dialog insertForm */ $("#buttonYes.ajax").live('click', function(event){ @@ -1210,6 +1210,100 @@ rowsDeleteForm }) // end $.post() }); + /** + * Ajax Event for table row export + * */ + $("#resultsForm.ajax .mult_submit[value=export]").live('click', function(event){ + event.preventDefault(); + + /*Check whether atleast one row is selected for export*/ + if($("#table_results tbody tr").hasClass("marked")){ + var div = $('
'); + + /** + * @var button_options Object that stores the options passed to jQueryUI + * dialog + */ + var button_options = {}; + // in the following function we need to use $(this) + button_options[PMA_messages['strCancel']] = function() {$(this).parent().dialog('close').remove();} + + var button_options_error = {}; + button_options_error[PMA_messages['strOK']] = function() {$(this).parent().dialog('close').remove();} + var $form = $("#resultsForm"); + var $msgbox = PMA_ajaxShowMessage(); + + $.get( $form.attr('action') , $form.serialize()+"&ajax_request=true&submit_mult=export" , function(data) { + //in the case of an error, show the error message returned. + if (data.success != undefined && data.success == false) { + div + .append(data.error) + .dialog({ + title: PMA_messages['strExportTbl'], + height: 230, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options_error + })// end dialog options + } else { + div + .append(data) + .dialog({ + title: PMA_messages['strExportTbl'], + height: 600, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options + }) + //Remove the top menu container from the dialog + .find("#topmenucontainer").hide() + ; // end dialog options + $("#quick_or_custom").show(); + toggle_quick_or_custom(); + $("form[name=dump]").addClass("ajax"); + $("#buttonGo").addClass("ajax"); + } + PMA_ajaxRemoveMessage($msgbox); + }) // end $.get() + } else { + PMA_ajaxShowMessage(PMA_messages['strNoRowSelected']); + } + }); + + $("#buttonGo.ajax").live('click', function(event) { + event.preventDefault(); + /** + * @var the_form object referring to the export form + */ + var $form = $("form[name=dump]"); + + PMA_prepareForAjaxRequest($form); + //User wants to submit the form + $.post($form.attr('action'), $form.serialize(), function(data) { + if (data.success == true) { + PMA_ajaxShowMessage(data.success); + } else { + PMA_ajaxShowMessage(data.error); + + } + if ($("#export_row_dialog").length > 0) { + $("#export_row_dialog").dialog("close").remove(); + } + /**Update the row count at the tableForm*/ + $("#result_query").remove(); + $("#sqlqueryresults").prepend(data.sql_query); + $("#result_query .notice").remove(); + $("#result_query").prepend((data.message)); + + $("#table_results tbody tr.marked .multi_checkbox " + + ", #table_results tbody tr td.marked .multi_checkbox").prop("checked", false); + $("#table_results tbody tr.marked .multi_checkbox " + + ", #table_results tbody tr td.marked .multi_checkbox").removeClass("last_clicked"); + $("#table_results tbody tr" + + ", #table_results tbody tr td").removeClass("marked"); + }) // end $.post() + }) // end insert table button "buttonGo" + }, 'top.frame_content') // end $(document).ready() diff --git a/sql.php b/sql.php index f4ea949228..1da251f390 100644 --- a/sql.php +++ b/sql.php @@ -16,6 +16,7 @@ require_once './libraries/bookmark.lib.php'; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'tbl_change.js'; +$GLOBALS['js_include'][] = 'export.js'; if(isset($_SESSION['profiling'])) { $GLOBALS['js_include'][] = 'highcharts/highcharts.js'; From bc049c6311f3c8e9357b1b7252754a7673ddaa29 Mon Sep 17 00:00:00 2001 From: Thilanka Kaushalya Date: Sat, 25 Jun 2011 16:57:54 +0530 Subject: [PATCH 2/9] Ajaxified the multi column change in table structure --- js/functions.js | 7 +++- js/tbl_structure.js | 98 ++++++++++++++++++++++++++++++++++++++++++++- tbl_alter.php | 3 +- tbl_structure.php | 16 ++++---- 4 files changed, 112 insertions(+), 12 deletions(-) diff --git a/js/functions.js b/js/functions.js index 436805c200..397f2484ca 100644 --- a/js/functions.js +++ b/js/functions.js @@ -2013,6 +2013,10 @@ $(document).ready(function() { * Hides certain table structure actions, replacing them with the word "More". They are displayed * in a dropdown menu when the user hovers over the word "More." */ + displayMoreTableOpts(); +}); + +function displayMoreTableOpts() { // Remove the actions from the table cells (they are available by default for JavaScript-disabled browsers) // if the table is not a view or information_schema (otherwise there is only one action to hide and there's no point) if($("input[type='hidden'][name='table_type']").val() == "table") { @@ -2081,8 +2085,7 @@ $(document).ready(function() { } }); } -}); - +} $(document).ready(initTooltips); /* Displays tooltips */ diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 352848cb65..20d9b4b356 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -145,5 +145,101 @@ $(document).ready(function() { }) // end $.get() }) // end $.PMA_confirm() }) //end Drop Primary Key/Index - + + /** + *Ajax event handler for muti column change + **/ + $("#fieldsForm.ajax .mult_submit[value=change]").live('click', function(event){ + event.preventDefault(); + + /*Check whether atleast one row is selected for change*/ + if($("#tablestructure tbody tr").hasClass("marked")){ + var div = $('
'); + + /** + * @var button_options Object that stores the options passed to jQueryUI + * dialog + */ + var button_options = {}; + // in the following function we need to use $(this) + button_options[PMA_messages['strCancel']] = function() {$(this).parent().dialog('close').remove();} + + var button_options_error = {}; + button_options_error[PMA_messages['strOK']] = function() {$(this).parent().dialog('close').remove();} + var $form = $("#fieldsForm"); + var $msgbox = PMA_ajaxShowMessage(); + + $.get( $form.attr('action') , $form.serialize()+"&ajax_request=true&submit_mult=change" , function(data) { + //in the case of an error, show the error message returned. + if (data.success != undefined && data.success == false) { + div + .append(data.error) + .dialog({ + title: PMA_messages['strChangeTbl'], + height: 230, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options_error + })// end dialog options + } else { + div + .append(data) + .dialog({ + title: PMA_messages['strChangeTbl'], + height: 600, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options + }) + //Remove the top menu container from the dialog + .find("#topmenucontainer").hide() + ; // end dialog options + $("#append_fields_form input[name=do_save_data]").addClass("ajax"); + } + PMA_ajaxRemoveMessage($msgbox); + }) // end $.get() + } else { + PMA_ajaxShowMessage(PMA_messages['strNoRowSelected']); + } + }); + + /** + *Ajax action for submiting the column change form + **/ + $("#append_fields_form input[name=do_save_data].ajax").live('click', function(event) { + event.preventDefault(); + /** + * @var the_form object referring to the export form + */ + var $form = $("#append_fields_form"); + + PMA_prepareForAjaxRequest($form); + //User wants to submit the form + $.post($form.attr('action'), $form.serialize()+"&do_save_data=Save", function(data) { + if (data.success == true) { + PMA_ajaxShowMessage(data.message); + } else { + PMA_ajaxShowMessage(data.error); + + } + if ($("#change_column_dialog").length > 0) { + $("#change_column_dialog").dialog("close").remove(); + } + $("#sqlqueryresults").remove(); + $("
").insertAfter("#topmenucontainer"); + $("#sqlqueryresults").html(data.sql_query); + $("#result_query .notice").remove(); + $("#result_query").prepend((data.message)); + + $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) { + $("#fieldsForm").remove(); + var temp_div = $("
").append(form_data); + $(temp_div).find("#fieldsForm").insertAfter("#sqlqueryresults"); + /*Call the fucntion to display the more options in table*/ + displayMoreTableOpts(); + }); + + }) // end $.post() + }) // end insert table button "do_save_data" + }) // end $(document).ready() diff --git a/tbl_alter.php b/tbl_alter.php index 1c2d7fbd80..743e92503b 100644 --- a/tbl_alter.php +++ b/tbl_alter.php @@ -131,7 +131,8 @@ if (isset($_REQUEST['do_save_data'])) { } if( $GLOBALS['is_ajax_request'] == true) { - PMA_ajaxResponse($message, $message->isSuccess()); + $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query); + PMA_ajaxResponse($message, $message->isSuccess(),$extra_data); } $active_page = 'tbl_structure.php'; diff --git a/tbl_structure.php b/tbl_structure.php index f3ce162aec..5406e9f9c0 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -185,16 +185,16 @@ $hidden_titles['NoIdxFulltext'] = PMA_getIcon('bd_ftext.png', __('Add FUL // table header $i = 0; ?> -
+> '; - } else if ($tbl_is_view) { - echo '"view" />'; - } else { - echo '"table" />'; - } ?> + if($db_is_information_schema) { + echo '"information_schema" />'; + } else if ($tbl_is_view) { + echo '"view" />'; + } else { + echo '"table" />'; + } ?> From 3345899ca2c0b537740f0480d7adbf9fbadee47d Mon Sep 17 00:00:00 2001 From: Thilanka Kaushalya Date: Sat, 25 Jun 2011 21:26:56 +0530 Subject: [PATCH 3/9] Fixed bugs in multi column change in table structure --- js/tbl_structure.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 20d9b4b356..34d6a6b6d0 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -216,25 +216,33 @@ $(document).ready(function() { PMA_prepareForAjaxRequest($form); //User wants to submit the form $.post($form.attr('action'), $form.serialize()+"&do_save_data=Save", function(data) { + if ($("#sqlqueryresults").length != 0) { + $("#sqlqueryresults").remove(); + } else if ($(".error").length != 0) { + $(".error").remove(); + } if (data.success == true) { PMA_ajaxShowMessage(data.message); + $("
").insertAfter("#topmenucontainer"); + $("#sqlqueryresults").html(data.sql_query); + $("#result_query .notice").remove(); + $("#result_query").prepend((data.message)); } else { - PMA_ajaxShowMessage(data.error); - + var temp_div = $("
").append(data); + $(temp_div).find(".error").insertAfter("#topmenucontainer"); } if ($("#change_column_dialog").length > 0) { $("#change_column_dialog").dialog("close").remove(); } - $("#sqlqueryresults").remove(); - $("
").insertAfter("#topmenucontainer"); - $("#sqlqueryresults").html(data.sql_query); - $("#result_query .notice").remove(); - $("#result_query").prepend((data.message)); $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) { $("#fieldsForm").remove(); var temp_div = $("
").append(form_data); - $(temp_div).find("#fieldsForm").insertAfter("#sqlqueryresults"); + if ($("#sqlqueryresults").length != 0) { + $(temp_div).find("#fieldsForm").insertAfter("#sqlqueryresults"); + } else { + $(temp_div).find("#fieldsForm").insertAfter(".error"); + } /*Call the fucntion to display the more options in table*/ displayMoreTableOpts(); }); From f48271b74b2d475bb158aa05322ce1ac59d303de Mon Sep 17 00:00:00 2001 From: Thilanka Kaushalya Date: Sun, 26 Jun 2011 23:28:34 +0530 Subject: [PATCH 4/9] Fixed bugs in show error message ine multi row change in table structure --- js/tbl_structure.js | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 34d6a6b6d0..c8363034de 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -227,26 +227,26 @@ $(document).ready(function() { $("#sqlqueryresults").html(data.sql_query); $("#result_query .notice").remove(); $("#result_query").prepend((data.message)); + if ($("#change_column_dialog").length > 0) { + $("#change_column_dialog").dialog("close").remove(); + } + /*Reload the field form*/ + $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) { + $("#fieldsForm").remove(); + var temp_div = $("
").append(form_data); + if ($("#sqlqueryresults").length != 0) { + $(temp_div).find("#fieldsForm").insertAfter("#sqlqueryresults"); + } else { + $(temp_div).find("#fieldsForm").insertAfter(".error"); + } + /*Call the fucntion to display the more options in table*/ + displayMoreTableOpts(); + }); } else { var temp_div = $("
").append(data); - $(temp_div).find(".error").insertAfter("#topmenucontainer"); + var error = $(temp_div).find(".error code").addClass("error"); + PMA_ajaxShowMessage(error); } - if ($("#change_column_dialog").length > 0) { - $("#change_column_dialog").dialog("close").remove(); - } - - $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) { - $("#fieldsForm").remove(); - var temp_div = $("
").append(form_data); - if ($("#sqlqueryresults").length != 0) { - $(temp_div).find("#fieldsForm").insertAfter("#sqlqueryresults"); - } else { - $(temp_div).find("#fieldsForm").insertAfter(".error"); - } - /*Call the fucntion to display the more options in table*/ - displayMoreTableOpts(); - }); - }) // end $.post() }) // end insert table button "do_save_data" From 0cb77d14bad36196664f953d62e247193e1eb30d Mon Sep 17 00:00:00 2001 From: Thilanka Kaushalya Date: Fri, 1 Jul 2011 23:39:23 +0530 Subject: [PATCH 5/9] Ajaxify Index edit in table structure --- js/tbl_structure.js | 115 ++++++++++++++++++++++++++++++++++++++ libraries/Index.class.php | 10 +++- tbl_indexes.php | 12 +++- tbl_structure.php | 2 +- 4 files changed, 132 insertions(+), 7 deletions(-) diff --git a/js/tbl_structure.js b/js/tbl_structure.js index c8363034de..411083627b 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -250,4 +250,119 @@ $(document).ready(function() { }) // end $.post() }) // end insert table button "do_save_data" + /** + *Ajax event handler for index edit + **/ + $("#table_index tbody tr td.edit_index.ajax").live('click', function(event){ + event.preventDefault(); + var url = $(this).find("a").attr("href"); + if (url.substring(0, 16) == "tbl_indexes.php?") { + url = url.substring(16, url.length ); + } + url = url + "&ajax_request=true"; + + var div = $('
'); + + /** + * @var button_options Object that stores the options passed to jQueryUI + * dialog + */ + var button_options = {}; + // in the following function we need to use $(this) + button_options[PMA_messages['strCancel']] = function() {$(this).parent().dialog('close').remove();} + + var button_options_error = {}; + button_options_error[PMA_messages['strOK']] = function() {$(this).parent().dialog('close').remove();} + var $msgbox = PMA_ajaxShowMessage(); + + $.get( "tbl_indexes.php" , url , function(data) { + //in the case of an error, show the error message returned. + if (data.success != undefined && data.success == false) { + div + .append(data.error) + .dialog({ + title: PMA_messages['strEdit'], + height: 230, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options_error + })// end dialog options + } else { + div + .append(data) + .dialog({ + title: PMA_messages['strEdit'], + height: 600, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options + }) + //Remove the top menu container from the dialog + .find("#topmenucontainer").hide() + ; // end dialog options + } + PMA_ajaxRemoveMessage($msgbox); + }) // end $.get() + }); + + /** + *Ajax action for submiting the index form + **/ + $("#index_frm.ajax input[name=do_save_data]").live('click', function(event) { + event.preventDefault(); + /** + * @var the_form object referring to the export form + */ + var $form = $("#index_frm"); + + PMA_prepareForAjaxRequest($form); + //User wants to submit the form + $.post($form.attr('action'), $form.serialize()+"&do_save_data=Save", function(data) { + if ($("#sqlqueryresults").length != 0) { + $("#sqlqueryresults").remove(); + } + if (data.success == true) { + PMA_ajaxShowMessage(data.message); + $("
").insertAfter("#topmenucontainer"); + $("#sqlqueryresults").html(data.sql_query); + $("#result_query .notice").remove(); + $("#result_query").prepend((data.message)); + + /*Reload the field form*/ + $("#table_index").remove(); + var temp_div = $("
").append(data.index_table); + $(temp_div).find("#table_index").insertAfter("#index_header"); + if ($("#edit_index_dialog").length > 0) { + $("#edit_index_dialog").dialog("close").remove(); + } + + } else { + var temp_div = $("
").append(data.error); + var error = $(temp_div).find(".error code").addClass("error"); + PMA_ajaxShowMessage(error); + } + + }) // end $.post() + }) // end insert table button "do_save_data" + + /** + *Ajax action for submiting the index form for add more columns + **/ + $("#index_frm.ajax input[name=add_fields]").live('click', function(event) { + event.preventDefault(); + /** + * @var the_form object referring to the export form + */ + var $form = $("#index_frm"); + + PMA_prepareForAjaxRequest($form); + //User wants to submit the form + $.post($form.attr('action'), $form.serialize()+"&add_fields=Go", function(data) { + $("#index_columns").remove(); + var temp_div = $("
").append(data); + $(temp_div).find("#index_columns").insertAfter("#index_frm fieldset .error"); + }) // end $.post() + }) // end insert table button "Go" + + }) // end $(document).ready() diff --git a/libraries/Index.class.php b/libraries/Index.class.php index fb5cafe994..a40cdc973f 100644 --- a/libraries/Index.class.php +++ b/libraries/Index.class.php @@ -432,10 +432,10 @@ class PMA_Index $r = ''; - $r .= '

' . __('Indexes') . ': '; + $r .= '

' . __('Indexes') . ': '; $r .= PMA_showMySQLDocu('optimization', 'optimizing-database-structure'); $r .= '

'; - $r .= '
'; + $r .= '
'; $r .= ''; $r .= ''; if (! $print_mode) { @@ -463,7 +463,11 @@ class PMA_Index if (! $print_mode) { $this_params = $GLOBALS['url_params']; $this_params['index'] = $index->getName(); - $r .= '' . "\n"; diff --git a/tbl_indexes.php b/tbl_indexes.php index e366047a21..995ee2431f 100644 --- a/tbl_indexes.php +++ b/tbl_indexes.php @@ -97,7 +97,13 @@ if (isset($_REQUEST['do_save_data'])) { PMA_DBI_query($sql_query); $message = PMA_Message::success(__('Table %1$s has been altered successfully')); $message->addParam($table); - + + if( $GLOBALS['is_ajax_request'] == true) { + $extra_data['index_table'] = PMA_Index::getView($table, $db); + $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query); + PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); + } + $active_page = 'tbl_structure.php'; require './tbl_structure.php'; exit; @@ -133,7 +139,7 @@ if (isset($_REQUEST['index']) && is_array($_REQUEST['index'])) { // end preparing form values ?> - onsubmit="if (typeof(this.elements['index'].disabled) != 'undefined') { this.elements['index'].disabled = false}"> must be the name of and only of a primary key!)'))->display(); ?> -
' + $r .= '' . ' ' . PMA_getIcon('b_edit.png', __('Edit')) . '' . '
+
diff --git a/tbl_structure.php b/tbl_structure.php index 5406e9f9c0..199fff11b3 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -14,7 +14,7 @@ require_once './libraries/mysql_charsets.lib.php'; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'tbl_structure.js'; - +$GLOBALS['js_include'][] = 'indexes.js'; /** * handle multiple field commands if required * From 71bb5415d8317764b10ec2424f2cc1bccb5f86d2 Mon Sep 17 00:00:00 2001 From: Thilanka Kaushalya Date: Sat, 2 Jul 2011 15:16:00 +0530 Subject: [PATCH 6/9] Added show hide option for index table in table structure --- js/messages.php | 2 ++ js/tbl_structure.js | 28 ++++++++++++++++++++++++++++ tbl_structure.php | 3 ++- 3 files changed, 32 insertions(+), 1 deletion(-) diff --git a/js/messages.php b/js/messages.php index f2a5c98256..483d9e38c5 100644 --- a/js/messages.php +++ b/js/messages.php @@ -110,6 +110,8 @@ $js_messages['strNo'] = __('No'); /* For db_stucture.js */ $js_messages['strInsertTable'] = __('Insert Table'); +$js_messages['strHideIndexTable'] = __('Hide index table'); +$js_messages['strShowIndexTable'] = __('Show index table'); /* For db_search.js */ $js_messages['strSearching'] = __('Searching'); diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 3058012b62..3957ed02a5 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -364,4 +364,32 @@ $(document).ready(function() { }) // end $.post() }) // end insert table button "Go" + /**Add the show/hide index table option if the index is available*/ + if ($("#index_div.ajax").find("#table_index").length != 0) { + /** + *Prepare a div containing a link for toggle the index table + */ + $('
') + .insertAfter('#index_div') + /** don't show it until we have index table on-screen */ + .show(); + + /** Changing the displayed text according to the hide/show criteria in table index*/ + + $('#toggletableindexlink') + .html(PMA_messages['strHideIndexTable']) + .bind('click', function() { + var $link = $(this); + $('#index_div').slideToggle(); + if ($link.text() == PMA_messages['strHideIndexTable']) { + $link.text(PMA_messages['strShowIndexTable']); + } else { + $link.text(PMA_messages['strHideIndexTable']); + } + /** avoid default click action */ + return false; + }); + } //end show/hide table index + + }) // end $(document).ready() diff --git a/tbl_structure.php b/tbl_structure.php index 4f8ca3dff1..10cc8d339e 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -699,6 +699,7 @@ if (! $tbl_is_view && ! $db_is_information_schema) {
+
> -
+
'); - - /** - * @var button_options Object that stores the options passed to jQueryUI - * dialog - */ - var button_options = {}; - // in the following function we need to use $(this) - button_options[PMA_messages['strCancel']] = function() {$(this).parent().dialog('close').remove();} - - var button_options_error = {}; - button_options_error[PMA_messages['strOK']] = function() {$(this).parent().dialog('close').remove();} - var $form = $("#resultsForm"); - var $msgbox = PMA_ajaxShowMessage(); - - $.get( $form.attr('action') , $form.serialize()+"&ajax_request=true&submit_mult=export" , function(data) { - //in the case of an error, show the error message returned. - if (data.success != undefined && data.success == false) { - div - .append(data.error) - .dialog({ - title: PMA_messages['strExportTbl'], - height: 230, - width: 900, - open: PMA_verifyTypeOfAllColumns, - buttons : button_options_error - })// end dialog options - } else { - div - .append(data) - .dialog({ - title: PMA_messages['strExportTbl'], - height: 600, - width: 900, - open: PMA_verifyTypeOfAllColumns, - buttons : button_options - }) - //Remove the top menu container from the dialog - .find("#topmenucontainer").hide() - ; // end dialog options - $("#quick_or_custom").show(); - toggle_quick_or_custom(); - $("form[name=dump]").addClass("ajax"); - $("#buttonGo").addClass("ajax"); - } - PMA_ajaxRemoveMessage($msgbox); - }) // end $.get() - } else { - PMA_ajaxShowMessage(PMA_messages['strNoRowSelected']); - } - }); - - $("#buttonGo.ajax").live('click', function(event) { - event.preventDefault(); - /** - * @var the_form object referring to the export form - */ - var $form = $("form[name=dump]"); - - PMA_prepareForAjaxRequest($form); - //User wants to submit the form - $.post($form.attr('action'), $form.serialize(), function(data) { - if (data.success == true) { - PMA_ajaxShowMessage(data.success); - } else { - PMA_ajaxShowMessage(data.error); - - } - if ($("#export_row_dialog").length > 0) { - $("#export_row_dialog").dialog("close").remove(); - } - /**Update the row count at the tableForm*/ - $("#result_query").remove(); - $("#sqlqueryresults").prepend(data.sql_query); - $("#result_query .notice").remove(); - $("#result_query").prepend((data.message)); - - $("#table_results tbody tr.marked .multi_checkbox " + - ", #table_results tbody tr td.marked .multi_checkbox").prop("checked", false); - $("#table_results tbody tr.marked .multi_checkbox " + - ", #table_results tbody tr td.marked .multi_checkbox").removeClass("last_clicked"); - $("#table_results tbody tr" + - ", #table_results tbody tr td").removeClass("marked"); - }) // end $.post() - }) // end insert table button "buttonGo" - }, 'top.frame_content') // end $(document).ready() @@ -1464,22 +1370,22 @@ $(document).ready(function() { $("#sqlqueryresults").trigger('makegrid'); }); -/* +/* * Profiling Chart */ function createProfilingChart() { if($('#profilingchart').length==0) return; - + var cdata = new Array(); $.each(jQuery.parseJSON($('#profilingchart').html()),function(key,value) { cdata.push([key,parseFloat(value)]); }); - + // Prevent the user from seeing the JSON code $('div#profilingchart').html('').show(); PMA_createChart({ - chart: { + chart: { renderTo: 'profilingchart', backgroundColor: $('#sqlqueryresults fieldset').css('background-color') }, diff --git a/sql.php b/sql.php index 3bbdac6c0b..10985b6867 100644 --- a/sql.php +++ b/sql.php @@ -16,7 +16,6 @@ require_once './libraries/bookmark.lib.php'; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'tbl_change.js'; -$GLOBALS['js_include'][] = 'export.js'; if(isset($_SESSION['profiling'])) { $GLOBALS['js_include'][] = 'highcharts/highcharts.js'; From 5560ad53e07d56e6686964de288d487df02a6153 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 3 Jul 2011 06:24:29 -0400 Subject: [PATCH 9/9] ChangeLog entries for new features --- ChangeLog | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ae70fb7359..bd8ab2ef2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,7 +25,9 @@ phpMyAdmin - ChangeLog + [display] More options for browsing GIS data + [interface] Support for spatial indexes + [display] GIS data visualization -+ AJAX for table structure multiple-columns change ++ AJAX for table structure multiple-column change ++ AJAX for table structure index edit ++ Show/hide indexes in table structure 3.4.4.0 (not yet released) - bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes