-
Notifications
You must be signed in to change notification settings - Fork 0
/
storyStatus_Edit.php
147 lines (132 loc) · 3.87 KB
/
storyStatus_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
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
<?php
/*
* Practical Agile Scrum tool
*
* Copyright 2013-2017, P.P. Labuschagne
* Released under the MIT license.
* https://github.com/paul-lab/practical-agile/blob/master/_Licence.txt
*
* Homepage:
* http://practicalagile.co.uk
* http://practicalagile.uk
*
*/
include 'include/header.inc.php';
if (empty($_REQUEST['PID'])) header("Location:project_List.php");
echo '<div class="hidden" id="phpbread"><a href="project_List.php">My Projects</a>->';
echo '<a href="project_Summary.php?PID='.$_REQUEST['PID'].'">';
echo Get_Project_Name($_REQUEST['PID']);
echo '</a>->';
echo 'Story Status';
echo '</div>';
?>
<script>
$(function() {
document.title = 'Practical Agile: '+$("#phpbread").text().substring(13);
$("#breadcrumbs").html($("#phpbread").html());
if ($("#phpnavicons")){
$("#navicons").html($("#phpnavicons").html());
}
});
</script>
<script type="text/javascript" src="jscolor/jscolor.min.js"></script>
<?php
$showForm = true;
if (isset($_POST['saveUpdate'])){
$data=array(
'Project_ID' => $_REQUEST['PID'],
'Desc' => $_REQUEST['Desc'],
'Policy' => $_REQUEST['Policy'],
'Order' => $_REQUEST['Order'],
'RGB' => $_REQUEST['RGB']
);
if (empty($_REQUEST['id'])) {
$sql_method = 'INSERT INTO';
$button_name = 'Add';
$result=$DBConn->create('story_status',$data);
}else{
$sql_method = 'UPDATE';
$button_name = 'Save';
$whereClause = 'ID = '.($_REQUEST['id'] + 0);
$result=$DBConn->update('story_status',$data,$whereClause);
}
if ($result!=0){
$sql='Update story set `Status`="'.$_REQUEST['Desc'].'" where story.Project_ID='.$_REQUEST['PID'].' and `Status`="'.$_REQUEST['ODesc'].'"';
$DBConn->directsql($sql);
$sql='Update points_log set `Status`="'.$_REQUEST['Desc'].'" where points_log.Project_ID='.$_REQUEST['PID'].' and points_log.`Status`="'.$_REQUEST['ODesc'].'"';
$DBConn->directsql($sql);
$showForm = false;
auditit($_REQUEST['PID'],0,$_SESSION['Email'],'Update Project Story Status','',$_REQUEST['Order'].' - '.$_REQUEST['Desc'].'-'.$_REQUEST['Policy'].'-'.$_REQUEST['RGB']);
}else{
if($DBConn->error){
$error = 'The form failed to process correctly.'.'<br>'.$DBConn->error;
}else{
$showForm = false;
}
}
}
if (!empty($error)) echo '<div class="error">'.$error.'</div>';
if ($showForm) {
if (!empty($_REQUEST['id'])){
$storyStatus_Row = $DBConn->directsql('SELECT * FROM story_status WHERE ID = '.$_REQUEST['id']);
$storyStatus_Row = $storyStatus_Row[0];
}else{
$storyStatus_Row = $_REQUEST;
}
echo '<table align="center" cellpadding="6" cellspacing="0" border="0">'.
'<form method="post" action="?">';
?>
<tr>
<td>Order:</td>
<td>
<?=$storyStatus_Row['Order'];?>
</td>
</tr>
<tr>
<td>RGB:</td>
<td>
<input type="text" class="jscolor" name="RGB" value="<?=$storyStatus_Row['RGB'];?>">
</td>
</tr>
<tr>
<td>Desc:</td>
<td>
<?php
if($storyStatus_Row['Order']==1 or $storyStatus_Row['Order']==10){
echo $storyStatus_Row['Desc'];
}else{
echo '<input type="text" name="Desc" value="'.$storyStatus_Row['Desc'].'">';
}
?>
</td>
</tr>
<tr>
<td>Policy:</td>
<td>
<input type="text" size=75 name="Policy" value="<?=$storyStatus_Row['Policy'];?>">
</td>
</tr>
<tr>
<td colspan="2">
<input type="hidden" name="id" value="<?=$_REQUEST['id'];?>">
<input type="hidden" name="PID" value="<?=$_REQUEST['PID'];?>">
<input type="hidden" name="ODesc" value="<?=$storyStatus_Row['Desc'];?>">
<input type="hidden" name="Order" value="<?=$storyStatus_Row['Order'];?>">
<?php
if($storyStatus_Row['Order']==1 or $storyStatus_Row['Order']==10){
echo '<input type="hidden" name="Desc" value="'.$storyStatus_Row['Desc'].'">';
}
?>
<input class="btn" type="submit" name="saveUpdate" value="Update">
</td>
</tr>
</form>
</table>
<?php
}
else
{
header('Location:storyStatus_List.php?PID='.$_REQUEST['PID']);
}
include 'include/footer.inc.php';
?>