bug 619100

This commit is contained in:
Marc Delisle
2002-11-23 18:20:07 +00:00
parent 7a6baeee65
commit 53b983c17d
2 changed files with 23 additions and 9 deletions

View File

@@ -9,6 +9,8 @@ $Source$
* libraries/display_tbl.lib.php3: clicking on a COUNT() column to sort * libraries/display_tbl.lib.php3: clicking on a COUNT() column to sort
* read_dump.php3: bug 634074: we now use is_writeable() on the tmp * read_dump.php3: bug 634074: we now use is_writeable() on the tmp
subdir, instead of looking for a dot in the open_basedir path subdir, instead of looking for a dot in the open_basedir path
* tbl_relation.php3: show a field in "Links to" if it has been defined
manually in the relationtable, even if it's not a key in the foreign table
2002-11-22 Marc Delisle <lem9@users.sourceforge.net> 2002-11-22 Marc Delisle <lem9@users.sourceforge.net>
* libraries/display_tbl.lib.php3: numeric foreign keys used as alias * libraries/display_tbl.lib.php3: numeric foreign keys used as alias

View File

@@ -236,22 +236,34 @@ if ($col_rs && mysql_num_rows($col_rs) > 0) {
<?php <?php
echo "\n"; echo "\n";
reset($selectboxall); reset($selectboxall);
while (list($key, $value) = each($selectboxall)) {
$myfield = $save_row[$i]['Field']; $myfield = $save_row[$i]['Field'];
if (isset($existrel[$myfield])) { if (isset($existrel[$myfield])) {
$test = $existrel[$myfield]['foreign_db'] . '.' $foreign_field = $existrel[$myfield]['foreign_db'] . '.'
. $existrel[$myfield]['foreign_table'] . '.' . $existrel[$myfield]['foreign_table'] . '.'
. $existrel[$myfield]['foreign_field']; . $existrel[$myfield]['foreign_field'];
} else { } else {
$test = FALSE; $foreign_field = FALSE;
} }
$seen_key = FALSE;
while (list($key, $value) = each($selectboxall)) {
echo ' ' echo ' '
. '<option value="' . htmlspecialchars($key) . '"'; . '<option value="' . htmlspecialchars($key) . '"';
if ($test && $key == $test) { if ($foreign_field && $key == $foreign_field) {
echo ' selected="selected"'; echo ' selected="selected"';
$seen_key = TRUE;
} }
echo '>' . $value . '</option>'. "\n"; echo '>' . $value . '</option>'. "\n";
} // end while } // end while
// if the link defined in relationtable points to a foreign field
// that is not a key in the foreign table, we show the link
// (will not be shown with an arrow)
if ($foreign_field && !$seen_key) {
echo ' '
. '<option value="' . htmlspecialchars($foreign_field) . '"';
echo ' selected="selected"';
echo '>' . $foreign_field . '</option>'. "\n";
}
?> ?>
</select> </select>
</td> </td>