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 33
/
tickets-milestone-new.php
83 lines (76 loc) · 2.92 KB
/
tickets-milestone-new.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
75
76
77
78
79
80
81
82
83
<?PHP
require 'includes/master.inc.php';
$Auth->requireAdmin('login.php');
$nav = 'tickets';
$app = new Application($_GET['app_id']);
if(!$app->ok()) redirect('tickets.php');
if(isset($_POST['btnNew']))
{
if($Error->ok())
{
$m = new Milestone();
$m->app_id = $app->id;
$m->title = trim($_POST['title']);
$m->description = $_POST['description'];
$m->status = 'open';
$m->dt_due = dater($_POST['due']);
if(strlen($m->title) == 0)
$m->title = 'Untitled Milestone';
$m->insert();
redirect('tickets-milestones.php?app_id=' . $app->id);
}
else
{
$title = $_POST['title'];
$description = $_POST['description'];
$due = $_POST['due'];
}
}
else
{
$title = '';
$description = '';
$due = '';
}
?>
<?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-summary.php?id=<?PHP echo $app->id; ?>"><?PHP echo $app->name; ?> Summary</a></li>
<li><a href="tickets-tickets.php?app_id=<?PHP echo $app->id; ?>">Tickets</a></li>
<li class="active"><a href="tickets-milestones.php?app_id=<?PHP echo $app->id; ?>">Milestones</a></li>
</ul>
<div class="clear"></div>
</div>
<div class="bd">
<form action="tickets-milestone-new.php?app_id=<?PHP echo $app->id;?>" method="post">
<p><label for="title">Title</label> <input type="text" name="title" id="title" value="<?PHP echo $title;?>" class="text"></p>
<p><label for="description">Description</label><br><textarea name="description" id="description" class="text"><?PHP echo $description ?></textarea><span class="info">Markdown is allowed</span></p>
<p><label for="due">Due Date:</label> <input type="text" name="due" id="due" value="<?PHP echo $due;?>" class="text"></p>
<p><input type="submit" name="btnNew" value="Create Milestone" id="btnNew"></p>
</form>
</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-new.php?app_id=<?PHP echo $app->id; ?>" class="big-button">New Ticket</a></p>
<p class="text-center"><a href="tickets-milestone-new.php?app_id=<?PHP echo $app->id; ?>" class="big-button">New Milestone</a></p>
</div>
</div>
</div>
</div>
<script type="text/javascript" charset="utf-8">
window.onload = function() {
document.getElementById('title').focus();
}
</script>
<?PHP include('inc/footer.inc.php'); ?>