return false;
}
$this->data_array = db_fetch_array($res);
+ $this->data_array['numberFiles'] = array();
db_free_result($res);
return true;
}
}
function getNumberOfDocuments($stateId = 1) {
+ if (isset($this->data_array['numberFiles'][$stateId]))
+ return $this->data_array['numberFiles'][$stateId];
+
$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);
+ $this->data_array['numberFiles'][$stateId] = $arr[0];
return $arr[0];
}
* @access public
*/
function getPath($url = false, $includename = true) {
+
$returnPath = '';
if ($this->getParentID()) {
$parentDg = new DocumentGroup($this->Group, $this->getParentID());
}
if ($includename) {
if ($url) {
- $returnPath .= '/'.util_make_link('/docman/?group_id='.$this->Group->getID().'&view=listfile&dirid='.$this->getID(),$this->getName(), array('title' => _('Browse this folder'), 'class' => 'tabtitle'));
+ $browselink = '/docman/?view=listfile&dirid='.$this->getID();
+ if (isset($GLOBALS['childgroup_id']) && $GLOBALS['childgroup_id']) {
+ $browselink .= '&childgroup_id='.$GLOBALS['childgroup_id'];
+ }
+ $browselink .= '&group_id='.$GLOBALS['group_id'];
+ $returnPath .= '/'.util_make_link($browselink, $this->getName(), array('title' => _('Browse this folder'), 'class' => 'tabtitle'));
} else {
$returnPath .= '/'.$this->getName();
}
}
- if (!sizeof($returnPath))
+ if (!strlen($returnPath))
$returnPath = '/';
return $returnPath;