Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'                                       Rename Version
'               --- PROCESS FORM ---
'=====================================================
%>
<%
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/common_dbedit.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim parPv_id
Dim parRfile
Dim rsPkgInfo
Dim errMessage
Dim objPkgInfo
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parPv_id = QStrPar("pv_id")
parRfile = QStrPar("rfile")
Set objPkgInfo = CreateObject("Scripting.Dictionary")
'----------------------------------------------
%>
<%
'-----------------------------------------------------------------------------------------------------------------------------
Sub GetPackageInfo( nPvId, outPkgInfo )
        Dim rsTemp, Query_String
        If IsEmpty(nPvId) Then Exit Sub
        
        Query_String = _
        " SELECT pv.pv_id, pkg.pkg_id, pkg.pkg_name, pv.pkg_version, pv.v_ext, pv.build_type"&_
        "  FROM packages pkg, package_versions pv"&_
        " WHERE pkg.pkg_id = pv.pkg_id  AND pv.pv_id ="& nPvId
        
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
        
        If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
                outPkgInfo.Item("pv_id") = rsTemp.Fields("pv_id")
                outPkgInfo.Item("pkg_id") = rsTemp.Fields("pkg_id")
                outPkgInfo.Item("pkg_name") = rsTemp.Fields("pkg_name")
                outPkgInfo.Item("pkg_version") = rsTemp.Fields("pkg_version")
                outPkgInfo.Item("v_ext") = rsTemp.Fields("v_ext")
                outPkgInfo.Item("build_type") = rsTemp.Fields("build_type")
                
                If rsTemp.Fields("build_type") = "M" Then
                        objPkgInfo.Item("M_checked") = "checked"
                        objPkgInfo.Item("A_checked") = ""
                        objPkgInfo.Item("M_display") = "style='display:block;'"
                        objPkgInfo.Item("A_display") = "style='display:none;'"
                ElseIf rsTemp.Fields("build_type") = "A" Then
                        objPkgInfo.Item("M_checked") = ""
                        objPkgInfo.Item("A_checked") = "checked"
                        objPkgInfo.Item("M_display") = "style='display:none;'"
                        objPkgInfo.Item("A_display") = "style='display:block;'"
                End If
        End If
        
        
        
        rsTemp.Close
        Set rsTemp = nothing
End Sub
'-----------------------------------------------------------------------------------------------------------------------------
Sub Rename_Pkg_Version ( NNpv_id, SSnewVersion, errMessage )
        OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
        OraDatabase.Parameters.Add "NNpv_id", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
        
        If Request("build_type") = "M" Then
                ' Manual build
                OraDatabase.Parameters.Add "SSpkg_version",  SSnewVersion,               ORAPARM_INPUT, ORATYPE_VARCHAR2
        Else
                ' Automated Build
                OraDatabase.Parameters.Add "SSpkg_version",  Request("v_ext"), ORAPARM_INPUT, ORATYPE_VARCHAR2
                
        End If
        
        OraDatabase.Parameters.Add "BUILD_TYPE", Request("build_type"), ORAPARM_INPUT, ORATYPE_CHAR
        OraDatabase.Parameters.Add "NNuser_id", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
        
        
        OraDatabase.Parameters.Add "errMessage", 0, ORAPARM_OUTPUT, ORATYPE_VARCHAR2 
        
        
        OraSession.BeginTrans
        
        OraDatabase.ExecuteSQL _
        "BEGIN Rename_Package_Version ( :NNpv_id,"&_
    "                               :SSpkg_version,"&_
    "                               :BUILD_TYPE,"&_
    "                               :NNuser_id,"&_
    "                               :errMessage ); END;"
        
        
        'OraDatabase.ExecuteSQL _
        '       "BEGIN "&_
        '       " Reset_Ignore_Warnings ( :NNpv_id, :RTAG_ID, :NNuser_id );"&_
        '       " Touch_Release ( :RTAG_ID ); "&_
        '       "END; "
                
        errMessage = OraDatabase.Parameters("errMessage").Value 
        
        OraSession.CommitTrans
        
        
        OraDatabase.Parameters.Remove "RTAG_ID"
        OraDatabase.Parameters.Remove "NNpv_id"
        OraDatabase.Parameters.Remove "SSpkg_version"
        OraDatabase.Parameters.Remove "NNuser_id"
        OraDatabase.Parameters.Remove "errMessage"
        OraDatabase.Parameters.Remove "BUILD_TYPE"
