Subversion Repositories DevTools

Rev

Rev 6877 | 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_optional.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim parProj
Dim sMessage
Dim bCanEdit
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parProj = QStrPar("FRproj")
sMessage = NULL
bCanEdit = canActionControl("CreateNewProject")
'----------------------------------------------
%>
<%
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 bCanEdit Then
        sMessage = "User is no longer authorised to create a new Projects"
    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
Else
    If NOT objAccessControl.UserLogedIn Then
        sMessage = "User is not logged in and can't create a new Project"
    ElseIf NOT bCanEdit Then
        sMessage = "User is not authorised to create a new Projects"
    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?ver=<%=VixVerNum%>" type="text/css">
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();document.newproj.FRproj.focus();">
        <div id='divProgressBar' class='vixSpinner' style='visibility:hidden;'></div>
    <form class="form_tight" name="newproj" method="post" action="<%=scriptName%>" onSubmit="MM_showProgressBar();">
        <div class='Panel'>
            <div class='textPanel PanelPad'>
             <!-- LOCAL ERROR +++++++++++++++++++++++++++++++++++++++++++++++ -->
             <%Call Messenger ( sMessage , 3, "100%" )%>
             <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
             <!--#include file="messages/_msg_inline.asp"-->
            </div>
            <div class='PanelPad'>
                <table width="100%" border="0" cellspacing="1" cellpadding="2" class='lhsGrey'>
                  <tr> 
                    <td width="1%" nowrap >Project Name </td>
                    <td nowrap width="100%"> 
                      <input type="text" name="FRproj" maxlength="30">
                      <input type="hidden" name="action" value="true">
                    </td>
                  </tr>
                </table>
            </div>
            <div class='PanelPad textPanel errorPanel'>
            <img src="images/i_warning.gif" width="16" height="16">
            When a new project is created you will not have edit access within the Project. Access control will need to be granted.
            </div>
            <div class='buttonPanelWhite'> 
              <%If bCanEdit Then%>
                <input type="submit" name="btn" value="Create">
              <%End If%>
                <input type="reset" name="btn" value="Cancel" onclick="parent.closeIFrame();">
            </div>
        </div>
    </form>
</body>
</html>
<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->