rfe #3141330 [relation] When displaying results, show a link to the foreign table even when phpMyAdmin configuration storage is not active

This commit is contained in:
Marc Delisle
2010-12-25 15:41:37 -05:00
parent 1059e281d1
commit 7d9313245b
2 changed files with 20 additions and 14 deletions

View File

@@ -125,6 +125,8 @@
thanks to garas - garas
- bug #3123433 [interface] Avoid double escaping of MySQL errors.
- [interface] Use less noisy message and remove disable link on server charts and database statistics.
+ rfe #3141330 [relation] When displaying results, show a link to the foreign
table even when phpMyAdmin configuration storage is not active
3.3.10.0 (not yet released)

View File

@@ -2014,20 +2014,24 @@ function PMA_displayTable(&$dt_result, &$the_disp_mode, $analyzed_sql)
}
$tabs = '(\'' . join('\',\'', $target) . '\')';
if ($cfgRelation['displaywork']) {
if (! strlen($table)) {
$exist_rel = false;
} else {
$exist_rel = PMA_getForeigners($db, $table, '', 'both');
if ($exist_rel) {
foreach ($exist_rel AS $master_field => $rel) {
$display_field = PMA_getDisplayField($rel['foreign_db'], $rel['foreign_table']);
$map[$master_field] = array($rel['foreign_table'],
$rel['foreign_field'],
$display_field,
$rel['foreign_db']);
} // end while
} // end if
if (! strlen($table)) {
$exist_rel = false;
} else {
// To be able to later display a link to the related table,
// we verify both types of relations: either those that are
// native foreign keys or those defined in the phpMyAdmin
// configuration storage. If no PMA storage, we won't be able
// to use the "column to display" notion (for example show
// the name related to a numeric id).
$exist_rel = PMA_getForeigners($db, $table, '', 'both');
if ($exist_rel) {
foreach ($exist_rel AS $master_field => $rel) {
$display_field = PMA_getDisplayField($rel['foreign_db'], $rel['foreign_table']);
$map[$master_field] = array($rel['foreign_table'],
$rel['foreign_field'],
$display_field,
$rel['foreign_db']);
} // end while
} // end if
} // end if
// end 2b