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>
This commit is contained in:
commit
9518e0d053
@ -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',
|
||||
|
||||
@ -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);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user