forked from rogermoka/Timesheet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
task_edit.php
112 lines (97 loc) · 3.4 KB
/
task_edit.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
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
<?
// $Header: /cvsroot/tsheet/timesheet.php/task_edit.php,v 1.6 2004/07/02 14:15:56 vexil Exp $
// Authenticate
require("class.AuthenticationManager.php");
require("class.CommandMenu.php");
if (!$authenticationManager->isLoggedIn() || !$authenticationManager->hasClearance(CLEARANCE_ADMINISTRATOR)) {
Header("Location: login.php?redirect=$_SERVER[PHP_SELF]&clearanceRequired=Administrator");
exit;
}
// Connect to database.
$dbh = dbConnect();
$contextUser = strtolower($_SESSION['contextUser']);
//load local vars from superglobals
$task_id = $_REQUEST['task_id'];
//define the command menu
$commandMenu->add(new TextCommand("Back", true, "javascript:history.back()"));
//query database for existing task values
list($qh, $num) = dbQuery("select task_id, proj_id, name, description, status from $TASK_TABLE where task_id = $task_id ");
$data = dbResult($qh);
$projectId = $data['proj_id'];
list($qh, $num) = dbQuery("SELECT username from $TASK_ASSIGNMENTS_TABLE where proj_id = $data[proj_id] AND task_id = $task_id");
$selected_array = array();
$i = 0;
while ($datanext = dbResult($qh)) {
$selected_array[$i] = $datanext["username"];
$i++;
}
?>
<html>
<head>
<title>Edit Task</title>
<?php include ("header.inc"); ?>
</head>
<body <? include ("body.inc"); ?> >
<?php include ("banner.inc"); ?>
<form action="task_action.php" method="post">
<input type="hidden" name="action" value="edit">
<input type="hidden" name="proj_id" value="<? echo $data["proj_id"]; ?>">
<input type="hidden" name="task_id" value="<? echo $data["task_id"]; ?>">
<table width="600" align="center" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="100%" class="face_padding_cell">
<!-- include the timesheet face up until the heading start section -->
<? include("timesheet_face_part_1.inc"); ?>
<table width="100%" border="0">
<tr>
<td align="left" nowrap class="outer_table_heading" nowrap>
Edit Task: <? echo $data["name"]; ?>
</td>
</tr>
</table>
<!-- include the timesheet face up until the heading start section -->
<? include("timesheet_face_part_2.inc"); ?>
<table width="100%" align="center" border="0" cellpadding="0" cellspacing="0" class="outer_table">
<tr>
<td>
<table width="100%" border="0" cellpadding="1" cellspacing="2" class="table_body">
<tr>
<td align="right">Task Name:</td>
<td><input type="text" name="name" size="42" value="<? echo $data["name"]; ?>" style="width: 100%"></td>
</tr>
<tr>
<td align="right" valign="top">Description:</td>
<td><textarea name="description" rows="4" cols="40" wrap="virtual" style="width: 100%"><? $data["description"] = stripslashes($data["description"]); echo $data["description"]; ?></textarea></td>
</tr>
<tr>
<td align="right">Status:</td>
<td><? proj_status_list("task_status", $data["status"]); ?></td>
</tr>
<tr>
<td align="right" valign="top">Assignments:</td>
<td><? multi_user_select_list("assigned[]",$selected_array); ?></td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<table width="100%" border="0" class="table_bottom_panel">
<tr>
<td align="center">
<input type="submit" value="Update">
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- include the timesheet face up until the end -->
<? include("timesheet_face_part_3.inc"); ?>
</td>
</tr>
</table>
</form>
<?php include("footer.inc"); ?>
</body>
</html>