$end) {
$tmp=$end;
$end=$begin;
$begin=$tmp;
$tmp=$rendered_end;
$rendered_end=$rendered_begin;
$rendered_begin=$tmp;
}
if (!$group_id) {
exit_no_group();
}
$group=group_get_object($group_id);
if (!$group || !is_object($group)) {
exit_permission_denied();
}
site_project_header(array('title'=>_('Activity'),'group'=>$group_id,'toptab'=>'activity'));
$ids=array();
$texts=array();
if ($GLOBALS['sys_use_forum'] && $group->usesForum ()) {
$ids[]='forumpost';
$texts[]=_('Forum Post');
}
if ($GLOBALS['sys_use_tracker'] && $group->usesTracker ()) {
$ids[]='trackeropen';
$texts[]=_('Tracker Opened');
$ids[]='trackerclose';
$texts[]=_('Tracker Closed');
}
if ($GLOBALS['sys_use_news'] && $group->usesNews ()) {
$ids[]='news';
$texts[]=_('News');
}
if ($GLOBALS['sys_use_scm'] && $group->usesSCM ()) {
$ids[]='commit';
$texts[]=_('Commits');
}
if ($GLOBALS['sys_use_frs'] && $group->usesFRS ()) {
$ids[]='frsrelease';
$texts[]=_('FRS Release');
}
if (count($show) < 1) {
$section=$ids;
} else {
$section=$show;
}
$res=db_query_params ('SELECT * FROM activity_vw WHERE activity_date BETWEEN $1 AND $2
AND group_id=$3 AND section = ANY ($4) ORDER BY activity_date DESC',
array($begin,
$end,
$group_id,
db_string_array_to_any_clause ($section)));
echo db_error();
$results = array();
while ($arr =& db_fetch_array($res)) {
$results[] = $arr;
}
// If plugins wants to add activities.
$hookParams['group'] = $group_id ;
$hookParams['results'] = &$results;
$hookParams['show'] = &$show;
$hookParams['begin'] = $begin;
$hookParams['end'] = $end;
$hookParams['ids'] = &$ids;
$hookParams['texts'] = &$texts;
plugin_hook ("activity", $hookParams) ;
if (count($show) < 1) {
$show=$ids;
}
foreach ($show as $showthis) {
if (array_search($showthis,$ids) === false) {
exit_error('Error','Invalid Data Passed to query');
}
}
$multiselect=html_build_multiple_select_box_from_arrays($ids,$texts,'show[]',$show,5,false);
?>
$b['activity_date']) ? -1 : 1;
}
usort($results, 'date_compare');
?>
listTableTop($theader);
$j=0;
$last_day = 0;
foreach ($results as $arr) {
if ($last_day != strftime($date_format,$arr['activity_date'])) {
// echo $HTML->listTableBottom($theader);
echo ''.strftime($date_format,$arr['activity_date']).' |
';
// echo $HTML->listTableTop($theader);
$last_day=strftime($date_format,$arr['activity_date']);
}
switch ($arr['section']) {
case 'commit': {
$icon=html_image("ic/cvs16b.png","20","20",array("border"=>"0","alt"=>"SCM"));
$url=util_make_link ('/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Commit for Tracker Item').' [#'.$arr['subref_id'].'] '.$arr['description']);
break;
}
case 'trackeropen': {
$icon=html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker'));
$url=util_make_link ('/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Tracker Item').' [#'.$arr['subref_id'].' '.$arr['description'].' ] '._('Opened'));
break;
}
case 'trackerclose': {
$icon=html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker'));
$url=util_make_link ('/tracker/?func=detail&atid='.$arr['ref_id'].'&aid='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Tracker Item').' [#'.$arr['subref_id'].' '.$arr['description'].' ] '._('Closed'));
break;
}
case 'frsrelease': {
$icon=html_image("ic/cvs16b.png","20","20",array("border"=>"0","alt"=>"SCM"));
$url=util_make_link ('/frs/?release_id='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('FRS Release').' '.$arr['description']);
break;
}
case 'forumpost': {
$icon=html_image("ic/forum20g.png","20","20",array("border"=>"0","alt"=>"Forum"));
$url=util_make_link ('/forum/message.php?msg_id='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Forum Post ').' '.$arr['description']);
break;
}
case 'news': {
$icon=html_image("ic/write16w.png","20","20",array("border"=>"0","alt"=>"News"));
$url=util_make_link ('/forum/forum.php?forum_id='.$arr['subref_id'],_('News').' '.$arr['description']);
break;
}
default: {
$icon = isset($arr['icon']) ? $arr['icon'] : '';
$url = ''.$arr['title'].'';
}
}
echo 'boxGetAltRowStyle($j++) . '>
'.date('H:i:s',$arr['activity_date']).' |
'.$icon .' '.$url.' | ';
if (isset($arr['user_name']) && $arr['user_name']) {
echo util_make_link_u($arr['user_name'],$arr['user_id'],$arr['realname']);
} else {
echo $arr['realname'];
}
echo ' |
';
}
echo $HTML->listTableBottom($theader);
}
}
site_project_footer(array());
?>