*
* Copyright 2011-2012, Franck Villaume - TrivialDev
* Copyright (C) 2012 Alain Peyrat - Alcatel-Lucent
+ * Copyright 2013, French Ministry of National 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()) {
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>';
}
case "json": {
$returnString = '{';
for ($i=0; $i<$rows; $i++) {
- $returnString .= '\''.util_html_secure($text_array[$i]).'\':'.$id_array[$i].',';
+ $returnString .= '\''.util_html_secure(addslashes($text_array[$i]).'\':'.$id_array[$i].',';
}
$returnString .= '}';
break;
}
}
+ /**
+ * 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;
+ }
}