Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
Option explicit
Response.Expires = 0    ' always load the page, dont store
%>
<%
'=====================================================
'                                       New Project
'=====================================================
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim parProj
Dim sMessage
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parProj = QStrPar("FRproj")
sMessage = NULL
'----------------------------------------------
%>
<%
Function Create_New_Project( SSprojectname )
   Dim SEQ_proj_id
   SEQ_proj_id = Get_From_DUAL("SEQ_PROJ_ID.nextval")
   objEH.ErrorRedirect = FALSE
   objEH.TryORA ( OraSession )
   On Error Resume Next
   OraDatabase.ExecuteSQL _
      " INSERT INTO projects (proj_id, proj_name)"&_
      " VALUES ("& SEQ_proj_id &", '"& UCase(SSprojectname) &"')"
   objEH.CatchORA ( OraSession )
   If objEH.Finally Then
        Call OpenInParentWindow ("rtree.asp?proj_id="&SEQ_proj_id)
        Call CloseWindow()
   End If
End Function

Function Project_Name_Exists ( SSprojectname )
   Dim rsTemp, Query_String
   Query_String = _
   " SELECT proj_name"&_
   "  FROM projects"&_
   " WHERE proj_name = '"& UCase(SSprojectname) &"'"
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
   If rsTemp.RecordCount > 0 Then
      Project_Name_Exists = TRUE
   Else
      Project_Name_Exists = FALSE
   End If
   rsTemp.Close
   Set rsTemp = nothing
End Function
%>
<%
'Process submition
If CBool(QStrPar("action")) Then
    If NOT objAccessControl.UserLogedIn Then
        sMessage = "User is no longer logged in"
    ElseIf NOT parProj <> "" Then
        sMessage = "No Project name specified"
    ElseIf LEN(parProj) < 4 Then
        sMessage = "Project Name is too short."
    ElseIf Project_Name_Exists( parProj ) Then
        sMessage = "Project Name already exists"
    Else
        Call Create_New_Project ( parProj ) 
    End If
End If
%>
<html>
<head>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
<link rel="stylesheet" href="images/navigation.css" type="text/css">
<script language="JavaScript" src="images/common.js"></script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.newproj.FRproj.focus();">
    <form class="form_tight" name="newproj" method="post" action="<%=scriptName%>" onSubmit="ShowProgress();">
      <table width="100%" border="0" cellspacing="0" cellpadding="2">
        <tr> 
          <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif"> 
             <!-- LOCAL ERROR +++++++++++++++++++++++++++++++++++++++++++++++ -->
             <%Call Messenger ( sMessage , 3, "100%" )%>
             <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
             <!--#include file="messages/_msg_inline.asp"-->
             <br>

            <table width="100%" border="0" cellspacing="1" cellpadding="2">
              <tr> 
                <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Project Name </td>
                <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"> 
                  <input type="text" name="FRproj" maxlength="30" class="form_item">
                  <input type="hidden" name="action" value="true">
                </td>
              </tr>
            </table>
          </td>
        </tr>
        <tr> 
          <td><%=ProgressBar()%></td>
          <td align="right">
            <input type="submit" name="btn" value="Create" class="form_btn_comp">
            <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();">
          </td>
        </tr>
      </table>
    </form>
</body>
</html>
<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->