The branch, master has been updated via f9550ae3e2808ecc8d82b7528b7a9a3ee92249db (commit) via 131e9caa5f8682ba36808279dbea81417e554d54 (commit) via 81ebc00206d6aee95900b1c28b0212ee79d3bb25 (commit) via 161f8977fa8c053af5585dc79cacb8a0c8a6e60a (commit) via b18be4eaec8321c40659ec5683f49698551d8d76 (commit) via 09fad13dcb1bbeb269d7dad6e5cf1a8e82aa754d (commit) via 8bb5946a907ea85e51e31bd07a791b689b9be2e0 (commit) via 2be90c39071327412677d74c67b1b8b0e662266c (commit) via 8b2439f4a71507c9c43ca58f844ce8e14c2e1d7b (commit) via af73dd335d86302e0be30e95ed39262a4e3b5caa (commit) via f2588c536df0510f1de28e7a033da2199aa7ebfa (commit) via b53ac0870cd2845dfb4b214ca1fe6583c636c444 (commit) from 84a92c03f4f82bbce4313bd2bcbce3ed87754f07 (commit)
- Log ----------------------------------------------------------------- commit f9550ae3e2808ecc8d82b7528b7a9a3ee92249db Author: Marc Delisle marc@infomarc.info Date: Wed Jun 15 09:13:00 2011 -0400
ChangeLog entry for Thilanka Kaushalya's latest new feature
commit 131e9caa5f8682ba36808279dbea81417e554d54 Merge: 84a92c03f4f82bbce4313bd2bcbce3ed87754f07 81ebc00206d6aee95900b1c28b0212ee79d3bb25 Author: Marc Delisle marc@infomarc.info Date: Wed Jun 15 09:09:23 2011 -0400
Merge commit '81ebc00206d6aee95900b1c28b0212ee79d3bb25'
commit 81ebc00206d6aee95900b1c28b0212ee79d3bb25 Merge: 161f8977fa8c053af5585dc79cacb8a0c8a6e60a 551cc9a465269ab1208438d81fc0d492ce797366 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Wed Jun 15 11:36:40 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 161f8977fa8c053af5585dc79cacb8a0c8a6e60a Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Wed Jun 15 11:35:59 2011 +0530
Fixed the delay at dialog load in table insert
commit b18be4eaec8321c40659ec5683f49698551d8d76 Merge: 09fad13dcb1bbeb269d7dad6e5cf1a8e82aa754d 25dc50a5dd8a69f435272d37f7febafffc1d0ff0 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Tue Jun 14 21:53:12 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 09fad13dcb1bbeb269d7dad6e5cf1a8e82aa754d Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Tue Jun 14 21:51:21 2011 +0530
Added the update row count in db structure
commit 8bb5946a907ea85e51e31bd07a791b689b9be2e0 Merge: 2be90c39071327412677d74c67b1b8b0e662266c d0974bd61f2b228338e5a2af7f5967bcc7037d08 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Mon Jun 13 18:12:17 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit 2be90c39071327412677d74c67b1b8b0e662266c Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Mon Jun 13 18:11:00 2011 +0530
Added update the tablesForm in db insert
commit 8b2439f4a71507c9c43ca58f844ce8e14c2e1d7b Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Sun Jun 12 23:02:32 2011 +0530
added the buttonYes click actions
commit af73dd335d86302e0be30e95ed39262a4e3b5caa Merge: f2588c536df0510f1de28e7a033da2199aa7ebfa 54c062c0ad19db67250fde19eff7f44f31429e74 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Jun 10 22:55:31 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit f2588c536df0510f1de28e7a033da2199aa7ebfa Merge: b53ac0870cd2845dfb4b214ca1fe6583c636c444 cd5cddb2e4324094eae365e01422e8d165d372e8 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Jun 10 22:15:57 2011 +0530
Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin
commit b53ac0870cd2845dfb4b214ca1fe6583c636c444 Author: Thilanka Kaushalya lgtkaushalya@gmail.com Date: Fri Jun 10 11:06:36 2011 +0530
Apply ajax behavior to the insert to table option in db structure
-----------------------------------------------------------------------
Summary of changes: ChangeLog | 1 + db_structure.php | 5 +- js/db_structure.js | 136 +++++++++++++++++++++++++++++++++++++++++++++++++--- tbl_replace.php | 3 +- 4 files changed, 135 insertions(+), 10 deletions(-)
diff --git a/ChangeLog b/ChangeLog index daa1a62..e648e2f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,7 @@ + [interface] Changed way of generating charts. + rfe #939233 [interface] Flexible column width + [interface] Mouse-based column reordering in query results ++ AJAX for Insert to a table from database Structure page
3.4.3.0 (not yet released) - bug #3311170 [sync] Missing helper icons in Synchronize diff --git a/db_structure.php b/db_structure.php index 864a668..b49b417 100644 --- a/db_structure.php +++ b/db_structure.php @@ -12,6 +12,7 @@ require_once './libraries/common.inc.php';
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'db_structure.js'; +$GLOBALS['js_include'][] = 'tbl_change.js';
/** * Prepares the tables list if the user where not redirected to this script @@ -354,8 +355,8 @@ foreach ($tables as $keyname => $each_table) { <?php echo $titles['Structure']; ?></a></td> <td align="center"><?php echo $search_table; ?></td> <?php if (! $db_is_information_schema) { ?> - <td align="center"> - <a href="tbl_change.php?<?php echo $tbl_url_query; ?>"> + <td align="center" class="insert_table"> + <a <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? 'class="ajax"' : ''); ?> href="tbl_change.php?<?php echo $tbl_url_query; ?>"> <?php echo $titles['Insert']; ?></a></td> <td align="center"><?php echo $empty_table; ?></td> <td align="center"> diff --git a/js/db_structure.js b/js/db_structure.js index 4affd75..92dae86 100644 --- a/js/db_structure.js +++ b/js/db_structure.js @@ -10,7 +10,7 @@
/** * AJAX scripts for db_structure.php - * + * * Actions ajaxified here: * Drop Database * Truncate Table @@ -33,7 +33,7 @@ function PMA_adjustTotals($this_anchor) { // (not really needed in case we are dropping the table) $rows_td.text('0'); // set size to unknown (not sure how to get the exact - // value here, as an empty InnoDB table would have a size) + // value here, as an empty InnoDB table would have a size) $size_td.text('-');
// try to compute a new total row number @@ -51,6 +51,128 @@ function PMA_adjustTotals($this_anchor) { }
$(document).ready(function() { + /** + * Ajax Event handler for 'Insert Table' + * + * @uses PMA_ajaxShowMessage() + * @see $cfg['AjaxEnable'] + */ + var currrent_insert_table; + $("td.insert_table a.ajax").live('click', function(event){ + event.preventDefault(); + currrent_insert_table = $(this); + var url = $(this).attr("href"); + if (url.substring(0, 15) == "tbl_change.php?") { + url = url.substring(15); + } + + var div = $('<div id="insert_table_dialog"></div>'); + var target = "tbl_change.php"; + + /** + * @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( target , url+"&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['strInsertTable'], + height: 230, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options_error + })// end dialog options + } else { + div + .append(data) + .dialog({ + title: PMA_messages['strInsertTable'], + height: 600, + width: 900, + open: PMA_verifyTypeOfAllColumns, + buttons : button_options + }) + //Remove the top menu container from the dialog + .find("#topmenucontainer").hide() + ; // end dialog options + $(".insertRowTable").addClass("ajax"); + $("#buttonYes").addClass("ajax"); + } + PMA_ajaxRemoveMessage($msgbox); + }) // end $.get() + + }); + + $("#insertForm .insertRowTable.ajax input[value=Go]").live('click', function(event) { + event.preventDefault(); + /** + * @var the_form object referring to the insert form + */ + var $form = $("#insertForm"); + $("#result_query").remove(); + PMA_prepareForAjaxRequest($form); + //User wants to submit the form + $.post($form.attr('action'), $form.serialize() , function(data) { + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + } else { + PMA_ajaxShowMessage(data.error); + } + if ($("#insert_table_dialog").length > 0) { + $("#insert_table_dialog").dialog("close").remove(); + } + /**Update the row count at the tableForm*/ + currrent_insert_table.closest('tr').find('.value.tbl_rows').html(data.row_count); + }) // end $.post() + }) // end insert table button "Go" + + $("#buttonYes.ajax").live('click', function(event){ + event.preventDefault(); + /** + * @var the_form object referring to the insert form + */ + var $form = $("#insertForm"); + /**Get the submit type and the after insert type in the form*/ + var selected_submit_type = $("#insertForm").find("#actions_panel .control_at_footer option:selected").attr('value'); + var selected_after_insert = $("#insertForm").find("#actions_panel select[name=after_insert] option:selected").attr('value'); + $("#result_query").remove(); + PMA_prepareForAjaxRequest($form); + //User wants to submit the form + $.post($form.attr('action'), $form.serialize() , function(data) { + if(data.success == true) { + PMA_ajaxShowMessage(data.message); + if (selected_submit_type == "showinsert") { + $(data.sql_query).insertAfter("#topmenucontainer"); + $("#result_query .notice").remove(); + $("#result_query").prepend((data.message)); + } + if (selected_after_insert == "new_insert") { + /**Trigger the insert dialog for new_insert option*/ + currrent_insert_table.trigger('click'); + } + + } else { + PMA_ajaxShowMessage(data.error); + } + if ($("#insert_table_dialog").length > 0) { + $("#insert_table_dialog").dialog("close").remove(); + } + /**Update the row count at the tableForm*/ + currrent_insert_table.closest('tr').find('.value.tbl_rows').html(data.row_count); + }) // end $.post() + });
/** * Ajax Event handler for 'Truncate Table' @@ -149,7 +271,7 @@ $(document).ready(function() {
/** * Ajax Event handler for 'Drop Event' - * + * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() * @see $cfg['AjaxEnable'] @@ -188,7 +310,7 @@ $(document).ready(function() {
/** * Ajax Event handler for 'Drop Procedure' - * + * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() * @see $cfg['AjaxEnable'] @@ -220,10 +342,10 @@ $(document).ready(function() { }) // end $.get() }) // end $.PMA_confirm() }) //end Drop Procedure - + /** * Ajax Event handler for 'Drop tracking' - * + * * @uses $.PMA_confirm() * @uses PMA_ajaxShowMessage() * @see $cfg['AjaxEnable'] @@ -261,7 +383,7 @@ $(document).ready(function() { //Calculate Real End for InnoDB /** * Ajax Event handler for calculatig the real end for a InnoDB table - * + * * @uses $.PMA_confirm */ $('#real_end_input').live('click', function(event) { diff --git a/tbl_replace.php b/tbl_replace.php index d23482e..e08dafb 100644 --- a/tbl_replace.php +++ b/tbl_replace.php @@ -424,7 +424,8 @@ if (! empty($error_messages)) { unset($error_messages, $warning_messages, $total_affected_rows, $last_messages, $last_message);
if($GLOBALS['is_ajax_request'] == true) { - + /**Get the total row count of the table*/ + $extra_data['row_count'] = PMA_Table::countRecords($_REQUEST['db'],$_REQUEST['table']); $extra_data['sql_query'] = PMA_showMessage(NULL, $GLOBALS['display_query']); PMA_ajaxResponse($message, $message->isSuccess(), $extra_data); }
hooks/post-receive