Subversion Repositories DevTools

Rev

Rev 5506 | Rev 5983 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
%>
20
<!--#include file="_access_control_login.asp"-->
21
<!--#include file="_access_control_general.asp"-->
22
<%
23
'------------ Variable Definition -------------
24
Dim parProj
5590 dpurdie 25
Dim sMessage
5357 dpurdie 26
'------------ Constants Declaration -----------
27
'------------ Variable Init -------------------
28
parProj = QStrPar("FRproj")
5590 dpurdie 29
sMessage = NULL
5357 dpurdie 30
'----------------------------------------------
31
%>
32
<%
5590 dpurdie 33
Function Create_New_Project( SSprojectname )
34
   Dim SEQ_proj_id
35
   SEQ_proj_id = Get_From_DUAL("SEQ_PROJ_ID.nextval")
36
   objEH.ErrorRedirect = FALSE
37
   objEH.TryORA ( OraSession )
38
   On Error Resume Next
39
   OraDatabase.ExecuteSQL _
40
      " INSERT INTO projects (proj_id, proj_name)"&_
41
      " VALUES ("& SEQ_proj_id &", '"& UCase(SSprojectname) &"')"
42
   objEH.CatchORA ( OraSession )
43
   If objEH.Finally Then
44
        Call OpenInParentWindow ("rtree.asp?proj_id="&SEQ_proj_id)
45
        Call CloseWindow()
46
   End If
47
End Function
48
 
49
Function Project_Name_Exists ( SSprojectname )
50
   Dim rsTemp, Query_String
51
   Query_String = _
52
   " SELECT proj_name"&_
53
   "  FROM projects"&_
54
   " WHERE proj_name = '"& UCase(SSprojectname) &"'"
55
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
56
   If rsTemp.RecordCount > 0 Then
57
      Project_Name_Exists = TRUE
58
   Else
59
      Project_Name_Exists = FALSE
60
   End If
61
   rsTemp.Close
62
   Set rsTemp = nothing
63
End Function
64
%>
65
<%
5357 dpurdie 66
'Process submition
5590 dpurdie 67
If CBool(QStrPar("action")) Then
68
    If NOT objAccessControl.UserLogedIn Then
69
        sMessage = "User is no longer logged in"
70
    ElseIf NOT parProj <> "" Then
71
        sMessage = "No Project name specified"
72
    ElseIf LEN(parProj) < 4 Then
73
        sMessage = "Project Name is too short."
74
    ElseIf Project_Name_Exists( parProj ) Then
75
        sMessage = "Project Name already exists"
76
    Else
77
        Call Create_New_Project ( parProj ) 
78
    End If
5357 dpurdie 79
End If
80
%>
81
<html>
82
<head>
83
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
84
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
85
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
86
<link rel="stylesheet" href="images/navigation.css" type="text/css">
87
<script language="JavaScript" src="images/common.js"></script>
88
</head>
89
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.newproj.FRproj.focus();">
5590 dpurdie 90
    <form class="form_tight" name="newproj" method="post" action="<%=scriptName%>" onSubmit="ShowProgress();">
91
      <table width="100%" border="0" cellspacing="0" cellpadding="2">
92
        <tr> 
93
          <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif"> 
94
             <!-- LOCAL ERROR +++++++++++++++++++++++++++++++++++++++++++++++ -->
95
             <%Call Messenger ( sMessage , 3, "100%" )%>
96
             <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
97
             <!--#include file="messages/_msg_inline.asp"-->
98
             <br>
99
 
100
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
101
              <tr> 
102
                <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Project Name </td>
103
                <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"> 
104
                  <input type="text" name="FRproj" maxlength="30" class="form_item">
105
                  <input type="hidden" name="action" value="true">
106
                </td>
107
              </tr>
108
            </table>
109
          </td>
110
        </tr>
111
        <tr> 
112
          <td><%=ProgressBar()%></td>
113
          <td align="right">
114
            <input type="submit" name="btn" value="Create" class="form_btn_comp">
115
            <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();">
116
          </td>
117
        </tr>
118
      </table>
119
    </form>
5357 dpurdie 120
</body>
121
</html>
122
<!-- DESTRUCTOR ------->
119 ghuddy 123
<!--#include file="common/destructor.asp"-->