mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 13:42:04 +00:00
Merge branch 'seeddms-5.0.x' into seeddms-5.1.x
This commit is contained in:
commit
a8f5892562
|
@ -125,7 +125,17 @@ class SeedDMS_Core_Attribute { /* {{{ */
|
||||||
*/
|
*/
|
||||||
function getValueAsArray() { /* {{{ */
|
function getValueAsArray() { /* {{{ */
|
||||||
if($this->_attrdef->getMultipleValues()) {
|
if($this->_attrdef->getMultipleValues()) {
|
||||||
return explode($this->_value[0], substr($this->_value, 1));
|
/* If the value doesn't start with the separator used in the value set,
|
||||||
|
* then assume that the value was not saved with a leading separator.
|
||||||
|
* This can happen, if the value was previously a single value from
|
||||||
|
* the value set and later turned into a multi value attribute.
|
||||||
|
*/
|
||||||
|
$sep = substr($this->_value, 0, 1);
|
||||||
|
$vsep = $this->_attrdef->getValueSetSeparator();
|
||||||
|
if($sep == $vsep)
|
||||||
|
return(explode($sep, substr($this->_value, 1)));
|
||||||
|
else
|
||||||
|
return(array($this->_value));
|
||||||
} else {
|
} else {
|
||||||
return array($this->_value);
|
return array($this->_value);
|
||||||
}
|
}
|
||||||
|
@ -728,6 +738,35 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
|
||||||
return true;
|
return true;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Parse a given value according to attribute definition
|
||||||
|
*
|
||||||
|
* The return value is always an array, even if the attribute is single
|
||||||
|
* value attribute.
|
||||||
|
*
|
||||||
|
* @return array list of single values
|
||||||
|
*/
|
||||||
|
function parseValue($value) { /* {{{ */
|
||||||
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
if($this->getMultipleValues()) {
|
||||||
|
/* If the value doesn't start with the separator used in the value set,
|
||||||
|
* then assume that the value was not saved with a leading separator.
|
||||||
|
* This can happen, if the value was previously a single value from
|
||||||
|
* the value set and later turned into a multi value attribute.
|
||||||
|
*/
|
||||||
|
$sep = substr($value, 0, 1);
|
||||||
|
$vsep = $this->getValueSetSeparator();
|
||||||
|
if($sep == $vsep)
|
||||||
|
return(explode($sep, substr($value, 1)));
|
||||||
|
else
|
||||||
|
return(array($value));
|
||||||
|
} else {
|
||||||
|
return array($value);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a list of documents, folders, document contents where this
|
* Return a list of documents, folders, document contents where this
|
||||||
* attribute definition is used
|
* attribute definition is used
|
||||||
|
|
|
@ -136,7 +136,16 @@ class SeedDMS_Core_Object { /* {{{ */
|
||||||
$value = $this->_attributes[$attrdef->getId()]->getValue();
|
$value = $this->_attributes[$attrdef->getId()]->getValue();
|
||||||
if($attrdef->getMultipleValues()) {
|
if($attrdef->getMultipleValues()) {
|
||||||
$sep = substr($value, 0, 1);
|
$sep = substr($value, 0, 1);
|
||||||
return(explode($sep, substr($value, 1)));
|
$vsep = $attrdef->getValueSetSeparator();
|
||||||
|
/* If the value doesn't start with the separator used in the value set,
|
||||||
|
* then assume that the value was not saved with a leading separator.
|
||||||
|
* This can happen, if the value was previously a single value from
|
||||||
|
* the value set and later turned into a multi value attribute.
|
||||||
|
*/
|
||||||
|
if($sep == $vsep)
|
||||||
|
return(explode($sep, substr($value, 1)));
|
||||||
|
else
|
||||||
|
return(array($value));
|
||||||
} else {
|
} else {
|
||||||
return $value;
|
return $value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1128,6 +1128,7 @@ SeedDMS_Core_DMS::getNotificationsByUser() are deprecated
|
||||||
<notes>
|
<notes>
|
||||||
- new method SeedDMЅ_Core_WorkflowAction::getTransitions()
|
- new method SeedDMЅ_Core_WorkflowAction::getTransitions()
|
||||||
- new method SeedDMЅ_Core_WorkflowState::getTransitions()
|
- new method SeedDMЅ_Core_WorkflowState::getTransitions()
|
||||||
|
- new method SeedDMЅ_Core_AttributeDefinition::parseValue()
|
||||||
</notes>
|
</notes>
|
||||||
</release>
|
</release>
|
||||||
<release>
|
<release>
|
||||||
|
|
|
@ -92,8 +92,9 @@ $(document).ready( function() {
|
||||||
print "<th></th>\n";
|
print "<th></th>\n";
|
||||||
print "</tr></thead>\n<tbody>\n";
|
print "</tr></thead>\n<tbody>\n";
|
||||||
foreach($res['frequencies'][$type] as $entry) {
|
foreach($res['frequencies'][$type] as $entry) {
|
||||||
|
$value = $selattrdef->parseValue($entry['value']);
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>".$entry['value']."</td><td>".$entry['c']."</td>";
|
echo "<td>".implode(';', $value)."</td><td>".$entry['c']."</td>";
|
||||||
/* various checks, if the value is valid */
|
/* various checks, if the value is valid */
|
||||||
echo "<td>";
|
echo "<td>";
|
||||||
/* Check if value is in value set */
|
/* Check if value is in value set */
|
||||||
|
|
Loading…
Reference in New Issue
Block a user