Merge pull request #1726 from nisargjhaveri/fk_check_tbl_op

Foreign key checkbox for empty/drop in table operation
This commit is contained in:
Marc Delisle 2015-06-13 10:34:40 -04:00
commit adc34b7638
4 changed files with 21 additions and 14 deletions

View File

@ -55,6 +55,7 @@ phpMyAdmin - ChangeLog
- bug #4946 When hide table structure actions is false, action should be in a row
+ rfe #726 Batch changing the collation of each column in a table
+ rfe #1594 Use plain English descriptors instead of script names for icon link destinations
+ rfe #1541 Disable foreign key checks for some operations
4.4.10.0 (not yet released)
- bug #4950 Issues in database selection for replication

View File

@ -251,11 +251,7 @@ AJAX.registerOnload('db_structure.js', function () {
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
var params = {
'is_js_confirmed' : 1,
'ajax_request' : true,
'fk_checks': $(this).find('#fk_checks').is(':checked') ? 1 : 0
};
var params = getJSConfirmCommonParam(this);
$.get(url, params, function (data) {
if (typeof data !== 'undefined' && data.success === true) {
@ -318,11 +314,7 @@ AJAX.registerOnload('db_structure.js', function () {
var $msg = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
var params = {
'is_js_confirmed' : 1,
'ajax_request' : true,
'fk_checks': $(this).find('#fk_checks').is(':checked') ? 1 : 0
};
var params = getJSConfirmCommonParam(this);
$.get(url, params, function (data) {
if (typeof data !== 'undefined' && data.success === true) {

View File

@ -1692,6 +1692,14 @@ function getForeignKeyCheckbox() {
return html;
}
function getJSConfirmCommonParam(elem) {
return {
'is_js_confirmed' : 1,
'ajax_request' : true,
'fk_checks': $(elem).find('#fk_checks').is(':checked') ? 1 : 0
};
}
/**
* Unbind all event handlers before tearing down a page
*/

View File

@ -203,12 +203,15 @@ AJAX.registerOnload('tbl_operations.js', function () {
question += PMA_sprintf(
PMA_messages.strDoYouReally,
'DROP TABLE ' + escapeHtml(PMA_commonParams.get('table'))
);
) + getForeignKeyCheckbox();
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
var $msgbox = PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function (data) {
var params = getJSConfirmCommonParam(this);
$.get(url, params, function (data) {
if (typeof data !== 'undefined' && data.success === true) {
PMA_ajaxRemoveMessage($msgbox);
// Table deleted successfully, refresh both the frames
@ -269,10 +272,13 @@ AJAX.registerOnload('tbl_operations.js', function () {
question += PMA_sprintf(
PMA_messages.strDoYouReally,
'TRUNCATE ' + escapeHtml(PMA_commonParams.get('table'))
);
) + getForeignKeyCheckbox();
$(this).PMA_confirm(question, $(this).attr('href'), function (url) {
PMA_ajaxShowMessage(PMA_messages.strProcessingRequest);
$.get(url, {'is_js_confirmed': '1', 'ajax_request': true}, function (data) {
var params = getJSConfirmCommonParam(this);
$.get(url, params, function (data) {
if ($(".sqlqueryresults").length !== 0) {
$(".sqlqueryresults").remove();
}