The branch, master has been updated via 5bc41ef1dc31019daaa0933bec967ebff63b55e0 (commit) via 97055ad6fe4f13dccdf2288050e8c433a0db2be6 (commit) via 67ad16516b1f3a3e0039c15dfb35ab53f92391ed (commit) via 710362f869da38590ae507ee86c11c49c49387fa (commit) via 15a9db72b39bf033629c45a1cf87bd890ada9259 (commit) via 5288a55b9803c1b8fbb0fc580661ff5b2b46ac1e (commit) via 063b6bd544b35d7ee5a76e44c766258fb1c551de (commit) via 3a2d3e3c4eab717140526ca8ba5e6a234244c7d5 (commit) from 04d2a605dd2473be5c060faadb08916a3b4ca648 (commit)
- Log ----------------------------------------------------------------- commit 5bc41ef1dc31019daaa0933bec967ebff63b55e0 Author: Marc Delisle marc@infomarc.info Date: Fri Jul 22 14:34:46 2011 -0400
ChangeLog for "AJAX for table Structure column Add"
commit 97055ad6fe4f13dccdf2288050e8c433a0db2be6 Author: Marc Delisle marc@infomarc.info Date: Fri Jul 22 14:33:28 2011 -0400
Typo
commit 67ad16516b1f3a3e0039c15dfb35ab53f92391ed Merge: 710362f869da38590ae507ee86c11c49c49387fa 04d2a605dd2473be5c060faadb08916a3b4ca648 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Jul 22 23:32:28 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 710362f869da38590ae507ee86c11c49c49387fa Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Jul 22 23:31:44 2011 +0530
Fixed issues in enum editor in table insert column option
commit 15a9db72b39bf033629c45a1cf87bd890ada9259 Merge: 5288a55b9803c1b8fbb0fc580661ff5b2b46ac1e 49b2ca984a6c38fa7b49aeff3f1344d837cf5834 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Jul 22 07:40:41 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 5288a55b9803c1b8fbb0fc580661ff5b2b46ac1e Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Jul 22 07:40:14 2011 +0530
Fixed issues of Add Columns
commit 063b6bd544b35d7ee5a76e44c766258fb1c551de Merge: 3a2d3e3c4eab717140526ca8ba5e6a234244c7d5 4925260d959d8bd7194b912ddd1317c71f7cc42b Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Thu Jul 21 23:55:31 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 3a2d3e3c4eab717140526ca8ba5e6a234244c7d5 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Thu Jul 21 23:53:37 2011 +0530
Ajaxified add columns option in table structure
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + js/functions.js | 12 +++++++- js/messages.php | 3 ++ js/tbl_structure.js | 66 +++++++++++++++++++++++++++++++++++++++++++++++++++ tbl_addfield.php | 6 ++++ tbl_structure.php | 2 +- 6 files changed, 87 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog index 38ac1e8..16e3cac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -39,6 +39,7 @@ phpMyAdmin - ChangeLog + [interface] Improved support for events + [interface] Improved support for triggers + [interface] Improved server monitoring ++ AJAX for table Structure column Add
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 1e2cced..7b36e51 100644 --- a/js/functions.js +++ b/js/functions.js @@ -1836,12 +1836,12 @@ $(document).ready(function() { }, 'top.frame_content'); //end $(document).ready for 'Create Table'
/** - * jQuery coding for 'Change Table'. Used on tbl_structure.php * + * jQuery coding for 'Change Table' and 'Add Column'. Used on tbl_structure.php * * Attach Ajax Event handlers for Change Table */ $(document).ready(function() { /** - *Ajax action for submitting the column change form + *Ajax action for submitting the "Column Change" and "Add Column" form **/ $("#append_fields_form input[name=do_save_data]").live('click', function(event) { event.preventDefault(); @@ -1876,16 +1876,20 @@ $(document).ready(function() { $("#result_query").prepend((data.message)); if ($("#change_column_dialog").length > 0) { $("#change_column_dialog").dialog("close").remove(); + } else if ($("#add_columns").length > 0) { + $("#add_columns").dialog("close").remove(); } /*Reload the field form*/ $.post($("#fieldsForm").attr('action'), $("#fieldsForm").serialize()+"&ajax_request=true", function(form_data) { $("#fieldsForm").remove(); + $("#addColumns").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"); } + $temp_div.find("#addColumns").insertBefore("iframe.IE_hack"); /*Call the function to display the more options in table*/ displayMoreTableOpts(); }); @@ -2107,6 +2111,10 @@ $(document).ready(function() { $("#popup_background").css({"opacity":"0.7"}); $("#popup_background").fadeIn("fast"); $("#enum_editor").fadeIn("fast"); + /**Replacing the column name in the enum editor header*/ + var column_name = $("#append_fields_form").find("input[id=field_0_1]").attr("value"); + var h3_text = $("#enum_editor h3").html(); + $("#enum_editor h3").html(h3_text.split('"')[0]+'"'+column_name+'"');
// Get the values var values = $(this).parent().prev("input").attr("value").split(","); diff --git a/js/messages.php b/js/messages.php index 5b91d79..4cfa7e7 100644 --- a/js/messages.php +++ b/js/messages.php @@ -207,6 +207,9 @@ $js_messages['strShowSearchCriteria'] = __('Show search criteria'); /* For tbl_change.js */ $js_messages['strIgnore'] = __('Ignore');
+/* For tbl_structure.js */ +$js_messages['strAddColumns'] = __('Add columns'); + /* Designer (pmd/scripts/move.js) */ $js_messages['strSelectReferencedKey'] = __('Select referenced key'); $js_messages['strSelectForeignKey'] = __('Select Foreign Key'); diff --git a/js/tbl_structure.js b/js/tbl_structure.js index 69f872d..897cad8 100644 --- a/js/tbl_structure.js +++ b/js/tbl_structure.js @@ -336,6 +336,70 @@ $(document).ready(function() { }); } //end show/hide table index
+ /** + *Ajax event handler for Add column(s) + **/ + $("#addColumns.ajax input[value=Go]").live('click', function(event){ + event.preventDefault(); + + /*Remove the hidden dialogs if there are*/ + if ($('#add_columns').length != 0) { + $('#add_columns').remove(); + } + var $div = $('<div id="add_columns"></div>'); + + var $form = $("#addColumns"); + + /** + * @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).dialog('close').remove();} + + var button_options_error = {}; + button_options_error[PMA_messages['strOK']] = function() {$(this).dialog('close').remove();} + var $msgbox = PMA_ajaxShowMessage(); + + $.get( $form.attr('action') , $form.serialize()+"&ajax_request=true" , 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['strAddColumns'], + height: 230, + width: 900, + open: PMA_verifyTypeOfAllColumns, + modal: true, + buttons : button_options_error + })// end dialog options + } else { + $div + .append(data) + .dialog({ + title: PMA_messages['strAddColumns'], + height: 600, + width: 900, + open: PMA_verifyTypeOfAllColumns, + modal: true, + buttons : button_options + }) + //Remove the top menu container from the dialog + .find("#topmenucontainer").hide() + ; // end dialog options + + $div = $("#add_columns"); + /*changed the z-index of the enum editor to allow the edit*/ + $("#enum_editor").css("z-index", "1100"); + PMA_convertFootnotesToTooltips($div); + } + PMA_ajaxRemoveMessage($msgbox); + }) // end $.get() + }); + +
}) // end $(document).ready()
@@ -396,6 +460,8 @@ function changeColumns(action,url) { $("#append_fields_form input[name=do_save_data]").addClass("ajax"); /*changed the z-index of the enum editor to allow the edit*/ $("#enum_editor").css("z-index", "1100"); + $div = $("#change_column_dialog"); + PMA_convertFootnotesToTooltips($div); } PMA_ajaxRemoveMessage($msgbox); }) // end $.get() diff --git a/tbl_addfield.php b/tbl_addfield.php index ec910fd..a866fef 100644 --- a/tbl_addfield.php +++ b/tbl_addfield.php @@ -184,6 +184,12 @@ if (isset($_REQUEST['do_save_data'])) { // Go back to the structure sub-page $message = PMA_Message::success(__('Table %1$s has been altered successfully')); $message->addParam($table); + + if( $GLOBALS['is_ajax_request'] == true) { + $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'; } else { diff --git a/tbl_structure.php b/tbl_structure.php index afac23f..a4e9692 100644 --- a/tbl_structure.php +++ b/tbl_structure.php @@ -668,7 +668,7 @@ if (! $tbl_is_view && ! $db_is_information_schema) { ?>
<br /> -<form method="post" action="tbl_addfield.php" +<form method="post" action="tbl_addfield.php" id="addColumns" name="addColumns" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?> onsubmit="return checkFormElementInRange(this, 'num_fields', '<?php echo str_replace('\'', '\\\'', __('You have to add at least one column.')); ?>', 1)"> <?php echo PMA_generate_common_hidden_inputs($db, $table);
hooks/post-receive