[FIX] Dictionnaries without rowid

It's possible to create a dictionnary without the key rowid.
But in that case it's impossible to enable/disable the value because the dictionnary fonctionality uses always rowid even another primary key is defined.

By this fix, the id property uses is the primary key defined on the dictionnary creation.
This commit is contained in:
De Coninck Laurent 2017-02-10 10:20:32 +01:00
parent 767e842c68
commit 4fb4bc6f6c

View File

@ -1537,7 +1537,8 @@ if ($id)
$canbemodified=$iserasable;
if ($obj->code == 'RECEP') $canbemodified=1;
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->rowid)?$obj->rowid:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'');
$rowidcol=$tabrowid[$id];
$url = $_SERVER["PHP_SELF"].'?'.($page?'page='.$page.'&':'').'sortfield='.$sortfield.'&sortorder='.$sortorder.'&rowid='.(! empty($obj->{$rowidcol})?$obj->{$rowidcol}:(! empty($obj->code)?$obj->code:'')).'&code='.(! empty($obj->code)?urlencode($obj->code):'');
if ($param) $url .= '&'.$param;
$url.='&';