| 5357 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
Option explicit
|
|
|
4 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
5 |
%>
|
|
|
6 |
<%
|
|
|
7 |
'=====================================================
|
|
|
8 |
' New Project
|
|
|
9 |
'=====================================================
|
|
|
10 |
%>
|
|
|
11 |
<!--#include file="common/conf.asp"-->
|
|
|
12 |
<!--#include file="common/globals.asp"-->
|
|
|
13 |
<!--#include file="common/qstr.asp"-->
|
|
|
14 |
<!--#include file="common/common_subs.asp"-->
|
|
|
15 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
16 |
<!--#include file="common/_popup_window_common.asp"-->
|
|
|
17 |
<%
|
|
|
18 |
'------------ ACCESS CONTROL ------------------
|
|
|
19 |
%>
|
| 6181 |
dpurdie |
20 |
<!--#include file="_access_control_login_optional.asp"-->
|
| 5357 |
dpurdie |
21 |
<!--#include file="_access_control_general.asp"-->
|
|
|
22 |
<%
|
|
|
23 |
'------------ Variable Definition -------------
|
|
|
24 |
Dim parProj
|
| 5590 |
dpurdie |
25 |
Dim sMessage
|
| 5983 |
dpurdie |
26 |
Dim bCanEdit
|
| 5357 |
dpurdie |
27 |
'------------ Constants Declaration -----------
|
|
|
28 |
'------------ Variable Init -------------------
|
|
|
29 |
parProj = QStrPar("FRproj")
|
| 5590 |
dpurdie |
30 |
sMessage = NULL
|
| 5983 |
dpurdie |
31 |
bCanEdit = canActionControl("CreateNewProject")
|
| 5357 |
dpurdie |
32 |
'----------------------------------------------
|
|
|
33 |
%>
|
|
|
34 |
<%
|
| 5590 |
dpurdie |
35 |
Function Create_New_Project( SSprojectname )
|
|
|
36 |
Dim SEQ_proj_id
|
|
|
37 |
SEQ_proj_id = Get_From_DUAL("SEQ_PROJ_ID.nextval")
|
|
|
38 |
objEH.ErrorRedirect = FALSE
|
|
|
39 |
objEH.TryORA ( OraSession )
|
|
|
40 |
On Error Resume Next
|
|
|
41 |
OraDatabase.ExecuteSQL _
|
|
|
42 |
" INSERT INTO projects (proj_id, proj_name)"&_
|
|
|
43 |
" VALUES ("& SEQ_proj_id &", '"& UCase(SSprojectname) &"')"
|
|
|
44 |
objEH.CatchORA ( OraSession )
|
|
|
45 |
If objEH.Finally Then
|
|
|
46 |
Call OpenInParentWindow ("rtree.asp?proj_id="&SEQ_proj_id)
|
|
|
47 |
Call CloseWindow()
|
|
|
48 |
End If
|
|
|
49 |
End Function
|
|
|
50 |
|
|
|
51 |
Function Project_Name_Exists ( SSprojectname )
|
|
|
52 |
Dim rsTemp, Query_String
|
|
|
53 |
Query_String = _
|
|
|
54 |
" SELECT proj_name"&_
|
|
|
55 |
" FROM projects"&_
|
|
|
56 |
" WHERE proj_name = '"& UCase(SSprojectname) &"'"
|
|
|
57 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
58 |
If rsTemp.RecordCount > 0 Then
|
|
|
59 |
Project_Name_Exists = TRUE
|
|
|
60 |
Else
|
|
|
61 |
Project_Name_Exists = FALSE
|
|
|
62 |
End If
|
|
|
63 |
rsTemp.Close
|
|
|
64 |
Set rsTemp = nothing
|
|
|
65 |
End Function
|
|
|
66 |
%>
|
|
|
67 |
<%
|
| 5357 |
dpurdie |
68 |
'Process submition
|
| 5590 |
dpurdie |
69 |
If CBool(QStrPar("action")) Then
|
|
|
70 |
If NOT objAccessControl.UserLogedIn Then
|
|
|
71 |
sMessage = "User is no longer logged in"
|
| 5983 |
dpurdie |
72 |
ElseIf NOT bCanEdit Then
|
|
|
73 |
sMessage = "User is no longer authorised to create a new Projects"
|
| 5590 |
dpurdie |
74 |
ElseIf NOT parProj <> "" Then
|
|
|
75 |
sMessage = "No Project name specified"
|
|
|
76 |
ElseIf LEN(parProj) < 4 Then
|
|
|
77 |
sMessage = "Project Name is too short."
|
|
|
78 |
ElseIf Project_Name_Exists( parProj ) Then
|
|
|
79 |
sMessage = "Project Name already exists"
|
|
|
80 |
Else
|
|
|
81 |
Call Create_New_Project ( parProj )
|
|
|
82 |
End If
|
| 5983 |
dpurdie |
83 |
Else
|
|
|
84 |
If NOT objAccessControl.UserLogedIn Then
|
|
|
85 |
sMessage = "User is not logged in and can't create a new Project"
|
|
|
86 |
ElseIf NOT bCanEdit Then
|
|
|
87 |
sMessage = "User is not authorised to create a new Projects"
|
|
|
88 |
End If
|
| 5357 |
dpurdie |
89 |
End If
|
|
|
90 |
%>
|
|
|
91 |
<html>
|
|
|
92 |
<head>
|
|
|
93 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
94 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
| 6579 |
dpurdie |
95 |
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
96 |
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
97 |
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
|
| 5357 |
dpurdie |
98 |
</head>
|
|
|
99 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.newproj.FRproj.focus();">
|
| 5590 |
dpurdie |
100 |
<form class="form_tight" name="newproj" method="post" action="<%=scriptName%>" onSubmit="ShowProgress();">
|
| 6877 |
dpurdie |
101 |
<div class='Panel'>
|
|
|
102 |
<div class='textPanel PanelPad'>
|
| 5590 |
dpurdie |
103 |
<!-- LOCAL ERROR +++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
104 |
<%Call Messenger ( sMessage , 3, "100%" )%>
|
|
|
105 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
106 |
<!--#include file="messages/_msg_inline.asp"-->
|
| 6877 |
dpurdie |
107 |
</div>
|
|
|
108 |
<div class='PanelPad'>
|
|
|
109 |
<table width="100%" border="0" cellspacing="1" cellpadding="2" class='lhsGrey'>
|
|
|
110 |
<tr>
|
|
|
111 |
<td width="1%" nowrap >Project Name </td>
|
|
|
112 |
<td nowrap width="100%">
|
|
|
113 |
<input type="text" name="FRproj" maxlength="30">
|
|
|
114 |
<input type="hidden" name="action" value="true">
|
|
|
115 |
</td>
|
|
|
116 |
</tr>
|
|
|
117 |
</table>
|
|
|
118 |
</div>
|
|
|
119 |
<div class='PanelPad textPanel errorPanel'>
|
|
|
120 |
<img src="images/i_warning.gif" width="16" height="16">
|
|
|
121 |
When a new project is created you will not have edit access within the Project. Access control will need to be granted.
|
|
|
122 |
</div>
|
|
|
123 |
<div class='buttonPanelWhite'>
|
|
|
124 |
<%=ProgressBar()%>
|
|
|
125 |
<%If bCanEdit Then%>
|
|
|
126 |
<input type="submit" name="btn" value="Create">
|
|
|
127 |
<%End If%>
|
|
|
128 |
<input type="reset" name="btn" value="Cancel" onclick="parent.closeIFrame();">
|
|
|
129 |
</div>
|
|
|
130 |
</div>
|
| 5590 |
dpurdie |
131 |
</form>
|
| 5357 |
dpurdie |
132 |
</body>
|
|
|
133 |
</html>
|
|
|
134 |
<!-- DESTRUCTOR ------->
|
| 119 |
ghuddy |
135 |
<!--#include file="common/destructor.asp"-->
|