Subversion Repositories DevTools

Rev

Rev 129 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                       wAddVCS                     |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_login.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim rsQry
Dim sMessage
Dim VCS_NAME
Dim VCS_TAG
Dim Query_String
Dim dual
Dim Query_Stringx
Dim vcs_type_id
'------------ CONSTANTS DECLARATION -----------
Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
Const LIMG_PRODUCT_PATCH = "<img src='icons/i_patch_small.gif' hspace='2' align='absmiddle'>"
'------------ VARIABLE INIT -------------------
sMessage = NULL
Set objFormCollector = CreateObject("Scripting.Dictionary")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%

%>
<%
'------------ RUN BEFORE PAGE RENDER ----------

If CBool(Request("action")) Then

   If Request("VCS_TAG") = "" Then
      Call RaiseMsg ( enum_MSG_ERROR, "Cannot add an empty string as a VCS Tag" )
   Else
      If Request("VCS_NAME") = "" Then
         Call RaiseMsg ( enum_MSG_ERROR, "Cannot add an empty string as a VCS Name" )
      Else
         Query_String = " SELECT * FROM vcs_type WHERE tag = '"& Request("VCS_TAG") &"'"

         Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))

         If rsQry.RecordCount = 0 Then

            Query_Stringx = _
            "   SELECT seq_vcs_type.NEXTVAL FROM DUAL"

            Set dual = OraDatabase.DbCreateDynaset(Query_Stringx,cint(0))
            vcs_type_id = dual("NEXTVAL")
            dual.Close()
            Set dual = Nothing

            OraDatabase.Parameters.Add "VCS_TYPE_ID", vcs_type_id,         ORAPARM_INPUT, ORATYPE_NUMBER
            OraDatabase.Parameters.Add "NAME",        Request("VCS_NAME"), ORAPARM_INPUT, ORATYPE_VARCHAR2
            OraDatabase.Parameters.Add "TAG",         Request("VCS_TAG"),  ORAPARM_INPUT, ORATYPE_VARCHAR2

            On Error Resume Next
            objEH.TryORA ( OraSession )
            OraDatabase.ExecuteSQL ("begin INSERT INTO vcs_type (vcs_type_id, name, tag) VALUES (:VCS_TYPE_ID, :NAME, :TAG); end;")
            objEH.CatchORA ( OraSession )

            OraDatabase.Parameters.Remove "VCS_TYPE_ID"
            OraDatabase.Parameters.Remove "NAME"
            OraDatabase.Parameters.Remove "TAG"

            If objEH.Finally Then
               Call OpenInParentWindow ("admin_vcs_types.asp")
               Call CloseWindow()
            End If

         Else
            Call RaiseMsg ( enum_MSG_VCS_EXISTS, Request("VCS_TAG") )
         End If

         rsQry.Close
         Set rsQry = nothing
      End If

   End If

End If


'----------------------------------------------
%>
<html>
<head>
<title>Release Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="scripts/common.js"></script>
</head>

<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.VCS_NAME.focus();">
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
   <tr>
      <td bgcolor="#FFFFFF" class="body_txt">
         <span class="body_h1">
            <img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add Version Control System (VCS)
         </span>
         <br>
         Add a new VCS.
      </td>
   </tr>

   <%
   '-- FROM START --------------------------------------------------------------------------------------------------------------
   objFormComponent.FormName = "FormName"
   objFormComponent.Action = ScriptName
   objFormComponent.OnSubmit = "ShowProgress();"
   Call objFormComponent.FormStart()

   %>
   <tr>
      <td background="images/bg_login.gif">
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td><%=ProgressBar()%></td>
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add">
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
               </td>
            </tr>
         </table>
      </td>
   </tr>
   <tr>
      <td>
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <%Call Messenger ( sMessage , 3, "100%" )%>
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <!--#include file="messages/_msg_inline.asp"-->
         <table width="100%" border="0">
            <tr>
               <td><span class="body_txt">VCS Name</span></td>
               <td><input name="VCS_NAME" type="text" class="body_txt" value="<%=VCS_NAME%>" size=120 maxlength=128></td>
            </tr>
            <tr>
               <td><span class="body_txt">VCS Tag (1..4 chars)</span></td>
               <td><input name="VCS_TAG" type="text" class="body_txt" value="<%=VCS_TAG%>" size=4 maxlength=4></td>
            </tr>
            <tr>
               <td>&nbsp;</td>
               <td>&nbsp;</td>
            </tr>
         </table>
      </td>
   </tr>
   <%=objPMod.ComposeHiddenTags()%>
   <input type="hidden" name="action" value="true">

   <%
   Call objFormComponent.FormEnd()
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
   %>
</table>
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
Set objFormCollector = Nothing
'----------------------------------------------
Call Destroy_All_Objects
%>