This repository has been archived by the owner on Apr 24, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
Copy pathtickets-tickets.php
74 lines (66 loc) · 3.12 KB
/
tickets-tickets.php
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
<?PHP
require 'includes/master.inc.php';
$Auth->requireAdmin('login.php');
$nav = 'tickets';
$app = new Application($_GET['app_id']);
if(!$app->ok()) redirect('/tickets/');
$users = DBObject::glob('user', 'SELECT * FROM shine_users');
$users[0] = new User();
$milestones = DBObject::glob('milestone', "SELECT * FROM shine_milestones WHERE app_id = '{$app->id}'");
$milestones[0] = new Milestone();
$tickets = DBObject::glob('ticket', "SELECT * FROM shine_tickets WHERE app_id = '{$app->id}' ORDER BY dt_created DESC");
?>
<?PHP include('inc/header.inc.php'); ?>
<div id="bd">
<div id="yui-main">
<div class="yui-b"><div class="yui-g">
<div class="block tabs spaces">
<div class="hd">
<h2><?PHP echo $a->name; ?> Ticket Summary</h2>
<ul>
<li><a href="/tickets/app/<?PHP echo $app->id; ?>/"><?PHP echo $app->name; ?> Summary</a></li>
<li class="active"><a href="/tickets/app/<?PHP echo $app->id; ?>/list/">Tickets</a></li>
<li><a href="/milestones/app/<?PHP echo $app->id; ?>/">Milestones</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="bd">
<table class="tickets">
<thead>
<tr>
<td>#</td>
<td>Status</td>
<td>Title</td>
<td>Milestone</td>
<td>Assigned To</td>
<td>Reported</td>
</tr>
</thead>
<tbody>
<?PHP foreach($tickets as $t): ?>
<tr class="ticket-<?PHP echo $t->status; ?>">
<td class="id"><?PHP echo $t->id; ?></td>
<td class="status"><a href="/tickets/app/<?PHP echo $app->id; ?>/list/?status=<?PHP echo $t->status; ?>"><?PHP echo ucwords($t->status); ?></a></td>
<td class="title"><a href="/ticket/<?PHP echo $t->id; ?>/"><?PHP echo $t->title; ?></a></td>
<td class="milestone"><a href="tickets-milestone.php?id=<?PHP echo $t->milestone_id; ?>"><?PHP echo $milestones[$t->milestone_id]->title; ?></a></td>
<td class="assigned-to"><a href="tickets-user.php?id=<?PHP echo $t->assigned_to; ?>"><?PHP echo $users[$t->assigned_to]->username; ?></a></td>
<td class="age"><?PHP echo time2str($t->dt_created); ?></td>
</tr>
<?PHP endforeach; ?>
</tbody>
</table>
</div>
</div>
</div></div>
</div>
<div id="sidebar" class="yui-b">
<div class="block">
<div class="hd"><h3>Create a New Item</h3></div>
<div class="bd">
<p class="text-center"><a href="/tickets/app/<?PHP echo $app->id; ?>/new/" class="big-button">New Ticket</a></p>
<p class="text-center"><a href="/milestones/app/<?PHP echo $app->id; ?>/new/" class="big-button">New Milestone</a></p>
</div>
</div>
</div>
</div>
<?PHP include('inc/footer.inc.php'); ?>