From 6acf4acd254e73d07c6bed2d7dd01519901a6670 Mon Sep 17 00:00:00 2001 From: Atul Pratap Singh Date: Sun, 27 Mar 2011 18:04:08 +0530 Subject: [PATCH] auto get back to the Table Operations tab --- sql.php | 4 +++- tbl_move_copy.php | 15 +++++---------- tbl_operations.php | 46 ++++++++++++++++++++++++++++++++++++---------- 3 files changed, 44 insertions(+), 21 deletions(-) diff --git a/sql.php b/sql.php index abc1ccf59..eb6dc5269 100644 --- a/sql.php +++ b/sql.php @@ -932,5 +932,7 @@ window.onload = function() /** * Displays the footer */ -require './libraries/footer.inc.php'; +if(!isset($_REQUEST['table_maintenance'])) { + require './libraries/footer.inc.php'; +} ?> diff --git a/tbl_move_copy.php b/tbl_move_copy.php index 9f0e229b4..330edcc0b 100644 --- a/tbl_move_copy.php +++ b/tbl_move_copy.php @@ -45,9 +45,9 @@ if (PMA_isValid($_REQUEST['new_name'])) { } else { $message = PMA_Message::error(__('Can\'t copy table to same one!')); } - $goto = './tbl_operations.php'; + $result = false; } else { - PMA_Table::moveCopy($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'], + $result = PMA_Table::moveCopy($db, $table, $_REQUEST['target_db'], $_REQUEST['new_name'], $_REQUEST['what'], isset($_REQUEST['submit_move']), 'one_table'); if (isset($_REQUEST['submit_move'])) { @@ -66,23 +66,18 @@ if (PMA_isValid($_REQUEST['new_name'])) { $table = $_REQUEST['new_name']; } $reload = 1; - - $disp_query = $sql_query; - $disp_message = $message; - unset($sql_query, $message); - - $goto = $cfg['DefaultTabTable']; } } else { /** * No new name for the table! */ $message = PMA_Message::error(__('The table name is empty!')); - $goto = './tbl_operations.php'; + $result = false; } /** * Back to the calling script */ -require $goto; +$_message = $message; +unset($message); ?> diff --git a/tbl_operations.php b/tbl_operations.php index 8b25c8c42..3c8b5dd45 100644 --- a/tbl_operations.php +++ b/tbl_operations.php @@ -63,6 +63,20 @@ if ($is_aria) { $reread_info = false; $table_alters = array(); +/** + * If the table has to be moved to some other database + */ +if(isset($_REQUEST['submit_move']) || isset($_REQUEST['submit_copy'])) { + $_message = ''; + require_once './tbl_move_copy.php'; +} +/** + * If the table has to be maintained + */ +if(isset($_REQUEST['table_maintenance'])) { + require_once './sql.php'; + unset($result); +} /** * Updates table comment, type and options if required */ @@ -266,7 +280,7 @@ unset($columns);
-
@@ -505,7 +519,7 @@ if (isset($possible_row_formats[$tbl_type])) {
- @@ -577,9 +591,12 @@ if (isset($possible_row_formats[$tbl_type])) { if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { if ($is_myisam_or_aria || $is_innodb) { $this_url_params = array_merge($url_params, - array('sql_query' => 'CHECK TABLE ' . PMA_backquote($GLOBALS['table']))); + array( + 'sql_query' => 'CHECK TABLE ' . PMA_backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + )); ?> -
  • +
  • @@ -597,9 +614,12 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { } if ($is_myisam_or_aria || $is_berkeleydb) { $this_url_params = array_merge($url_params, - array('sql_query' => 'ANALYZE TABLE ' . PMA_backquote($GLOBALS['table']))); + array( + 'sql_query' => 'ANALYZE TABLE ' . PMA_backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + )); ?> -
  • +
  • @@ -607,9 +627,12 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { } if ($is_myisam_or_aria) { $this_url_params = array_merge($url_params, - array('sql_query' => 'REPAIR TABLE ' . PMA_backquote($GLOBALS['table']))); + array( + 'sql_query' => 'REPAIR TABLE ' . PMA_backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + )); ?> -
  • +
  • @@ -617,9 +640,12 @@ if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { } if ($is_myisam_or_aria || $is_innodb || $is_berkeleydb) { $this_url_params = array_merge($url_params, - array('sql_query' => 'OPTIMIZE TABLE ' . PMA_backquote($GLOBALS['table']))); + array( + 'sql_query' => 'OPTIMIZE TABLE ' . PMA_backquote($GLOBALS['table']), + 'table_maintenance' => 'Go', + )); ?> -
  • +