Commit 63d4922c authored by Côme Chilliet's avatar Côme Chilliet

Merge branch...

Merge branch '5824-in-case-fd-not-find-a-mapping-for-supann-attribute-display-it-directly-in-place-of-empty' into '1.3-dev'

Resolve "In case FD not find a mapping for supann attribute display it directly in place of empty"

See merge request fusiondirectory/fd-plugins!237
parents 65242fba a25dcaf8
......@@ -44,6 +44,9 @@ class SupannPrefixedSelectAttribute extends CompositeAttribute
protected function supannUpdateSelect()
{
$prefix = $this->attributes[0]->getValue();
if (!isset($this->prefixedChoices[$prefix])) {
$this->prefixedChoices[$prefix] = array(array(), array());
}
$this->attributes[1]->setChoices($this->prefixedChoices[$prefix][0], $this->prefixedChoices[$prefix][1]);
$this->attributes[1]->setRequired($prefix != '');
}
......@@ -87,7 +90,12 @@ class SupannPrefixedSelectAttribute extends CompositeAttribute
}
$this->setValue($values);
$v1 = $this->attributes[0]->displayValue($values[0]);
$v2 = $this->attributes[1]->displayValue($values[1]);
$choices2 = $this->attributes[1]->getDisplayChoices();
if (isset($choices2[$values[1]])) {
$v2 = $choices2[$values[1]];
} else {
$v2 = $values[1];
}
return ($v1 == '' ? $v2 : $v1.': '.$v2);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment