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
diff options
context:
space:
mode:
authorDeven Bansod <devenbansod.bits@gmail.com>2015-05-06 16:18:05 +0300
committerDeven Bansod <devenbansod.bits@gmail.com>2015-05-11 03:30:20 +0300
commitd00fe5cf6a25ae448f1dd1d0b183c624f29625cb (patch)
tree55c106990a9107522a94527e30010ea51945e2d1 /js/tbl_operations.js
parent4d02033f47e139e92a074eec701f629a00bfd6a8 (diff)
RFE #1485 : Add a DROP/ COALESCE Partition option in Partition Maintenance
Signed-off-by: Deven Bansod <devenbansod.bits@gmail.com>
Diffstat (limited to 'js/tbl_operations.js')
-rw-r--r--js/tbl_operations.js47
1 files changed, 47 insertions, 0 deletions
diff --git a/js/tbl_operations.js b/js/tbl_operations.js
index 56e60162b9..85eebd8999 100644
--- a/js/tbl_operations.js
+++ b/js/tbl_operations.js
@@ -5,6 +5,7 @@ AJAX.registerTeardown('tbl_operations.js', function () {
$(document).off('submit', "#copyTable.ajax");
$(document).off('submit', "#moveTableForm");
$(document).off('submit', "#tableOptionsForm");
+ $(document).off('submit', "#partitionsForm");
$(document).off('click', "#tbl_maintenance li a.maintain_action.ajax");
$(document).off('click', "#drop_tbl_anchor.ajax");
$(document).off('click', "#drop_view_anchor.ajax");
@@ -140,6 +141,52 @@ AJAX.registerOnload('tbl_operations.js', function () {
}); // end $.post()
});//end of table maintenance ajax click
+ /**
+ * Ajax action for submitting the "Partition Maintenance"
+ * Also, asks for confirmation when DROP partition is submitted
+ */
+ $(document).on('submit', "#partitionsForm", function (event) {
+ event.preventDefault();
+ var $form = $(this);
+ var db = $form.find('input[name=db]').val();
+ var tbl = $form.find('input[name=table]').val();
+ PMA_prepareForAjaxRequest($form);
+ var question = PMA_messages.strDropPartitionWarning;
+ var processingString = PMA_messages.strProcessingRequest;
+
+ if($('#partition_operation_DROP').is(':checked')) {
+ $(this).PMA_confirm(question, $form.attr('action'), function (url) {
+ $.post($form.attr('action'), $form.serialize(), function (data) {
+ if (typeof data !== 'undefined' && data.success === true) {
+ PMA_commonParams.set('db', db);
+ PMA_commonParams.set('table', tbl);
+ PMA_commonActions.refreshMain(false, function () {
+ $('#page_content').html(data.message);
+ PMA_highlightSQL($('#page_content'));
+ });
+ } else {
+ PMA_ajaxShowMessage(data.error, false);
+ }
+ });
+ });
+ }
+ else {
+ PMA_ajaxShowMessage(processingString);
+ $.post($form.attr('action'), $form.serialize(), function (data) {
+ if (typeof data !== 'undefined' && data.success === true) {
+ PMA_commonParams.set('db', db);
+ PMA_commonParams.set('table', tbl);
+ PMA_commonActions.refreshMain(false, function () {
+ $('#page_content').html(data.message);
+ PMA_highlightSQL($('#page_content'));
+ });
+ } else {
+ PMA_ajaxShowMessage(data.error, false);
+ }
+ });
+ }
+ });
+
$(document).on('click', "#drop_tbl_anchor.ajax", function (event) {
event.preventDefault();
/**