init possible values of attribute in getStatistic()

This commit is contained in:
Uwe Steinmann 2021-09-28 16:19:25 +02:00
parent 9b986e16c5
commit b8763822d0

View File

@ -936,6 +936,11 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
}
}
}
$valueset = $this->getValueSetAsArray();
$possiblevalues = array();
foreach($valueset as $value) {
$possiblevalues[md5($value)] = array('value'=>$value, 'c'=>0);
}
$queryStr = "SELECT count(*) c, `value` FROM `tblDocumentAttributes` WHERE `attrdef`=".$this->_id." GROUP BY `value` ORDER BY c DESC";
$resArr = $db->getResultArray($queryStr);
if($resArr) {
@ -1052,7 +1057,7 @@ class SeedDMS_Core_AttributeDefinition { /* {{{ */
* @param integer $limit limit number of documents/folders
* @return array array containing list of documents and folders
*/
public function getObjects($attrvalue, $limit='') { /* {{{ */
public function getObjects($attrvalue, $limit=0) { /* {{{ */
$db = $this->_dms->getDB();
$result = array('docs'=>array(), 'folders'=>array(), 'contents'=>array());