Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorHugues Peccatte <hugues.peccatte@gmail.com>2019-08-22 00:05:15 +0300
committerHugues Peccatte <hugues.peccatte@gmail.com>2019-08-22 00:05:15 +0300
commitb37b479da03b02cab23ce039ecb299496afa6b6d (patch)
tree86af7098615e5f668e02dba32927b89b21145566 /js
parent10745bb39275a6f5ac7c62c063fa6433dfc8854b (diff)
Display an error when trying to import in designer a table that's already imported
Signed-off-by: Hugues Peccatte <hugues.peccatte@gmail.com>
Diffstat (limited to 'js')
-rw-r--r--js/designer/move.js12
-rw-r--r--js/messages.php3
2 files changed, 15 insertions, 0 deletions
diff --git a/js/designer/move.js b/js/designer/move.js
index 3fb8cd3cb7..b37d03fdda 100644
--- a/js/designer/move.js
+++ b/js/designer/move.js
@@ -554,6 +554,18 @@ function Add_Other_db_tables () {
button_options[PMA_messages.strGo] = function () {
var db = $('#add_table_from').val();
var table = $('#add_table').val();
+
+ //Check if table already imported or not.
+ var $table = $('[id="' + encodeURIComponent(db) + '.' + encodeURIComponent(table) + '"]');
+ if ($table.length !== 0) {
+ PMA_ajaxShowMessage(
+ PMA_sprintf(PMA_messages.strTableAlreadyExists, db + '.' + table),
+ undefined,
+ 'error'
+ );
+ return;
+ }
+
$.post('db_designer.php', {
'ajax_request' : true,
'dialog' : 'add_table',
diff --git a/js/messages.php b/js/messages.php
index 2bf1822cb9..6e4383d7ff 100644
--- a/js/messages.php
+++ b/js/messages.php
@@ -751,6 +751,9 @@ $js_messages['strStrong'] = __('Strong');
$js_messages['strU2FTimeout'] = __('Timed out waiting for security key activation.');
$js_messages['strU2FError'] = __('Failed security key activation (%s).');
+/* Designer */
+$js_messages['strTableAlreadyExists'] = __('Table %s already exists!');
+
echo "var PMA_messages = new Array();\n";
foreach ($js_messages as $name => $js_message) {
Sanitize::printJsValue("PMA_messages['" . $name . "']", $js_message);