diff --git a/ChangeLog b/ChangeLog index 603d7ff0bd..623051c40b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,7 @@ phpMyAdmin - ChangeLog - bug #4741 in ./libraries/Advisor.class.php#184 vsprintf(): Too few arguments - bug #4743 Unable to move cursor with keyboard in filter rows box - bug Incorrect link in doc +- bug #4745 Tracking does not handle views properly 4.3.8.0 (2015-01-24) - bug Undefined constant PMA_DRIZZLE diff --git a/libraries/tracking.lib.php b/libraries/tracking.lib.php index 3b9fda63b1..98f7ebfe96 100644 --- a/libraries/tracking.lib.php +++ b/libraries/tracking.lib.php @@ -47,11 +47,12 @@ function PMA_filterTracking( * @param int $last_version last version * @param string $db database * @param array $selected selected tables + * @param string $type type of the table; table, view or both * * @return string */ function PMA_getHtmlForDataDefinitionAndManipulationStatements($url_query, - $last_version, $db, $selected + $last_version, $db, $selected, $type = 'both' ) { $html = '
'; $html .= '
'; @@ -77,31 +78,54 @@ function PMA_getHtmlForDataDefinitionAndManipulationStatements($url_query, . '" />'; $html .= '

' . __('Track these data definition statements:') . '

'; - $html .= ' ALTER TABLE
'; - $html .= ' RENAME TABLE
'; - $html .= ' CREATE TABLE
'; - $html .= ' DROP TABLE
'; + + if ($type == 'both' || $type == 'table') { + $html .= ' ALTER TABLE
'; + $html .= ' RENAME TABLE
'; + $html .= ' CREATE TABLE
'; + $html .= ' DROP TABLE
'; + } elseif ($type == 'both' || $type == 'view') { + $html .= ' ALTER VIEW
'; + $html .= ' DROP VIEW
'; + $html .= ' CREATE VIEW
'; + } $html .= '
'; + $html .= ' 0) { ); } +$type = PMA_Table::isView($GLOBALS['db'], $GLOBALS['table']) ? 'view' : 'table'; $html .= PMA_getHtmlForDataDefinitionAndManipulationStatements( 'tbl_tracking.php' . $url_query, $last_version, $GLOBALS['db'], - array($GLOBALS['table']) + array($GLOBALS['table']), + $type ); $html .= '
';