This is not a primary key but a row number
This commit is contained in:
@@ -39,13 +39,13 @@ if (isset($foreign_navig) && $foreign_navig == __('Show all')) {
|
||||
|
||||
$foreignData = PMA_getForeignData($foreigners, $field, $override_total, isset($foreign_filter) ? $foreign_filter : '', $foreign_limit);
|
||||
|
||||
if (isset($pk)) {
|
||||
$pk_uri = '&pk=' . urlencode($pk);
|
||||
if (isset($rownumber)) {
|
||||
$rownumber_param = '&rownumber=' . urlencode($rownumber);
|
||||
?>
|
||||
<input type="hidden" name="pk" value="<?php echo htmlspecialchars($pk); ?>" />
|
||||
<input type="hidden" name="rownumber" value="<?php echo htmlspecialchars($rownumber); ?>" />
|
||||
<?php
|
||||
} else {
|
||||
$pk_uri = '';
|
||||
$rownumber_param = '';
|
||||
}
|
||||
|
||||
$gotopage = '';
|
||||
@@ -65,7 +65,7 @@ if (is_array($foreignData['disp_row'])) {
|
||||
$gotopage = PMA_pageselector(
|
||||
'browse_foreigners.php?field=' . urlencode($field) .
|
||||
'&' . PMA_generate_common_url($db, $table)
|
||||
. $pk_uri .
|
||||
. $rownumber_param .
|
||||
'&fieldkey=' . (isset($fieldkey) ? urlencode($fieldkey) : '') .
|
||||
'&foreign_filter=' . (isset($foreign_filter) ? urlencode($foreign_filter) : '') .
|
||||
'&',
|
||||
@@ -102,8 +102,8 @@ if (is_array($foreignData['disp_row'])) {
|
||||
if (opener && opener.document && opener.document.insertForm) {
|
||||
var field = 'fields';
|
||||
|
||||
<?php if (isset($pk)) { ?>
|
||||
var element_name = field + '[multi_edit][<?php echo htmlspecialchars($pk); ?>][' + fieldmd5 + ']';
|
||||
<?php if (isset($rownumber)) { ?>
|
||||
var element_name = field + '[multi_edit][<?php echo htmlspecialchars($rownumber); ?>][' + fieldmd5 + ']';
|
||||
<?php } else { ?>
|
||||
var element_name = field + '[]';
|
||||
<?php } ?>
|
||||
@@ -141,8 +141,8 @@ if (is_array($foreignData['disp_row'])) {
|
||||
<input type="hidden" name="field" value="<?php echo htmlspecialchars($field); ?>" />
|
||||
<input type="hidden" name="fieldkey"
|
||||
value="<?php echo isset($fieldkey) ? htmlspecialchars($fieldkey) : ''; ?>" />
|
||||
<?php if (isset($pk)) { ?>
|
||||
<input type="hidden" name="pk" value="<?php echo htmlspecialchars($pk); ?>" />
|
||||
<?php if (isset($rownumber)) { ?>
|
||||
<input type="hidden" name="rownumber" value="<?php echo htmlspecialchars($rownumber); ?>" />
|
||||
<?php } ?>
|
||||
<span class="formelement">
|
||||
<label for="input_foreign_filter"><?php echo __('Search') . ':'; ?></label>
|
||||
|
@@ -430,10 +430,10 @@ $(document).ready(function() {
|
||||
.find('.foreign_values_anchor')
|
||||
.each(function() {
|
||||
$anchor = $(this);
|
||||
var new_value = 'pk=' + new_row_index;
|
||||
var new_value = 'rownumber=' + new_row_index;
|
||||
// needs improvement in case something else inside
|
||||
// the href contains this pattern
|
||||
var new_href = $anchor.attr('href').replace(/pk=\d+/, new_value);
|
||||
var new_href = $anchor.attr('href').replace(/rownumber=\d+/, new_value);
|
||||
$anchor.attr('href', new_href );
|
||||
});
|
||||
|
||||
|
@@ -285,7 +285,7 @@ foreach ($rows as $row_id => $vrow) {
|
||||
}
|
||||
|
||||
$jsvkey = $row_id;
|
||||
$browse_foreigners_uri = '&pk=' . $row_id;
|
||||
$rownumber_param = '&rownumber=' . $row_id;
|
||||
$vkey = '[multi_edit][' . $jsvkey . ']';
|
||||
|
||||
$vresult = (isset($result) && is_array($result) && isset($result[$row_id]) ? $result[$row_id] : $result);
|
||||
@@ -659,7 +659,7 @@ foreach ($rows as $row_id => $vrow) {
|
||||
tabindex="<?php echo ($tabindex + $tabindex_for_value); ?>"
|
||||
id="field_<?php echo ($idindex); ?>_3"
|
||||
value="<?php echo htmlspecialchars($data); ?>" />
|
||||
<a class="hide foreign_values_anchor" target="_blank" onclick="window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes,resizable=yes'); return false;" href="browse_foreigners.php?<?php echo PMA_generate_common_url($db, $table); ?>&field=<?php echo PMA_escapeJsString(urlencode($field['Field']) . $browse_foreigners_uri); ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a>
|
||||
<a class="hide foreign_values_anchor" target="_blank" onclick="window.open(this.href, 'foreigners', 'width=640,height=240,scrollbars=yes,resizable=yes'); return false;" href="browse_foreigners.php?<?php echo PMA_generate_common_url($db, $table); ?>&field=<?php echo PMA_escapeJsString(urlencode($field['Field']) . $rownumber_param); ?>"><?php echo str_replace("'", "\'", $titles['Browse']); ?></a>
|
||||
<?php
|
||||
} elseif (is_array($foreignData['disp_row'])) {
|
||||
echo $backup_field . "\n";
|
||||
|
Reference in New Issue
Block a user