Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
Option explicit
Response.Expires = 0    ' always load the page, dont store
%>
<%
'=====================================================
'                                       Change Previous Version
'=====================================================
%>
<!--#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"-->
<!--#include file="class/classSortHelper.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
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
parPv_id = QStrPar("pv_id")
parRfile = QStrPar("rfile")
'----------------------------------------------
%>
<%
Sub Short_Pkg_Info ( NNpv_id )
        Dim rsTemp, Query_String
        
        Query_String = _
        " SELECT pkg.pkg_name, pv.pkg_version, pv.pkg_id, pv.last_pv_id"&_
        "   FROM packages pkg, package_versions pv"&_
        "  WHERE pkg.pkg_id = pv.pkg_id"&_
        "    AND pv.pv_id = "& NNpv_id
        
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
        
        If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
                pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
                pkgInfoHash.Add "pkg_id", (rsTemp.Fields("pkg_id"))
                pkgInfoHash.Add "last_pv_id", (rsTemp.Fields("last_pv_id"))
        End If
        
        rsTemp.Close
        Set rsTemp = nothing
End Sub


Function All_Versions_List ( nOldPv_id, nPkg_id  )
        If nOldPv_id = "" OR IsNull(nOldPv_id) Then nOldPv_id = "-1"
        All_Versions_List = _
        " SELECT pv.pv_id, pv.pkg_version, pv.dlocked,"&_
        "          DECODE(pv.pv_id, "& nOldPv_id &", 'selected', NULL) AS selected  "&_
        "  FROM PACKAGE_VERSIONS pv"&_
        " WHERE pv.pkg_id = "& nPkg_id &_
        "   AND pv.is_patch IS NULL"
        'Response.write All_Versions_List
End Function

Sub Update_Previous_Version ( NNpv_id, nLast_pv_id )
        Dim rsTemp, Query_String
        If nLast_pv_id = "" Then nLast_pv_id = NULL
        
        Query_String = _
        " SELECT last_pv_id, release_notes_info"&_
        " FROM package_versions"&_
        " WHERE pv_id = "& NNpv_id 
        
        Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
        'update fields
        rsTemp.Edit
        rsTemp.Fields("last_pv_id").Value = nLast_pv_id
        rsTemp.Fields("release_notes_info").Value = NULL
        rsTemp.Update
        
        rsTemp.Close
        Set rsTemp = nothing
End Sub
%>
<%
'Process submition
If CBool(QStrPar("action")) AND  objAccessControl.UserLogedIn Then
        Call Update_Previous_Version ( parPv_id, Request("last_pv_id") )
        
        Call OpenInParentWindow ( parRfile &"?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
        Call CloseWindow
        
        
End If
%>
<%
Call Short_Pkg_Info ( parPv_id )
%>
<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/tipster.js"></script>
<script language="JavaScript" src="images/_help_tips.js"></script>
<script language="JavaScript" src="images/common.js"></script>
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
<form name="preversion" 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"></td>
      <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Previous 
        Version </td>
      <td background="images/lbox_bg_blue.gif" align="right" width="50%"> 
        <input type="submit" name="btn" value="Update" 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%">&nbsp; </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"> 
              <%=pkgInfoHash.Item ("pkg_name")%></td>
          </tr>
          <tr> 
            <td width="1%">&nbsp;</td>
            <td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Previous 
              Version </td>
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
                        <select name="last_pv_id" class="form_item">
                                <option></option>
                <%
                            Dim rsQry,aVersions,lastRow,objSortHelper,i
                            Set rsQry = OraDatabase.DbCreateDynaset( All_Versions_List( pkgInfoHash.Item ("last_pv_id"), pkgInfoHash.Item ("pkg_id") ), cint(0))

                If rsQry.RecordCount > 0 Then
                    aVersions = rsQry.GetRows()
                    lastRow = UBound( aVersions, 2 )
                    Set objSortHelper = New SortHelper

                    ' Sort versions
                    Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsQry.FieldIndex("pkg_version") )

                    ' Descending order
                    For i = lastRow To 0 Step -1
                %>
                    <option value="<%=aVersions(rsQry.FieldIndex("pv_id"),i)%>" <%=aVersions(rsQry.FieldIndex("selected"),i)%>>

                <%
                    If aVersions( rsQry.FieldIndex("dlocked"), i ) = "Y" Then%>
                     R&nbsp;
                  <%Else%>
                     &nbsp;&nbsp;&nbsp;&nbsp;
                  <%End If%>
                  <%=aVersions( rsQry.FieldIndex("pkg_version"), i )%>
               </option>
            <%
                Next
                Set objSortHelper = nothing
                End If
                        rsQry.Close
                        set rsQry = nothing
                        %>
                        </select>
            <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">
            </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>
</form>
<!-- TIPS LAYERS -------------------------------------->
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
<!----------------------------------------------------->
</body>
</html>


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