From 8c34269e520aaba4ddbba25e938d5338db4eed7d Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 7 Oct 2010 20:32:07 +0200 Subject: [PATCH 1/3] bug #3062454, Display routines/events also when no tables are defined --- ChangeLog | 1 + db_structure.php | 44 +++++++++++++++++++++-------------- libraries/db_events.inc.php | 2 +- libraries/db_routines.inc.php | 2 +- 4 files changed, 29 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6f020bb41..f9520b72f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA - bug #3062455 [export] with SQL, export procedures and routines before tables - bug #3056023 [import] USE query not working - bug #3038193 [display] Error when editing row with GEOMETRY column +- bug #3062454 [interface] Display routines/events also when no tables are defined 3.3.7.0 (2010-09-07) - patch #3050492 [PDF scratchboard] Cannot drag table box to the edge after diff --git a/db_structure.php b/db_structure.php index 2171ea5b11..7e5d70fd97 100644 --- a/db_structure.php +++ b/db_structure.php @@ -46,24 +46,6 @@ if (empty($is_info)) { require_once './libraries/replication.inc.php'; } -// 1. No tables -if ($num_tables == 0) { - echo '

' . $strNoTablesFound . '

' . "\n"; - - if (empty($db_is_information_schema)) { - require './libraries/display_create_table.lib.php'; - } // end if (Create Table dialog) - - /** - * Displays the footer - */ - require_once './libraries/footer.inc.php'; - exit; -} - -// else -// 2. Shows table informations - staybyte - 11 June 2001 - require_once './libraries/bookmark.lib.php'; require_once './libraries/mysql_charsets.lib.php'; @@ -113,6 +95,32 @@ if (true == $cfg['PropertiesIconic']) { $titles['NoEmpty'] = $strEmpty; } +// 1. No tables +if ($num_tables == 0) { + echo '

' . $strNoTablesFound . '

' . "\n"; + + // Routines + require './libraries/db_routines.inc.php'; + + // Events + if (PMA_MYSQL_INT_VERSION > 50100) { + require './libraries/db_events.inc.php'; + } + + if (empty($db_is_information_schema)) { + require './libraries/display_create_table.lib.php'; + } // end if (Create Table dialog) + + /** + * Displays the footer + */ + require_once './libraries/footer.inc.php'; + exit; +} + +// else +// 2. Shows table informations + /** * Displays the tables list */ diff --git a/libraries/db_events.inc.php b/libraries/db_events.inc.php index 9ff5f760c1..64298ecee4 100644 --- a/libraries/db_events.inc.php +++ b/libraries/db_events.inc.php @@ -50,7 +50,7 @@ if ($events) { ', ($ct%2 == 0) ? 'even' : 'odd', $event['EVENT_NAME'], - ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', + ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&db_query_force=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', '' . $titles['Drop'] . '', $event['EVENT_TYPE']); $ct++; diff --git a/libraries/db_routines.inc.php b/libraries/db_routines.inc.php index 29c1ccdbff..96da080c3a 100644 --- a/libraries/db_routines.inc.php +++ b/libraries/db_routines.inc.php @@ -79,7 +79,7 @@ if ($routines) { ', ($ct%2 == 0) ? 'even' : 'odd', $routine['ROUTINE_NAME'], - ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', + ! empty($definition) ? PMA_linkOrButton('db_sql.php?' . $url_query . '&sql_query=' . urlencode($definition) . '&show_query=1&db_query_force=1&delimiter=' . urlencode($delimiter), $titles['Structure']) : ' ', '' . $titles['Drop'] . '', $routine['ROUTINE_TYPE'], $routine['DTD_IDENTIFIER']); From 7f41f94a0e93a8c2eaaabe3754f9ae3a9d7bb5e4 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Thu, 7 Oct 2010 15:12:45 -0400 Subject: [PATCH 2/3] gettext-style message --- db_structure.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db_structure.php b/db_structure.php index 61934a2b84..c4a55179da 100644 --- a/db_structure.php +++ b/db_structure.php @@ -56,7 +56,7 @@ require_once './libraries/build_action_titles.inc.php'; // 1. No tables if ($num_tables == 0) { - echo '

' . $strNoTablesFound . '

' . "\n"; + echo '

' . __('No tables found in database') . '

' . "\n"; // Routines require './libraries/db_routines.inc.php'; From 2d7cbdfc4d6ad9066dad49918ed710f872e59020 Mon Sep 17 00:00:00 2001 From: Dieter Adriaenssens Date: Thu, 7 Oct 2010 21:15:40 +0200 Subject: [PATCH 3/3] parameter is already added to url --- libraries/db_events.inc.php | 5 ----- libraries/db_routines.inc.php | 5 ----- 2 files changed, 10 deletions(-) diff --git a/libraries/db_events.inc.php b/libraries/db_events.inc.php index 64298ecee4..d386170398 100644 --- a/libraries/db_events.inc.php +++ b/libraries/db_events.inc.php @@ -9,11 +9,6 @@ if (! defined('PHPMYADMIN')) { exit; } -/** - * Append goto to ulr_query. - */ -$url_query .= '&goto=db_structure.php'; - $events = PMA_DBI_fetch_result('SELECT EVENT_NAME, EVENT_TYPE FROM information_schema.EVENTS WHERE EVENT_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';'); if ($events) { diff --git a/libraries/db_routines.inc.php b/libraries/db_routines.inc.php index 96da080c3a..f912ae0679 100644 --- a/libraries/db_routines.inc.php +++ b/libraries/db_routines.inc.php @@ -19,11 +19,6 @@ if (! defined('PHPMYADMIN')) { exit; } -/** - * Append goto to ulr_query. - */ -$url_query .= '&goto=db_structure.php'; - $routines = PMA_DBI_fetch_result('SELECT SPECIFIC_NAME,ROUTINE_NAME,ROUTINE_TYPE,DTD_IDENTIFIER FROM information_schema.ROUTINES WHERE ROUTINE_SCHEMA= \'' . PMA_sqlAddslashes($db,true) . '\';'); if ($routines) {