[Phpmyadmin-git] [SCM] phpMyAdmin branch, master, updated. RELEASE_3_4_3_1-12870-g663d073

Marc Delisle lem9 at users.sourceforge.net
Tue Aug 2 18:33:02 CEST 2011


The branch, master has been updated
       via  663d073e6be9630bd99e3684705d9182c36112b1 (commit)
       via  3f7c35cd69bfe6d353b992fc96f871b525be132a (commit)
       via  5ee97c77870dc72003e19dc36f4add9cffb8879e (commit)
       via  18310f6b406644fcb1798a0be4dcf444ffdb0ac6 (commit)
       via  4796a6ccd05b22ee4a04f907f2bf83d034541cf3 (commit)
       via  66fbb2da266c19cd6631eef9f80dc38fef4b84dd (commit)
       via  6bde6363bbaeab88cdb3a026df0c5c1e4183800b (commit)
       via  278469515403a219f2d4f9dd11544670d5eb68da (commit)
      from  85d729ac5f9b8769ea791a34fefdd6f7c63e50a9 (commit)


- Log -----------------------------------------------------------------
commit 663d073e6be9630bd99e3684705d9182c36112b1
Author: Marc Delisle <marc at infomarc.info>
Date:   Tue Aug 2 12:32:51 2011 -0400

    ChangeLog entry

commit 3f7c35cd69bfe6d353b992fc96f871b525be132a
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Tue Aug 2 21:39:58 2011 +0530

    Fixed bug in refresing the navigation after table operations

commit 5ee97c77870dc72003e19dc36f4add9cffb8879e
Merge: 18310f6b406644fcb1798a0be4dcf444ffdb0ac6 85d729ac5f9b8769ea791a34fefdd6f7c63e50a9
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Tue Aug 2 21:34:28 2011 +0530

    Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit 18310f6b406644fcb1798a0be4dcf444ffdb0ac6
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Tue Aug 2 21:33:47 2011 +0530

    Fixed bug in refresing the navigation after table operations

commit 4796a6ccd05b22ee4a04f907f2bf83d034541cf3
Merge: 66fbb2da266c19cd6631eef9f80dc38fef4b84dd 19178070b652faea2b8091f72f10c700c015a805
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sun Jul 31 22:55:12 2011 +0530

    Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit 66fbb2da266c19cd6631eef9f80dc38fef4b84dd
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sun Jul 31 22:53:02 2011 +0530

    Fixed the bugs in table copy of table operations

commit 6bde6363bbaeab88cdb3a026df0c5c1e4183800b
Merge: 278469515403a219f2d4f9dd11544670d5eb68da e3b91b7a0bfcb6bc525c9cfb27c8fc7570457b95
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sun Jul 31 12:21:06 2011 +0530

    Merge branch 'master' of git://phpmyadmin.git.sourceforge.net/gitroot/phpmyadmin/phpmyadmin

commit 278469515403a219f2d4f9dd11544670d5eb68da
Author: Thilanka Kaushalya <lgtkaushalya at gmail.com>
Date:   Sun Jul 31 12:20:17 2011 +0530

    Ajaxify the table coppy option in table operations

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    1 +
 js/functions.js    |   52 +++++++++++++++++++++++++++++++++++++++++++++++++++-
 tbl_alter.php      |    4 ++--
 tbl_move_copy.php  |    7 +++++++
 tbl_operations.php |    6 +++---
 5 files changed, 64 insertions(+), 6 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 151e85f..3cd0d8f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -40,6 +40,7 @@ phpMyAdmin - ChangeLog
 + [interface] Improved support for triggers
 + [interface] Improved server monitoring
 + AJAX for table Structure column Add
++ AJAX for table Operations copy table
 
 3.4.5.0 (not yet released)
 - bug #3375325 [interface] Page list in navigation frame looks odd
diff --git a/js/functions.js b/js/functions.js
index 2094a0a..bc94a89 100644
--- a/js/functions.js
+++ b/js/functions.js
@@ -1972,6 +1972,9 @@ $(document).ready(function() {
             if ($("#sqlqueryresults").length != 0) {
                 $("#sqlqueryresults").remove();
             }
+            if ($("#result_query").length != 0) {
+                $("#result_query").remove();
+            }
             if (data.success == true) {
                 PMA_ajaxShowMessage(data.message);
                 $("<div id='sqlqueryresults'></div>").insertAfter("#topmenucontainer");
@@ -1979,10 +1982,57 @@ $(document).ready(function() {
                 $("#result_query .notice").remove();
                 $("#result_query").prepend((data.message));
             } else {
-                PMA_ajaxShowMessage(data.error);
+                $temp_div = $("<div id='temp_div'></div>")
+                $temp_div.html(data.error);
+                $error = $temp_div.find("code").addClass("error");
+                PMA_ajaxShowMessage($error);
             }
         }) // end $.post()
     });//end of alterTableOrderby ajax submit
