3 * Project Activity Page
5 * Copyright 2006 (c) GForge, LLC
11 require_once('../env.inc.php');
12 require_once $gfwww.'include/pre.php';
16 Written by dtype Oct. 1999
18 $group_id = getIntFromRequest("group_id");
19 $received_begin = getStringFromRequest("start_date");
20 $received_end = getStringFromRequest("end_date");
21 $show=getArrayFromRequest("show");
23 $date_format = _('%Y-%m-%d') ;
25 if (!$received_begin || $received_begin==0) {
26 $begin = (time()-(30*86400));
27 $rendered_begin = strftime($date_format, $begin) ;
29 $tmp = strptime ($received_begin, $date_format);
31 $begin = (time()-(30*86400));
32 $rendered_begin = strftime($date_format, $begin) ;
34 $begin = mktime (0,0,0,$tmp['tm_mon']+1,$tmp['tm_mday'],$tmp['tm_year']);
35 $rendered_begin = $received_begin ;
39 if (!$received_end || $received_end==0) {
41 $rendered_end = strftime($date_format, $end) ;
43 $tmp = strptime ($received_end, $date_format);
46 $rendered_end = strftime($date_format, $end) ;
48 $end = mktime (0,0,0,$tmp['tm_mon']+1,$tmp['tm_mday'],$tmp['tm_year']) + 86400;
49 $rendered_end = $received_end ;
58 $rendered_end=$rendered_begin;
65 $group=group_get_object($group_id);
66 if (!$group || !is_object($group)) {
67 exit_permission_denied();
70 site_project_header(array('title'=>_('Activity'),'group'=>$group_id,'toptab'=>'activity'));
75 if ($GLOBALS['sys_use_forum']) {
77 $texts[]=_('Forum Post');
80 if ($GLOBALS['sys_use_tracker']) {
82 $texts[]=_('Tracker Opened');
83 $ids[]='trackerclose';
84 $texts[]=_('Tracker Closed');
87 if ($GLOBALS['sys_use_news']) {
92 if ($GLOBALS['sys_use_scm']) {
94 $texts[]=_('Commits');
97 if ($GLOBALS['sys_use_frs']) {
99 $texts[]=_('FRS Release');
102 if (count($show) < 1) {
105 foreach ($show as $showthis) {
106 if (array_search($showthis,$ids) === false) {
107 exit_error('Error','Invalid Data Passed to query');
110 $multiselect=html_build_multiple_select_box_from_arrays($ids,$texts,'show[]',$show,5,false);
114 <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
115 <input type="hidden" name="group_id" value="<?php echo $group_id; ?>"/>
116 <table border="0" cellspacing="0" cellpadding="3">
118 <td><strong><?php echo _('Activity') ?></strong></td>
119 <td><strong><?php echo _('Start') ?></strong></td>
120 <td><strong><?php echo _('End') ?></strong></td>
124 <td><?php echo $multiselect; ?></td>
125 <td valign="top"><input name="start_date" value="<?php echo $rendered_begin; ?>" size="10" maxlength="10" /></td>
126 <td valign="top"><input name="end_date" value="<?php echo $rendered_end; ?>" size="10" maxlength="10" /></td>
127 <td valign="top"><input type="submit" name="submit" value="<?php echo _('Submit'); ?>"/></td>
134 $sql="SELECT * FROM activity_vw WHERE activity_date BETWEEN '".$begin."' AND '".$end."'
135 AND group_id='$group_id' AND section IN ('".implode("','",$show)."') ORDER BY activity_date DESC";
140 $rows=db_numrows($res);
142 echo _('No Activity Found');
146 $theader[]=_('Time');
147 $theader[]=_('Activity');
150 echo $HTML->listTableTop($theader);
154 while ($arr =& db_fetch_array($res)) {
155 if ($last_day != strftime($date_format,$arr['activity_date'])) {
156 // echo $HTML->listTableBottom($theader);
157 echo '<tr class="tableheading"><td colspan="3">'.strftime($date_format,$arr['activity_date']).'</td></tr>';
158 // echo $HTML->listTableTop($theader);
159 $last_day=strftime($date_format,$arr['activity_date']);
161 switch ($arr['section']) {
163 $icon=html_image("ic/cvs16b.png","20","20",array("border"=>"0","alt"=>"SCM"));
164 $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']);
167 case 'trackeropen': {
168 $icon=html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker'));
169 $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'));
172 case 'trackerclose': {
173 $icon=html_image("ic/tracker20g.png",'20','20',array('alt'=>'Tracker'));
174 $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'));
178 $icon=html_image("ic/cvs16b.png","20","20",array("border"=>"0","alt"=>"SCM"));
179 $url=util_make_link ('/frs/?release_id='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('FRS Release').' '.$arr['description']);
183 $icon=html_image("ic/forum20g.png","20","20",array("border"=>"0","alt"=>"Forum"));
184 $url=util_make_link ('/forum/message.php?msg_id='.$arr['subref_id'].'&group_id='.$arr['group_id'],_('Forum Post ').' '.$arr['description']);
188 $icon=html_image("ic/write16w.png","20","20",array("border"=>"0","alt"=>"News"));
189 $url=util_make_link ('/forum/forum.php?forum_id='.$arr['subref_id'],_('News').' '.$arr['description']);
193 echo '<tr '. $HTML->boxGetAltRowStyle($j++) . '>
194 <td> '.date('H:i:s',$arr['activity_date']).'</td>
195 <td>'.$icon .' '.$url.'</td>
196 <td>'.util_make_link_u ($arr['user_name'],$arr['user_id'],$arr['realname']).'</td>
200 echo $HTML->listTableBottom($theader);
204 site_project_footer(array());