1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
|
<?php $project_count = count($projects);
/* If user has no projects, just redirect them to the index page of All Projects */
if (!$project_count): ?>
<meta http-equiv="Refresh" content="0;url=/index.php?project=0&do=index" />
<?php endif; ?>
<style type="text/css">
.activity::after {
content: "\25B4";
position: absolute;
right: -3px;
bottom:-5px;
text-align: right;
color:#c00;
}
.activity img{
padding-right:1px;
background-color:#c00;
}
.activity {
display: block;
position: relative;
width: 160px;
}
#s_inactive {display:none;}
#s_inactive ~ .box {display: none;}
#s_inactive:checked ~ .box {display: inline-block;}
</style>
<?php
# $projects are now sorted active first, then inactive
$lastprojectactive=1;
foreach ($projects as $project): ?>
<?php if( count($projects)>1 && $lastprojectactive==1 && $project['project_is_active']==0) : ?>
<div style="clear:both;padding-top:20px;border-bottom:1px solid #999;"></div>
<input type="checkbox" id="s_inactive" />
<label class="button" style="display:block;width:100px;" for="s_inactive"><?php echo Filters::noXSS(L('showinactive')); ?></label>
<?php endif; ?>
<?php $lastprojectactive=$project['project_is_active']; ?>
<div class="box<?php if ($project_count == 1) echo ' single-project' ?>">
<h2><a href="<?php echo Filters::noXSS(CreateUrl('project', $project['project_id'])); ?>"><?php echo Filters::noXSS($project['project_title']); ?></a></h2>
<table class="toplevel">
<?php if($user->can_view_project($project['project_id'])): ?>
<tr>
<th><?php echo Filters::noXSS(L('viewtasks')); ?></th>
<td>
<a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('status[]'=>'')); ?>"><?php echo Filters::noXSS(L('All')); ?></a> -
<a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('status[]'=>'open')); ?>"><?php echo Filters::noXSS(L('open')); ?></a> -
<a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('openedfrom'=>'-1 week')); ?>"><?php echo Filters::noXSS(L('recentlyopened')); ?></a>
<?php if (!$user->isAnon()): ?>
<br />
<a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('dev'=>$user->id, 'devsm'=>'userid')); ?>"><?php echo Filters::noXSS(L('assignedtome')); ?></a> -
<a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('only_watched'=>1)); ?>"><?php echo Filters::noXSS(L('taskswatched')); ?></a> -
<a href="<?php echo CreateURL('tasklist', $project['project_id'], null, array('opened'=>$user->id, 'openedsm'=>'userid')); ?>"><?php echo Filters::noXSS(L('tasksireported')); ?></a>
<?php endif; ?>
</td>
<?php if ($project_count == 1 and isset($most_wanted[$project['project_id']])): ?>
<td rowspan="4">
<strong><?php echo Filters::noXSS(L('mostwanted')); ?></strong>
<ul>
<?php foreach($most_wanted[$project['project_id']] as $task): ?>
<li><?php echo tpl_tasklink($task['task_id']); ?>, <?php echo Filters::noXSS($task['num_votes']); ?> <?php echo ($task['num_votes']==1) ? Filters::noXSS(L('vote')) : Filters::noXSS(L('votes')); ?></li>
<?php endforeach; ?>
</ul>
</td>
<?php endif; ?>
<?php if ($project_count == 1 and isset($assigned_to_myself[$project['project_id']])): ?>
<td rowspan="4">
<strong><?php echo Filters::noXSS(L('assignedtome')); ?></strong>
<ul>
<?php foreach($assigned_to_myself[$project['project_id']] as $task): ?>
<li><?php echo tpl_tasklink($task['task_id']); ?></li>
<?php endforeach; ?>
</ul>
</td>
<?php endif; ?>
</tr>
<?php endif; ?>
<?php
# lets say if someone can view normal tasks of a project, then activity graphs are allowed.
if($user->can_view_project($project['project_id']) ) : ?>
<tr>
<th><?php echo Filters::noXSS(L('activity')); ?></th>
<td><span class="activity" title="red line=today"><img width="160px" height="25px" src="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?line=0066CC&do=activity&project_id=<?php echo Filters::noXSS($project['project_id']); ?>&graph=project"/></span></td>
</tr>
<?php if (!$user->isAnon()): ?>
<tr>
<th><?php echo Filters::noXSS(L('myactivity')); ?></th>
<td><span class="activity" title="red line=today"><img width="160px" height="25px" src="<?php echo Filters::noXSS($_SERVER['SCRIPT_NAME']); ?>?line=0066CC&do=activity&user_id=<?php echo Filters::noXSS($user->id); ?>&project_id=<?php echo Filters::noXSS($project['project_id']); ?>&graph=user"/></span></td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php if($projprefs[$project['project_id']]['others_viewroadmap'] || ($user->perms('view_roadmap', $project['project_id'])) ) : ?>
<tr>
<th><?php echo Filters::noXSS(L('stats')); ?></th>
<td><?php echo Filters::noXSS($stats[$project['project_id']]['open']); ?> <?php echo Filters::noXSS(L('opentasks')); ?>, <?php echo Filters::noXSS($stats[$project['project_id']]['all']); ?> <?php echo Filters::noXSS(L('totaltasks')); ?>.</td>
</tr>
<tr>
<th><?php echo Filters::noXSS(L('progress')); ?></th>
<td>
<?php echo Filters::noXSS($stats[$project['project_id']]['average_done']); ?>% <?php echo Filters::noXSS(L('done')); ?>
<?php $progressbar_value = $stats[$project['project_id']]['average_done']; ?>
<div class="progress_bar_container">
<span><?php echo Filters::noXSS($stats[$project['project_id']]['average_done']); ?>%</span>
<div class="progress_bar" style="width:<?php echo Filters::noXSS($stats[$project['project_id']]['average_done']); ?>%"></div>
</div>
</td>
</tr>
<?php endif; ?>
<?php
if($projprefs[$project['project_id']]['use_effort_tracking']) :
$total_estimated = 0;
$actual_effort = 0;
if(isset($stats[$project['project_id']]['tasks'])) :
foreach($stats[$project['project_id']]['tasks'] as $task) {
$total_estimated += $task['estimated_effort'];
$effort = new effort($task['task_id'],0);
$effort->populateDetails();
foreach($effort->details as $details) {
$actual_effort += $details['effort'];
}
$effort = null;
}
endif;
if ($user->perms('view_estimated_effort', $project['project_id'])) : ?>
<tr>
<th><?php echo Filters::noXSS(L('estimatedeffortopen')); ?></th>
<td><?php echo effort::SecondsToString($total_estimated, $proj->prefs['hours_per_manday'], $proj->prefs['estimated_effort_format']); ?></td>
</tr>
<?php endif; ?>
<?php if ($user->perms('view_current_effort_done', $project['project_id'])) : ?>
<tr>
<th><?php echo Filters::noXSS(L('currenteffortdoneopen')); ?></th>
<td><?php echo effort::SecondsToString($actual_effort, $proj->prefs['hours_per_manday'], $proj->prefs['current_effort_done_format']); ?></td>
</tr>
<?php endif; ?>
<?php endif; ?>
<?php if($projprefs[$project['project_id']]['others_view']==1): ?>
<tr>
<th><?php echo Filters::noXSS(L('feeds')); ?></th>
<td>
<b><?php echo Filters::noXSS(L('rss')); ?> 1.0</b> <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss1&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('opened')); ?></a> -
<a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss1&topic=edit&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('edited')); ?></a> -
<a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss1&topic=clo&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('closed')); ?></a>
<br />
<b><?php echo Filters::noXSS(L('rss')); ?> 2.0</b> <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss2&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('opened')); ?></a> -
<a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss2&topic=edit&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('edited')); ?></a> -
<a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=rss2&topic=clo&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('closed')); ?></a>
<br />
<b><?php echo Filters::noXSS(L('atom')); ?></b> <a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=atom&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('opened')); ?></a> -
<a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=atom&topic=edit&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('edited')); ?></a> -
<a href="<?php echo Filters::noXSS($baseurl); ?>feed.php?feed_type=atom&topic=clo&project=<?php echo Filters::noXSS($project['project_id']); ?>"><?php echo Filters::noXSS(L('closed')); ?></a>
</td>
</tr>
<?php endif; ?>
</table>
</div>
<?php
endforeach;
?>
<div class="clear"></div>
|