diff options
author | Marc Delisle <marc@infomarc.info> | 2009-12-28 02:05:45 +0300 |
---|---|---|
committer | Marc Delisle <marc@infomarc.info> | 2009-12-28 02:05:45 +0300 |
commit | 2eba839c338e3513d3dc61496700e6fdbcf94a50 (patch) | |
tree | 47b028b5b7f0c6052ac40500701cc6dbdf8699f0 /db_tracking.php | |
parent | 46826be01412ccc4473f3f50fd910bf8cfa7d471 (diff) |
new sub-feature: possibility of removing all tracking data for a table (useful for older tables that have been deleted from this database)
Diffstat (limited to 'db_tracking.php')
-rw-r--r-- | db_tracking.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/db_tracking.php b/db_tracking.php index 0ae8cbf528..799e96b1f0 100644 --- a/db_tracking.php +++ b/db_tracking.php @@ -20,6 +20,12 @@ require './libraries/db_info.inc.php'; // Get relation settings require_once './libraries/relation.lib.php'; +// Work to do? +// (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']); +} + // Get tracked data about the database $data = PMA_Tracker::getTrackedData($_REQUEST['db'], '', '1'); @@ -67,6 +73,7 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) { <th><?php echo $strTrackingThCreated;?></th> <th><?php echo $strTrackingThUpdated;?></th> <th><?php echo $strStatus;?></th> + <th><?php echo $strAction;?></th> <th><?php echo $strShow;?></th> </tr> </thead> @@ -75,6 +82,14 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) { // Print out information about versions + $drop_image_or_text = ''; + if (true == $GLOBALS['cfg']['PropertiesIconic']) { + $drop_image_or_text .= '<img class="icon" width="16" height="16" src="' . $pmaThemeImage . 'b_drop.png" alt="' . $strDeleteTrackingData . '" title="' . $strDeleteTrackingData . '" />'; + } + if ('both' === $GLOBALS['cfg']['PropertiesIconic'] || false === $GLOBALS['cfg']['PropertiesIconic']) { + $drop_image_or_text .= $strDrop; + } + $style = 'odd'; while ($one_result = PMA_DBI_fetch_array($all_tables_result)) { list($table_name, $version_number) = $one_result; @@ -92,6 +107,7 @@ if (PMA_DBI_num_rows($all_tables_result) > 0) { $version_status = $strTrackingStatusNotActive; } $tmp_link = 'tbl_tracking.php?' . $url_query . '&table=' . htmlspecialchars($version_data['table_name']); + $delete_link = 'db_tracking.php?' . $url_query . '&table=' . htmlspecialchars($version_data['table_name']) . '&delete_tracking=true&'; ?> <tr class="<?php echo $style;?>"> <td><?php echo htmlspecialchars($version_data['db_name']);?></td> @@ -100,6 +116,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($strDeleteTrackingData, false); ?>')"><?php echo $drop_image_or_text; ?></a></td> <td> <a href="<?php echo $tmp_link; ?>"><?php echo $strTrackingVersions;?></a> | <a href="<?php echo $tmp_link; ?>&report=true&version=<?php echo $version_data['version'];?>"><?php echo $strTrackingReport;?></a> | <a href="<?php echo $tmp_link; ?>&snapshot=true&version=<?php echo $version_data['version'];?>"><?php echo $strTrackingStructureSnapshot;?></a></td> |