Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                      Add Release                                  |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0    ' always load the page, dont store
%>
<!--#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"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
objPMod.PersistInQryString("proj_id")
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim objSortHelper
Dim rsQry
Dim parProjId
Dim parSourceRtagId
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parProjId = Request("proj_id")
parSourceRtagId = Request("source_rtag_id")
objPMod.PersistInQryString("proj_id")
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Sub GetFormDetails ( nSourceRtagId, ByRef outobjDetails )
        Dim rsQry, query
        
        ' Exit if nSourceRtagId is empty
        If nSourceRtagId = "" Then Exit Sub 
        
        
        OraDatabase.Parameters.Add "SOURCE_RTAG_ID",    nSourceRtagId,          ORAPARM_INPUT, ORATYPE_NUMBER 
        
        query = _
        " SELECT pr.PROJ_NAME ||' > '|| rt.RTAG_NAME ||' ['|| rt.RTAG_VERSION ||'.'|| rt.RTAG_LIFE_CYCLE ||']'  AS LOCATION"&_
        "  FROM RELEASE_TAGS rt,"&_
        "          PROJECTS pr"&_
        " WHERE rt.PROJ_ID = pr.PROJ_ID"&_
        "   AND rt.RTAG_ID = :SOURCE_RTAG_ID"
        
        Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
        
        OraDatabase.Parameters.Remove "SOURCE_RTAG_ID"
        
        
        
        If rsQry.RecordCount > 0 Then
                outobjDetails.Item ("location") = rsQry("location")
                
        Else
                Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. nSourceRtagId="& nSourceRtagId
                
        End If
        
        
        rsQry.Close
        Set rsQry = Nothing
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub AddRelease ()
        On Error Resume Next
        
        OraDatabase.Parameters.Add "SOURCE_RTAG_ID",    Request("source_rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "PROJ_ID",                   Request("proj_id"),     ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "RTAG_NAME",                 Request("rtag_name"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
        OraDatabase.Parameters.Add "RTAG_DESCRIPTION",  Request("rtag_description"), ORAPARM_INPUT, ORATYPE_VARCHAR2
        OraDatabase.Parameters.Add "USER_ID",                   objAccessControl.UserId,        ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "IS_BRANCH",                 Request("branch"),      ORAPARM_INPUT, ORATYPE_CHAR
        
        objEH.TryORA ( OraSession )
        
        OraDatabase.ExecuteSQL _
        "BEGIN   PK_RELEASE.NEW_RELEASE ( :RTAG_NAME, :RTAG_DESCRIPTION, :PROJ_ID, :SOURCE_RTAG_ID, :IS_BRANCH, :USER_ID );   END;"
        
        objEH.CatchORA ( OraSession )
        
        OraDatabase.Parameters.Add "SOURCE_RTAG_ID"
        OraDatabase.Parameters.Add "PROJ_ID"
        OraDatabase.Parameters.Add "RTAG_NAME"
        OraDatabase.Parameters.Add "RTAG_DESCRIPTION"
        OraDatabase.Parameters.Add "USER_ID"
        OraDatabase.Parameters.Add "IS_BRANCH"
End Sub
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
' --- Get Form details from DB ---
Call GetFormDetails ( parSourceRtagId, objFormCollector )

' --- Load Validation Rules ---
Call objForm.LoadValidationRules ( Array("rtag_name","rtag_description"), OraDatabase )         ' Load Validation Rules

' --- Enter Form Validation Rule Changes here... ----
'----------------------------------------------------

' --- RUN onPostBack ---
If Request("action") <> "" Then
        If objForm.IsValidOnPostBack Then
                ' --- Form is Valid ---
                Call AddRelease()
                
                If objEH.Finally Then
                        Call OpenInWindow ( "rtree.asp?DONE=OK&"& objPMod.ComposeURL() )
                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 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>

<!-- DROPDOWN MENUS -->
<!--#include file="_menu_def.asp"-->
<script language="JavaScript1.2" src="images/popup_menu.js"></script>

</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onLoad="FormName.rtag_name.focus();">
<!-- MENU LAYERS -------------------------------------->
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)"> 
</div>
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!----------------------------------------------------->
<!-- HEADER -->
<!--#include file="_header.asp"-->
<!-- BODY ---->

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
'-- FROM START ---------------------------------------------------------------------------------------------------------
objFormComponent.FormName = "FormName"
objFormComponent.Action = ScriptName
Call objFormComponent.FormStart()
%>
  <tr> 
    <td width="1" background="images/bg_home_orange.gif" valign="top">
        </td>
        <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF"><table width="10" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="1%"></td>
        <td width="100%">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td nowrap class="form_ttl">NEW RELEASE </td>
              <td align="right" valign="bottom"></td>
            </tr>
        </table></td>
        <td width="1%"></td>
      </tr>
      <tr>
        <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
        <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
        <td align="right" valign="top"  background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
      </tr>
      <tr>
        <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
        <td bgcolor="#FFFFFF" valign="top">
                <%
                If parSourceRtagId <> "" Then
                        Call Messenger ( "New release will be created from <br>"& objFormCollector.Item("location"), 3, "100%" )
                End If
                %>
                <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->    
                <!--#include file="messages/_msg_inline.asp"-->
                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                <br>
                <table width="100%"  border="0" cellspacing="2" cellpadding="0">
                  <tr>
                        <td nowrap class="form_iname" valign="top">Release Name </td>
                        <td valign="top" nowrap><%=objFormComponent.TextBox ( "rtag_name", objFormCollector.Item("rtag_name"), "class='form_ivalue' size='60'" )%></td>
                        <td valign="top"><%=objForm.Validate ("rtag_name")%></td>
                  </tr>
                  <tr>
                        <td nowrap class="form_iname" valign="top">Branch Release </td>
                        <td valign="top" nowrap class="form_iname">
                          <input name="branch" type="radio" value="N" checked>
                          No
                          <input name="branch" type="radio" value="Y">
                          Yes</td>
                        <td valign="top"></td>
                  </tr>
                  <tr>
                        <td valign="top" nowrap class="form_iname">Comments</td>
                        <td valign="top"><%=objFormComponent.TextArea ( "rtag_description", Request("rtag_description"), 10, 60, "class='form_ivalue'" )%></td>
                        <td valign="top"><%=objForm.Validate ("rtag_description")%></td>
                  </tr>
                  <tr>
                        <td width="10%" class="form_iname">&nbsp;</td>
                        <td width="1%">&nbsp;</td>
                        <td width="90%" class="val_err"></td>
                  </tr>
                </table>
                
                </td>
        <td background="images/lbox_bgside_white.gif">&nbsp;</td>
      </tr>
          <tr>
        <td background="images/bg_action_norm.gif" ></td>
        <td align="right" background="images/bg_action_norm.gif" >
                <%=objFormComponent.SubmitButton ( "Submit", "class='form_btn'" )%>&nbsp;
                <%=objFormComponent.CancelButton ( "Cancel", "class='form_btn'", "rtree.asp?CANCEL=OK&"& objPMod.ComposeURL() )%>
                <%=objPMod.ComposeHiddenTags()%>
                <input type="hidden" name="source_rtag_id" value="<%=parSourceRtagId%>">
                <input type="hidden" name="action" value="true">
                </td>
        <td background="images/bg_action_norm.gif" ><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
      </tr>
      <tr>
        <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
        <td background="images/lbox_bg_blue.gif"></td>
        <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
      </tr>
    </table>
        
        <!-- ACTION BUTTONS ---------------------------------------------->
        <!-- ACTION BUTTONS END  ------------------------------------------></td>
        <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
  </tr>
  <tr> 
    <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30"></td>
    <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="500"></td>
  </tr>
<%
Call objFormComponent.FormEnd()
'-- FROM END ----------------------------------------------------------------------------------------------------------------
%>   
</table>


<!-- FOOTER -->
<!--#include file="_footer.asp"-->
</body>
</html>
<%
Call Destroy_All_Objects
%>