From 98d802407a185ee1a2421272390df88b6f75b6b2 Mon Sep 17 00:00:00 2001 From: dennischen Date: Tue, 22 Mar 2011 18:04:29 +0800 Subject: [PATCH] patch for Copy set of tables to new name pattern. --modify the message when the table name already exists --set the time of message display to 5 seconds,temporarily. --- db_operations.php | 11 ++++++----- js/db_operations.js | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/db_operations.php b/db_operations.php index 13413d6670..f6bbc5f8da 100644 --- a/db_operations.php +++ b/db_operations.php @@ -27,6 +27,7 @@ require_once "./libraries/blobstreaming.lib.php"; $GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js'; $GLOBALS['js_include'][] = 'db_operations.js'; +error_reporting(-1); /** * Rename/move or copy database */ @@ -74,11 +75,11 @@ if (strlen($db) && (! empty($table_copy)||! empty($db_rename) || ! empty($db_cop $msg=''; $message=new PMA_Message(); $matchedCount=count($dstTables); - if(!isset($replace_replicated_table)){ + if(!isset($replace_existed_table)){ foreach($dstTables as $key=>$dstTable){ if(!(array_search($dstTable,$srcTables)===false)){ unset($dstTables[$key]); - $msg.=__("Replicated Table Name:%s"."
"); + $msg.=__("Table %s already exists!").'
'; $message->addParam($dstTable,true); } }//to avoid create and copy data to existed tables @@ -93,7 +94,7 @@ if (strlen($db) && (! empty($table_copy)||! empty($db_rename) || ! empty($db_cop } }else{ - if(isset($replace_replicated_table)){ + if(isset($replace_existed_table)){ if (isset($GLOBALS['drop_if_exists'])) { $temp_drop_if_exists = $GLOBALS['drop_if_exists']; } @@ -107,7 +108,7 @@ if (strlen($db) && (! empty($table_copy)||! empty($db_rename) || ! empty($db_cop $message->addParam($dstTable,true); } $message->setMessage($msg); - if(isset($replace_replicated_table)){ + if(isset($replace_existed_table)){ unset($GLOBALS['drop_if_exists']); if (isset($temp_drop_if_exists)) { // restore previous value @@ -648,7 +649,7 @@ echo __('Remove database'); 'all' => __('Replace Replicated Tables'), 'dataonly' => __('Replace Replicated Tables(data only)') );*/ - PMA_display_html_checkbox('replace_replicated_table', __('Replace Replicated Tables'),false,false); + PMA_display_html_checkbox('replace_existed_table', __('Replace Existed Tables'),false,false); //unset($choices); ?> diff --git a/js/db_operations.js b/js/db_operations.js index b63693292f..33eb1dd90f 100644 --- a/js/db_operations.js +++ b/js/db_operations.js @@ -166,9 +166,9 @@ $(document).ready(function() { data:$form.serialize(), success:function(data,textStatus,jqXHR) { if(data.success){ - PMA_ajaxShowMessage(data.message); + PMA_ajaxShowMessage(data.message,5000); }else{ - PMA_ajaxShowMessage(data.error); + PMA_ajaxShowMessage(data.error,5000); } window.parent.refreshNavigation(true); }, -- 2.11.4.GIT