diff --git a/dev/resources/dbmodel/dolibarr_schema.mwb b/dev/resources/dbmodel/dolibarr_schema.mwb index 27bc4ab2403..37929762bab 100644 Binary files a/dev/resources/dbmodel/dolibarr_schema.mwb and b/dev/resources/dbmodel/dolibarr_schema.mwb differ diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index af0a625875f..eb360b4a328 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -5874,8 +5874,14 @@ abstract class CommonObject } elseif (preg_match('/^(integer|link):(.*):(.*)/i', $val['type'], $reg)) { $param['options'] = array($reg[2].':'.$reg[3] => 'N'); $type = 'link'; - } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { - $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); + } elseif (preg_match('/^(sellist):(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4].':'.$reg[5] => 'N'); + $type = 'sellist'; + } elseif (preg_match('/^(sellist):(.*):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[2].':'.$reg[3].':'.$reg[4] => 'N'); + $type = 'sellist'; + } elseif (preg_match('/^(sellist):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[2].':'.$reg[3] => 'N'); $type = 'sellist'; } elseif (preg_match('/varchar\((\d+)\)/', $val['type'], $reg)) { $param['options'] = array(); @@ -6042,24 +6048,20 @@ abstract class CommonObject $keyList = (empty($InfoFieldList[2]) ? 'rowid' : $InfoFieldList[2].' as rowid'); - if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) - { - if (strpos($InfoFieldList[4], 'extra.') !== false) - { + if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { + if (strpos($InfoFieldList[4], 'extra.') !== false) { $keyList = 'main.'.$InfoFieldList[2].' as rowid'; } else { $keyList = $InfoFieldList[2].' as rowid'; } } - if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) - { + if (count($InfoFieldList) > 3 && !empty($InfoFieldList[3])) { list($parentName, $parentField) = explode('|', $InfoFieldList[3]); $keyList .= ', '.$parentField; } $fields_label = explode('|', $InfoFieldList[1]); - if (is_array($fields_label)) - { + if (is_array($fields_label)) { $keyList .= ', '; $keyList .= implode(', ', $fields_label); } @@ -6454,13 +6456,18 @@ abstract class CommonObject $param['options'] = array(); if (!empty($val['arrayofkeyval']) && is_array($val['arrayofkeyval'])) $param['options'] = $val['arrayofkeyval']; - if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) - { + if (preg_match('/^integer:(.*):(.*)/i', $val['type'], $reg)) { $type = 'link'; $param['options'] = array($reg[1].':'.$reg[2]=>$reg[1].':'.$reg[2]); } elseif (preg_match('/^sellist:(.*):(.*):(.*):(.*)/i', $val['type'], $reg)) { $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3].':'.$reg[4] => 'N'); $type = 'sellist'; + } elseif (preg_match('/^sellist:(.*):(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[1].':'.$reg[2].':'.$reg[3] => 'N'); + $type = 'sellist'; + } elseif (preg_match('/^sellist:(.*):(.*)/i', $val['type'], $reg)) { + $param['options'] = array($reg[1].':'.$reg[2] => 'N'); + $type = 'sellist'; } $langfile = $val['langfile']; @@ -6551,8 +6558,7 @@ abstract class CommonObject $selectkey = "rowid"; $keyList = 'rowid'; - if (count($InfoFieldList) >= 3) - { + if (count($InfoFieldList) > 4 && !empty($InfoFieldList[4])) { $selectkey = $InfoFieldList[2]; $keyList = $InfoFieldList[2].' as rowid'; } diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php index a8b9bab087b..808a1cd0043 100644 --- a/htdocs/core/class/html.form.class.php +++ b/htdocs/core/class/html.form.class.php @@ -6720,7 +6720,7 @@ class Form // Add code for jquery to use multiselect if (!empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) || defined('REQUIRE_JQUERY_MULTISELECT')) { - $out .= "\n".' + $out .= "\n".'