bug #3411038 Zoom search and inserting foreign values

This commit is contained in:
Marc Delisle 2012-01-08 07:26:06 -05:00
parent 4a48e5d825
commit dcc9b2c71f
2 changed files with 10 additions and 2 deletions

View File

@ -95,9 +95,13 @@ require_once './libraries/header_scripts.inc.php';
var $inline = window.opener.jQuery('.browse_foreign_clicked');
if ($inline.length != 0) {
$inline.removeClass('browse_foreign_clicked')
// for grid editing,
// puts new value in the previous element which is
// a span with class curr_value
.prev().text(key);
.prev('.curr_value').text(key);
// for zoom-search editing, puts new value in the previous
// element which is an input field
$inline.prev('input[type=text]').val(key);
self.close();
return false;
}

View File

@ -167,7 +167,11 @@ function PMA_getForeignFields_Values($foreigners, $foreignData, $field, $tbl_fie
$str .= <<<EOT
<a target="_blank" onclick="window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes'); return false" href="browse_foreigners.php?
EOT;
$str .= '' . PMA_generate_common_url($db, $table) . '&amp;field=' . urlencode($field) . '&amp;fieldkey=' . $i . '">' . str_replace("'", "\'", $titles['Browse']) . '</a>';
$str .= '' . PMA_generate_common_url($db, $table) . '&amp;field=' . urlencode($field) . '&amp;fieldkey=' . $i . '"';
if ($in_edit) {
$str .= ' class="browse_foreign"';
}
$str .= '>' . str_replace("'", "\'", $titles['Browse']) . '</a>';
// ]]
$str .= '</script>';