diff options
author | William Desportes <williamdes@wdes.fr> | 2019-08-22 15:02:22 +0300 |
---|---|---|
committer | William Desportes <williamdes@wdes.fr> | 2019-08-22 15:03:14 +0300 |
commit | 9518e0d05304e7994dab70674f582dd86cfd4ab4 (patch) | |
tree | e2aa84d28019e5eb36bb1610b9e66050669e3821 /js | |
parent | 4f832662c5379cb61c932433623d48b68de9b91d (diff) | |
parent | 58e3b71ae251a6234551af6892f49942577cfacb (diff) |
Merge #15452 - Display an error when trying to import in designer a table that's already imported
Signed-off-by: William Desportes <williamdes@wdes.fr>
Diffstat (limited to 'js')
-rw-r--r-- | js/designer/move.js | 12 | ||||
-rw-r--r-- | js/messages.php | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/js/designer/move.js b/js/designer/move.js index eb2394c81c..847a3ec6c8 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..72bff5f107 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'] = _pgettext('The table already exists in the designer and can not be added once more.', '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); |