+
+    /**
+     *Ajax action for submitting the "Copy table"
+    **/
+    $("#copyTable.ajax input[name='submit_copy']").live('click', function(event) {
+        event.preventDefault();
+        $form = $("#copyTable");
+        if($form.find("input[name='switch_to_new']").attr('checked')) {
+            $form.append('<input type="hidden" name="submit_copy" value="Go" />');
+            $form.removeClass('ajax');
+            $form.find("#ajax_request_hidden").remove();
+            $form.submit();
+        } else {
+            PMA_prepareForAjaxRequest($form);
+            /*variables which stores the common attributes*/
+            $.post($form.attr('action'), $form.serialize()+"&submit_copy=Go", function(data) {
+                if ($("#sqlqueryresults").length != 0) {
+                    $("#sqlqueryresults").remove();
+                }
+                if ($("#result_query").length != 0) {
+                    $("#result_query").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));
+                    $("#copyTable").find("select[name='target_db'] option[value="+data.db+"]").attr('selected', 'selected');
+                
+                    //Refresh navigation frame when the table is coppied
+                    if (window.parent && window.parent.frame_navigation) {
+                        window.parent.frame_navigation.location.reload();
+                    }
+                } else {
+                    $temp_div = $("<div id='temp_div'></div>")
+                    $temp_div.html(data.error);
+                    $error = $temp_div.find("code").addClass("error");
+                    PMA_ajaxShowMessage($error);
+                }
+            }) // end $.post()
+        }
+    });//end of copyTable ajax submit
+
 }, 'top.frame_content'); //end $(document).ready for 'Table operations'
 
 
diff --git a/tbl_alter.php b/tbl_alter.php
index 807a39e..6c46c9f 100644
--- a/tbl_alter.php
+++ b/tbl_alter.php
@@ -130,9 +130,9 @@ if (isset($_REQUEST['do_save_data'])) {
             }
         }
 
-        if ( $GLOBALS['is_ajax_request'] == true) {
+        if ( $_REQUEST['ajax_request'] == true) {
             $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
-            PMA_ajaxResponse($message, $message->isSuccess(),$extra_data);
+            PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
         }
 
         $active_page = 'tbl_structure.php';
diff --git a/tbl_move_copy.php b/tbl_move_copy.php
index 330edcc..58d90f3 100644
--- a/tbl_move_copy.php
+++ b/tbl_move_copy.php
@@ -65,6 +65,13 @@ if (PMA_isValid($_REQUEST['new_name'])) {
             $db        = $_REQUEST['target_db'];
             $table     = $_REQUEST['new_name'];
         }
+        
+        if ( $_REQUEST['ajax_request'] == true) {
+            $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
+            $extra_data['db'] = $GLOBALS['db'];
+            PMA_ajaxResponse($message, $message->isSuccess(), $extra_data);
+        }
+        
         $reload = 1;
     }
 } else {
diff --git a/tbl_operations.php b/tbl_operations.php
index 3481fd1..3e9bdeb 100644
--- a/tbl_operations.php
+++ b/tbl_operations.php
@@ -229,7 +229,7 @@ if (isset($result) && empty($message_to_show)) {
         $_message = $result ? $message = PMA_Message::success(__('Your SQL query has been executed successfully')) : PMA_Message::error(__('Error'));
         // $result should exist, regardless of $_message
         $_type = $result ? 'success' : 'error';
-        if ( $GLOBALS['is_ajax_request'] == true) {
+        if ( $_REQUEST['ajax_request'] == true) {
             $extra_data['sql_query'] = PMA_showMessage(NULL, $sql_query);
             PMA_ajaxResponse($_message,$_message->isSuccess() ,$extra_data);
         }
@@ -238,7 +238,7 @@ if (isset($result) && empty($message_to_show)) {
         $_message = new PMA_Message;
         $_message->addMessages($warning_messages);
         $_message->isError(true);
-        if ( $GLOBALS['is_ajax_request'] == true) {
+        if ( $_REQUEST['ajax_request'] == true) {
             PMA_ajaxResponse($_message, false);
         }
         unset($warning_messages);
@@ -532,7 +532,7 @@ if (isset($possible_row_formats[$tbl_type])) {
 
 <!-- Copy table -->
 <div class="operations_half_width">
-<form method="post" action="tbl_operations.php"
+<form method="post" action="tbl_operations.php" name="copyTable" id="copyTable" <?php echo ($GLOBALS['cfg']['AjaxEnable'] ? ' class="ajax"' : '');?>
     onsubmit="return emptyFormElements(this, 'new_name')">
 <?php echo PMA_generate_common_hidden_inputs($GLOBALS['db'], $GLOBALS['table']); ?>
 <input type="hidden" name="reload" value="1" />


hooks/post-receive
-- 
phpMyAdmin




More information about the Git mailing list