Subversion Repositories DevTools

Rev

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