clean up valueset in addAttributeDefintion()

will remove all spaces from each value in the valueset
This commit is contained in:
Uwe Steinmann 2016-10-07 11:38:04 +02:00
parent e0880e8ebd
commit 9bd1c111c8

View File

@ -1745,6 +1745,12 @@ class SeedDMS_Core_DMS {
}
if(!$type)
return false;
if(trim($valueset)) {
$valuesetarr = array_map('trim', explode($valueset[0], substr($valueset, 1)));
$valueset = $valueset[0].implode($valueset[0], $valuesetarr);
} else {
$valueset = '';
}
$queryStr = "INSERT INTO tblAttributeDefinitions (name, objtype, type, multiple, minvalues, maxvalues, valueset, regex) VALUES (".$this->db->qstr($name).", ".intval($objtype).", ".intval($type).", ".intval($multiple).", ".intval($minvalues).", ".intval($maxvalues).", ".$this->db->qstr($valueset).", ".$this->db->qstr($regex).")";
$res = $this->db->getResult($queryStr);
if (!$res)