}
}
+ function getNumberOfDocuments($stateId = 1) {
+ $res = db_query_params('select count(*) from docdata_vw where doc_group = $1 and group_id = $2 and stateid = $3',
+ array($this->getID(), $this->Group->getID(), $stateId));
+ if (!$res) {
+ return 0;
+ }
+ $arr = db_fetch_array($res);
+ return $arr[0];
+ }
+
/**
* hasSubgroup - Checks if this group has a specified subgroup associated to it
*
} else {
$link = '/docman/?group_id='.$this->Group->getID().'&view='.$linkmenu.'&dirid='.$localDg->getID();
}
- echo '<li class="'.$liclass.'">'.util_make_link($link, $localDg->getName()).'</li>';
+ $nbDocsLabel = '';
+ $nbDocs = $localDg->getNumberOfDocuments();
+ if ($nbDocs) {
+ $nbDocsLabel = ' ('.$nbDocs.')';
+ }
+ echo '<li class="'.$liclass.'">'.util_make_link($link, $localDg->getName()).$nbDocsLabel.'</li>';
$this->getTree($selecteddir, $linkmenu, $subGroupIdValue);
}
echo '</ul>';