mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-09 21:16:07 +00:00
getValueSetSeparator() returns ',' for type_user and type_group
This commit is contained in:
parent
96d89a76b7
commit
ce2ee995fc
|
@ -168,6 +168,7 @@ class SeedDMS_Core_Attribute { /* {{{ */
|
||||||
|
|
||||||
if(is_array($values)) {
|
if(is_array($values)) {
|
||||||
if($values) {
|
if($values) {
|
||||||
|
$vsep = $this->getValueSetSeparator();
|
||||||
if($valueset) {
|
if($valueset) {
|
||||||
$error = false;
|
$error = false;
|
||||||
foreach($values as $v) {
|
foreach($values as $v) {
|
||||||
|
@ -176,9 +177,9 @@ class SeedDMS_Core_Attribute { /* {{{ */
|
||||||
if($error)
|
if($error)
|
||||||
return false;
|
return false;
|
||||||
$valuesetstr = $this->_attrdef->getValueSet();
|
$valuesetstr = $this->_attrdef->getValueSet();
|
||||||
$value = $valuesetstr[0].implode($valuesetstr[0], $values);
|
$value = $vsep.implode($vsep, $values);
|
||||||
} else {
|
} else {
|
||||||
$value = ','.implode(',', $values);
|
$value = $vsep.implode($vsep, $values);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$value = '';
|
$value = '';
|
||||||
|
@ -649,10 +650,16 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
||||||
* @return string separator or an empty string if a value set is not set
|
* @return string separator or an empty string if a value set is not set
|
||||||
*/
|
*/
|
||||||
function getValueSetSeparator() { /* {{{ */
|
function getValueSetSeparator() { /* {{{ */
|
||||||
if(strlen($this->_valueset) > 1)
|
if(strlen($this->_valueset) > 1) {
|
||||||
return $this->_valueset[0];
|
return $this->_valueset[0];
|
||||||
else
|
} elseif($this->_multiple) {
|
||||||
|
if($this->_type == SeedDMS_Core_AttributeDefinition::type_user || $this->_type == SeedDMS_Core_AttributeDefinition::type_group)
|
||||||
|
return ',';
|
||||||
|
else
|
||||||
|
return '';
|
||||||
|
} else {
|
||||||
return '';
|
return '';
|
||||||
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue
Block a user