1 <?php # vim:ts=2:sw=2:et:
2 /* For licensing and copyright terms, see the file named LICENSE */
4 include '../inc/common.php';
6 MTrackACL::requireAllRights('Roadmap', 'read');
8 mtrack_head("Roadmap");
10 $completed = isset($_GET['completed']) ? 'checked' : '';
11 $watched = isset($_GET['watched']) ?
12 'checked' : (count($_GET) ? '' : 'checked');
16 <div style="float:right">
18 <input type="checkbox" id='completed' name="completed" $completed>
19 <label for='completed'>Show completed milestones</label><br/>
20 <input type="checkbox" id='watched' name="watched" $watched>
21 <label for='watched'>Show only watched milestones</label><br/>
22 <button type="submit" name='s'>Update</button><br>
24 <button onclick="document.location.href='{$ABSWEB}milestone.php?new=1';return false;">Add Milestone</button>
25 <script type='text/javascript'>
26 var showingGraphs = true;
27 function toggleGraphs()
30 $('.burndown').hide();
32 $('.burndown').show();
34 showingGraphs = !showingGraphs;
37 <button onclick="toggleGraphs(); return false;">Toggle Graphs</button>
40 $db = MTrackDB::get();
42 if (!empty($_GET['completed'])) {
45 $comp = " AND completed IS NULL ";
48 if ($watched == 'checked') {
49 $me = $db->quote(mtrack_canon_username(MTrackAuth::whoami()));
50 if ($db->getAttribute(PDO::ATTR_DRIVER_NAME) == 'pgsql') {
51 $oid = 'w.oid::integer';
56 SELECT distinct name, duedate
58 LEFT JOIN milestones m on (m.mid = $oid)
61 w.otype = 'milestone' AND
65 ORDER by duedate ASC, name
76 ORDER by case when duedate IS NULL then 1 else 0 end, duedate ASC, name
81 foreach ($db->query($sql)->fetchAll(PDO::FETCH_ASSOC) as $row) {
82 echo MTrackMilestone::macro_MilestoneSummary($row['name']);
87 $milestones = $watched == 'checked' ? 'watched milestones' : 'milestones';
89 <p><em>No $milestones were found.</em></p>