Subversion Repositories DevTools

Rev

Rev 5590 | Rev 6750 | 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
%>
<%
'=====================================================
'                                       Import Release
'=====================================================
%>
<!--#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"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim parFRproj_id
Dim parFRrtag_id
Dim parToRtag_id
Dim parFromRtag_id
Dim sMessage
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parFRproj_id = QStrPar("FRproj_id")
parFRrtag_id = QStrPar("FRrtag_id")
parToRtag_id = QStrPar("ToRtag_id")
parFromRtag_id = QStrPar("FromRtag_id")
sMessage = NULL
If parFRproj_id = "" Then parFRproj_id = "-1"
If parFRrtag_id = "" Then parFRrtag_id = "-1"
'----------------------------------------------
%>
<%
Sub Get_Projects ( NNproj_id )
        Dim rsTemp, Query_String, tempLINK
        Query_String = _
        "SELECT * FROM projects ORDER BY proj_name ASC"
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
        
        Response.write "<select name='FRproj_id' onChange=""MM_showProgressBar();MM_jumpMenu('window',this,0)"" class='form_item'>"
                Response.write "<option value=''>Select Project</option>"
                While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
                        tempLINK = scriptName &"?FRproj_id="& rsTemp.Fields("proj_id") &"&FRrtag_id=&ToRtag_id="& parToRtag_id &"&"& objPMod.ComposeURL()
                        
                        If NNproj_id = Cstr(rsTemp.Fields("proj_id")) Then
                        Response.write "<option value='"& tempLINK &"' selected>"& UCase(rsTemp.Fields("proj_name")) &"</option>"
                Else
                                Response.write "<option value='"& tempLINK &"'>"& UCase(rsTemp.Fields("proj_name")) &"</option>"
                        End If
                        rsTemp.MoveNext
                WEnd
        Response.write "</select>"
        
        rsTemp.Close
        Set rsTemp = nothing
End Sub

Sub Get_Release_Labels ( NNproj_id, NNrtag_id )
        Dim rsTemp, Query_String, tempLINK
        Query_String = _
        "SELECT rtag_id, rtag_name FROM release_tags WHERE proj_id = "& NNproj_id &" ORDER BY rtag_id ASC"
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
        
        Response.write "<select name='FRrtag_id' onChange=""MM_showProgressBar();MM_jumpMenu('window',this,0)"" class='form_item'>"
                If NNproj_id <> "-1" Then
                        Response.write "<option value=''>Select Release Label</option>"
                        While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
                                tempLINK = scriptName &"?FRrtag_id="& rsTemp.Fields("rtag_id") &"&FRproj_id="& NNproj_id &"&ToRtag_id="& parToRtag_id &"&"& objPMod.ComposeURL()
                                
                                If NNrtag_id = Cstr(rsTemp.Fields("rtag_id")) Then
                                Response.write "<option value='"& tempLINK &"' selected>"& (rsTemp.Fields("rtag_name")) &"</option>"
                        Else
                                        Response.write "<option value='"& tempLINK &"'>"& (rsTemp.Fields("rtag_name")) &"</option>"
                                End If
                                rsTemp.MoveNext
                        WEnd
                End If
        Response.write "</select>"
        
        rsTemp.Close
        Set rsTemp = nothing
End Sub

Function Import_Release ( NNFromRtag_id, NNToRtag_id )
        
        OraDatabase.Parameters.Add "FROMRTAG_ID", NNFromRtag_id,        ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "TORTAG_ID", NNToRtag_id,    ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER 
        
    sMessage = NNFromRtag_id &":"& NNToRtag_id 

        objEH.ErrorRedirect = FALSE
        objEH.TryORA ( OraSession )
        On Error Resume Next
        
        ' Remove old Work in Progress Contents
        OraDatabase.ExecuteSQL _
                "BEGIN  PK_RELEASE.IMPORT_RELEASE_CONTENTS (:FROMRTAG_ID, :TORTAG_ID, :USER_ID); END;"
        
        objEH.CatchORA ( OraSession )
     If objEH.Finally Then
        Call OpenInParentWindow ("dependencies.asp?rtag_id=" & NNToRtag_id)
        Call CloseWindow()
     End If

        OraDatabase.Parameters.Remove "FROMRTAG_ID"
        OraDatabase.Parameters.Remove "TORTAG_ID"
        OraDatabase.Parameters.Remove "USER_ID"
End Function

%>
<%
'Process submition
If CBool(QStrPar("action")) Then
    If NOT objAccessControl.UserLogedIn Then
        sMessage = "User is no longer logged in"
    ElseIf NOT( (parFromRtag_id <> "") AND (parToRtag_id <> "")) Then
        sMessage = "Internal: Mandatory parameters are missing"
    Else
        Call Import_Release ( parFromRtag_id, parToRtag_id )
        parFRproj_id = "-1"
        parFRrtag_id = "-1" 
    End If
End If
%>
<html>
<head>
<title>Release Manager</title>
<link rel="shortcut icon" href="<%=FavIcon%>"/>
<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();">
<form class="form_tight" name="importrel" method="post" action="<%=scriptName%>">
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr>
        <td colspan="2" class="body_txt">
            Select the source Project and Release.
            <br>All packages from the selected Release will be imported into this Release.
            <p>
        </td>
    </tr>
    <tr> 
      <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif"> 
         <!-- LOCAL MESSAGES ++++++++++++++++++++++++++++++++++++++++++++ -->
         <%Call Messenger ( sMessage , 3, "100%" )%>
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <!--#include file="messages/_msg_inline.asp"-->
        <table width="100%" border="0" cellspacing="1" cellpadding="2">
          <tr> 
            <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Project</td>
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"> 
              <%Call Get_Projects ( parFRproj_id )%>
            </td>
          </tr>
          <tr> 
            <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Release 
              Name </td>
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"> 
              <%Call Get_Release_Labels ( parFRproj_id, parFRrtag_id )%>
              <input type="hidden" name="ToRtag_id" value="<%=parToRtag_id%>">
                          <input type="hidden" name="FromRtag_id" value="<%=parFRrtag_id%>">
                          <input type="hidden" name="rtag_id" value="<%=Request("rtag_id")%>">
              <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="Import" class="form_btn_comp" onClick="MM_validateForm('FRproj_id','Project','R','FRrtag_id','Release Name','R');return document.MM_returnValue">
        <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"-->