Removed inline call to confirmLink() for 'Delete Tracking action'.

This commit is contained in:
ninadsp
2010-07-11 03:14:02 +05:30
parent d5ed68aa71
commit 505884174b
4 changed files with 41 additions and 3 deletions

View File

@@ -11,7 +11,12 @@
require_once './libraries/common.inc.php';
require_once './libraries/Table.class.php';
//Get some js files needed for Ajax
$GLOBALS['js_include'][] = 'jquery/jquery-ui-1.8.custom.js';
if($GLOBALS['is_ajax_request'] != true) {
require './libraries/db_common.inc.php';
}
$url_query .= '&goto=tbl_tracking.php&back=db_tracking.php';
// Get the database structure
@@ -25,6 +30,11 @@ require_once './libraries/relation.lib.php';
// (here, do not use $_REQUEST['db] as it can be crafted)
if (isset($_REQUEST['delete_tracking']) && isset($_REQUEST['table'])) {
PMA_Tracker::deleteTracking($GLOBALS['db'], $_REQUEST['table']);
if($GLOBALS['is_ajax_request'] == true) {
$message = PMA_Message::success();
PMA_ajaxResponse($message, true);
}
}
// Get tracked data about the database
@@ -117,7 +127,7 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) {
<td><?php echo $version_data['date_created'];?></td>
<td><?php echo $version_data['date_updated'];?></td>
<td><?php echo $version_status;?></td>
<td><a href="<?php echo $delete_link;?>" onclick="return confirmLink(this, '<?php echo PMA_jsFormat(__('Delete tracking data for this table'), false); ?>')"><?php echo $drop_image_or_text; ?></a></td>
<td><a class="drop_tracking_anchor" href="<?php echo $delete_link;?>" ><?php echo $drop_image_or_text; ?></a></td>
<td> <a href="<?php echo $tmp_link; ?>"><?php echo __('Versions');?></a>
| <a href="<?php echo $tmp_link; ?>&amp;report=true&amp;version=<?php echo $version_data['version'];?>"><?php echo __('Tracking report');?></a>
| <a href="<?php echo $tmp_link; ?>&amp;snapshot=true&amp;version=<?php echo $version_data['version'];?>"><?php echo __('Structure snapshot');?></a></td>

View File

@@ -1986,6 +1986,30 @@ $(document).ready(function() {
})
//end Drop Procedure
//Drop Tracking
$('.drop_tracking_anchor').live('click', function(event) {
event.preventDefault();
var curr_tracking_row = $(this).parents('tr');
var question = PMA_messages['strDeleteTrackingData'];
$(this).PMA_confirm(question, $(this).attr('href'), function(url) {
PMA_ajaxShowMessage(PMA_messages['strDeletingTrackingData']);
$.get(url, {'is_js_confirmed': 1, 'ajax_request': true}, function(data) {
if(data.success == true) {
PMA_ajaxShowMessage(data.message);
$(curr_tracking_row).hide("medium").remove();
}
else {
PMA_ajaxShowMessage(PMA_messages['strErrorProcessingRequest'] + " : " + data.error);
}
})
})
})
//end Drop Tracking
}, 'top.frame_content'); //end $(document).ready() for db_structure.php
/**

View File

@@ -31,6 +31,8 @@ $js_messages['strDoYouReally'] = __('Do you really want to ');
$js_messages['strDropDatabaseStrongWarning'] = __('You are about to DESTROY a complete database!');
$js_messages['strDroppingEvent'] = __('Dropping Event');
$js_messages['strDroppingProcedure'] = __('Dropping Procedure');
$js_messages['strDeleteTrackingData'] = __('Delete tracking data for this table');
$js_messages['strDeletingTrackingData'] = __('Deleting tracking data');
/* For blobstreaming */
$js_messages['strBLOBRepositoryDisableStrongWarning'] = __('You are about to DISABLE a BLOB Repository!');

View File

@@ -272,5 +272,7 @@ unset($each_table, $tbl_group_sql, $db_info_result);
/**
* Displays top menu links
*/
if($GLOBALS['is_ajax_request'] != true) {
require './libraries/db_links.inc.php';
}
?>