*
* Copyright 2011-2012, Franck Villaume - TrivialDev
* Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, French Ministry of Education
* http://fusionforge.org
*
* This file is part of FusionForge. FusionForge is free software;
function __construct(&$Group) {
$this->Error();
if (!$Group || !is_object($Group)) {
- $this->setNotValidGroupObjectError();
+ $this->setError('DocumentManager:: '. _('No Valid Group Object'));
return false;
}
if ($Group->isError()) {
if (isset($nbDocsTrashed)) {
$nbDocsLabel = '<span class="tabtitle-nw" title="'._('Number of deleted documents in this folder').'" >('.$nbDocsTrashed.')</span>';
}
- $user = user_get_object($localDg->getCreated_by());
- $lititle = _('Created_by:').$user->getRealName()._('; Last modified:').date(_('Y-m-d H:i'), $localDg->getLastModifyDate());
- echo '<li id="leaf-'.$subGroupIdValue.'" class="'.$liclass.'">'.util_make_link($link, $localDg->getName(), array('class'=>'tabtitle-nw', 'title'=>$lititle)).$nbDocsLabel;
+ if ($localDg->getName() != '.trash') {
+ $user = user_get_object($localDg->getCreated_by());
+ $lititle = _('Created_by:').$user->getRealName()._('; Last modified:').date(_('Y-m-d H:i'), $localDg->getLastModifyDate());
+ echo '<li id="leaf-'.$subGroupIdValue.'" class="'.$liclass.'">'.util_make_link($link, $localDg->getName(), array('class'=>'tabtitle-nw', 'title'=>$lititle)).$nbDocsLabel;
+ } else {
+ echo '<li id="leaf-'.$subGroupIdValue.'" class="'.$liclass.'">'.util_make_link($link, $localDg->getName()).$nbDocsLabel;
+ }
if ($dg->getSubgroup($subGroupIdValue, $stateId)) {
- echo '<ul>';
+ echo '<ul class="simpleTreeMenu" >';
$this->getTree($selecteddir, $linkmenu, $subGroupIdValue);
echo '</ul>';
}
}
}
+ /**
+ * getActivity - return the number of searched actions per sections between two dates
+ *
+ * @param array Sections to search for activity
+ * @param int the start date time format time()
+ * @param int the end date time format time()
+ * @return array number per section of activities found between begin and end values
+ */
+ function getActivity($sections, $begin, $end) {
+ $qpa = db_construct_qpa(false);
+ for ($i = 0; $i < count($sections); $i++) {
+ $union = 0;
+ if (count($sections) >= 1 && $i != count($sections) -1) {
+ $union = 1;
+ }
+ $qpa = db_construct_qpa($qpa, 'SELECT count(*) FROM activity_vw WHERE activity_date BETWEEN $1 AND $2
+ AND group_id = $3 AND section = $4 ',
+ array($begin,
+ $end,
+ $this->getGroup()->getID(),
+ $sections[$i]));
+ if ($union) {
+ $qpa = db_construct_qpa($qpa, ' UNION ALL ', array());
+ }
+ }
+ $res = db_query_qpa($qpa);
+ $results = array();
+ $j = 0;
+ while ($arr = db_fetch_array($res)) {
+ $results[$sections[$j]] = $arr['0'];
+ $j++;
+ }
+ return $results;
+ }
}
-
-?>