The branch, master has been updated via 93db9fdc127ff086d5fa4f15abb25b9fd973e401 (commit) via 7ecd11483e9d245b524cac0dfff00abd090c5985 (commit) via 1970c357a30c44c410578bd4513dfb77125d6126 (commit) via f7157a5fc6d449a95e347224b59fa95ce1860c46 (commit) via 1d9f5cdf7354d02db0a39ddfbd9a775fbbdaff1f (commit) via 610509e3841f57cd244d624148f8125b0d9e2d1e (commit) via 146a8da5e93c3a187dd7ef2f5715be777b0e2d9e (commit) from 6b06041f340459bbcbb2dc306c64988e11ae7a42 (commit)
- Log ----------------------------------------------------------------- commit 93db9fdc127ff086d5fa4f15abb25b9fd973e401 Merge: 7ecd11483e9d245b524cac0dfff00abd090c5985 6b06041f340459bbcbb2dc306c64988e11ae7a42 Author: Marc Delisle marc@infomarc.info Date: Mon Jun 27 07:44:20 2011 -0400
Merge branch 'master' of ssh://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 7ecd11483e9d245b524cac0dfff00abd090c5985 Author: Marc Delisle marc@infomarc.info Date: Mon Jun 27 07:43:15 2011 -0400
ChangeLog entry
commit 1970c357a30c44c410578bd4513dfb77125d6126 Author: Marc Delisle marc@infomarc.info Date: Mon Jun 27 07:39:47 2011 -0400
These are jQuery objects
commit f7157a5fc6d449a95e347224b59fa95ce1860c46 Author: Marc Delisle marc@infomarc.info Date: Mon Jun 27 07:32:14 2011 -0400
Typos
commit 1d9f5cdf7354d02db0a39ddfbd9a775fbbdaff1f Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Sun Jun 26 23:28:34 2011 +0530
Fixed bugs in show error message ine multi row change in table structure
commit 610509e3841f57cd244d624148f8125b0d9e2d1e Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Sat Jun 25 21:26:56 2011 +0530
Fixed bugs in multi column change in table structure
commit 146a8da5e93c3a187dd7ef2f5715be777b0e2d9e Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Sat Jun 25 16:57:54 2011 +0530
Ajaxified the multi column change in table structure
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + js/functions.js | 7 ++- js/tbl_structure.js | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++- tbl_alter.php | 3 +- tbl_structure.php | 16 ++++---- 5 files changed, 121 insertions(+), 12 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 16c8f88..34d07c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -25,6 +25,7 @@ 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
3.4.4.0 (not yet released) - bug #3323060 [parser] SQL parser breaks AJAX requests if query has unclosed quotes diff --git a/js/functions.js b/js/functions.js index 436805c..397f248 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 352848c..d1a2676 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -145,5 +145,109 @@ $(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 = $('<div id="change_column_dialog"></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 submitting 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 ($("#sqlqueryresults").length != 0) { + $("#sqlqueryresults").remove(); + } else if ($(".error").length != 0) { + $(".error").remove(); + } + if (data.success == true) { + PMA_ajaxShowMessage(data.message); + $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer"); + $("#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 = $("<div id='temp_div'><div>").append(form_data); + if ($("#sqlqueryresults").length != 0) { + $temp_div.find("#fieldsForm").insertAfter("#sqlqueryresults"); + } else { + $temp_div.find("#fieldsForm").insertAfter(".error"); + } + /*Call the function to display the more options in table*/ + displayMoreTableOpts(); + }); + } else { + var $temp_div = $("<div id='temp_div'><div>").append(data); + var $error = $temp_div.find(".error code").addClass("error"); + PMA_ajaxShowMessage($error); + } + }) // end $.post() + }) // end insert table button "do_save_data" + }) // end $(document).ready() diff --git a/tbl_alter.php b/tbl_alter.php index 1c2d7fb..743e925 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 f3ce162..5406e9f 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; ?> -<form method="post" action="tbl_structure.php" name="fieldsForm" id="fieldsForm"> +<form method="post" action="tbl_structure.php" name="fieldsForm" id="fieldsForm" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>> <?php echo PMA_generate_common_hidden_inputs($db, $table); echo '<input type="hidden" name="table_type" value='; - if($db_is_information_schema) { - echo '"information_schema" />'; - } 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" />'; + } ?>
<table id="tablestructure" class="data"> <thead>
hooks/post-receive