End Sub
'-----------------------------------------------------------------------------------------------------------------------------
%>
<%
'-----------------------  MAIN LINE  ---------------------------
'--- Process submition ---
If CBool(QStrPar("action")) AND  objAccessControl.UserLogedIn  Then
        
        Call Rename_Pkg_Version ( parPv_id, Request("FRnewver"), errMessage )
        
        If NOT IsNull(errMessage) Then
                Call RaiseMsgInParent ( Eval(errMessage), parRtag_id &"|"& parPv_id)
        Else
                Call OpenInParentWindow ( parRfile &"?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
        End If
        
        Call CloseWindow
End If
%>
<%Call GetPackageInfo( parPv_id, objPkgInfo )%>
<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>
<!-- TIPS -->
<script language="JavaScript" src="images/tipster.js"></script>
<script language="JavaScript" src="images/_help_tips.js"></script>

</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();<%If objPkgInfo("build_type") = "M" Then Response.Write("document.renameversion.FRnewver.focus();")%>">
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!----------------------------------------------------->
<form name="renameversion" method="post" action="<%=scriptName%>" >
  <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
    <tr> 
      <td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_new_off.gif" width="18" height="23" hspace="5" border="0"></td>
      <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Reversion Package </td>
      <td background="images/lbox_bg_blue.gif" align="right" width="50%"> 
        <input type="submit" name="btn" value="Submit" class="form_btn_comp">
        <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
      </td>
      <td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap> 
        <img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
    </tr>
    <tr> 
      <td height="100%" width="1%">&nbsp;</td>
      <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif"> 
        <table width="100%" border="0" cellspacing="1" cellpadding="2">
          <tr> 
            <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
            <td width="1%" nowrap class="form_group" valign="bottom"></td>
            <td nowrap width="100%"></td>
          </tr>
          <tr> 
            <td width="1%">&nbsp;</td>
            <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objPkgInfo.Item("pkg_name")%></td>
          </tr>
          <tr>
            <td>&nbsp;</td>
            <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">&nbsp;</td>
            <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                                <input name="build_type" type="radio" value="M" <%=objPkgInfo.Item("M_checked")%> onclick="Visible ('divVersionNumber','block','divVersionExt','none')"> Manual Build
                                <input name="build_type" type="radio" value="A" <%=objPkgInfo.Item("A_checked")%> onclick="Visible ('divVersionNumber','none','divVersionExt','block')"> Automated Build
                        </td>
          </tr>
          <tr> 
            <td>&nbsp;</td>
            <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Version</td>
                <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
                          <DIV id="divVersionNumber" name="divVersionNumber" <%=objPkgInfo.Item("M_display")%>>
                                <input type="text" name="FRnewver" class="form_item" size="12" value="<%=objPkgInfo.Item("pkg_version")%>"> 
                          </DIV>
                          <DIV id="divVersionExt" name="divVersionExt" <%=objPkgInfo.Item("A_display")%>>
                                (auto-number)<input type="text" name="v_ext" class="form_item" size="5" value="<%=objPkgInfo.Item("v_ext")%>"><%=Quick_Help ( "v_ext" )%>
                          </DIV>
            </td>
          </tr>
          <tr> 
            <td width="1%">&nbsp;</td>
            <td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
            <td nowrap width="100%"> <p>&nbsp;</p></td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
      <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
    </tr>
  </table>
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
<input type="hidden" name="rfile" value="<%=parRfile%>">
<input type="hidden" name="action" value="true">   
</form>
</body>
</html>


<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->