added unique key case to build urls used in browse mode for deleting/editing a record

This commit is contained in:
Loïc Chapeaux
2001-10-12 19:48:48 +00:00
parent d90288719c
commit b45537335d
2 changed files with 9 additions and 2 deletions

View File

@@ -22,6 +22,8 @@ $Source$
setting.
* tbl_qbe.php3: fixed lots of warnings reported by Steve.
* left.php3, line 66: removed a too restrictive test.
* display_tbl.lib.php3: added unique key case to build urls used in browse
mode for deleting/editing a record.
2001-10-09 Lo<4C>c Chapeaux <lolo@phpheaven.net>
* user_details.php3, lines 1232-1245 & 1254: fixed some bugs with modifying

View File

@@ -611,6 +611,7 @@ if (!defined('__LIB_DISPLAY_TBL__')){
// 1. Prepares the row (gets primary keys to use)
if ($is_display['edit_lnk'] != 'nn' || $is_display['del_lnk'] != 'nn') {
$primary_key = '';
$unique_key = '';
$uva_nonprimary_condition = '';
// 1.1 Results from a "SELECT" statement -> builds the
@@ -626,15 +627,19 @@ if (!defined('__LIB_DISPLAY_TBL__')){
}
if ($primary->primary_key > 0) {
$primary_key .= $condition;
} else if ($primary->unique_key > 0) {
$unique_key .= $condition;
}
$uva_nonprimary_condition .= $condition;
} // end for
// Correction uva 19991216: prefer primary keys for
// condition, but use conjunction of all values if no
// Correction uva 19991216: prefer primary or unique keys
// for condition, but use conjunction of all values if no
// primary key
if ($primary_key) {
$uva_condition = $primary_key;
} else if ($unique_key) {
$uva_condition = $unique_key;
} else {
$uva_condition = $uva_nonprimary_condition;
}