Subversion Repositories DevTools

Rev

Rev 121 | Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
Option explicit
Response.Expires = 0    ' always load the page, dont store
%>
<%
'=====================================================
'                                       Gey 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="class/classSortHelper.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim parPkg_id
Dim parPkg_name
Dim parPv_id
Dim rsLatest
Dim parHidePatches
Dim aVersions
Dim lastRow, i
Dim objSortHelper
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parPkg_id = QStrPar("pkg_id")
parPkg_name = QStrPar("pkg_name")
If Request("pv_id") <> "" Then
        parPv_id = Request("pv_id")
Else
        parPv_id = -1
End If
parHidePatches = Request("hidepatches")
'----------------------------------------------
%>
<%
Sub Get_Pkg_Info_From_Rel ( SSrtag_id, SSpv_id )
        Dim rsTemp, Query_String

        Query_String = _
        " SELECT pkg.pkg_name, pv.pkg_version, gr.group_id"&_
        "  FROM PACKAGES pkg, package_versions pv, release_content rc, GROUPS gr"&_
        " WHERE     pkg.pkg_id = pv.pkg_id"&_
        "        AND pv.pv_id = rc.pv_id"&_
        "        AND gr.group_id = rc.group_id"&_
        "        AND rc.rtag_id = "& SSrtag_id &_
        "        AND rc.pv_id = "& SSpv_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_version", (rsTemp.Fields("pkg_version"))
                pkgInfoHash.Add "group_id", (rsTemp.Fields("group_id"))
        End If

        rsTemp.Close
        Set rsTemp = nothing
End Sub


Function Get_Latest_All_Ext ( NNpkg_id, nPv_id )
        Get_Latest_All_Ext = _
        " SELECT pv.pkg_version, pv.dlocked,"&_
        "        DECODE ( pv.pv_id, "& nPv_id &", 'selected', NULL ) AS selected"&_
        "    FROM PACKAGES pkg, package_versions pv"&_
        "   WHERE pkg.pkg_id = pv.pkg_id  AND  pkg.pkg_id = "& NNpkg_id

        If parHidePatches <> "" Then Get_Latest_All_Ext = Get_Latest_All_Ext &" AND pv.is_patch IS NULL"

        'Get_Latest_All_Ext = Get_Latest_All_Ext &"   ORDER BY pv.v_ext ASC, pv.pkg_version ASC"
        'Response.write Get_Latest_All_Ext
End Function

'------------------------------------------------------------------------------------------------------------------
Sub PrintArray(vec,lo,hi,mark)
  '==-----------------------------------------==
  '== Print out an array from the lo bound    ==
  '==  to the hi bound.  Highlight the column ==
  '==  whose number matches parm mark         ==
  '==-----------------------------------------==

  Dim i,j
  Response.Write "<table border=""1"" cellspacing=""0"">"
  For i = lo to hi
    Response.Write "<tr>"
    For j = 0 to Ubound(vec,1)
      If j = mark then
        Response.Write "<td bgcolor=""FFFFCC"">"
      Else
        Response.Write "<td>"
      End If
      Response.Write vec(j,i) &  "</td>"
    Next
    Response.Write "</tr>"
  Next
  Response.Write "</table>"
End Sub  'PrintArray
%>
<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">
<!--
function updateParent(cancelled) {
        window.opener.updateFields("<%=parPv_id%>","<%=parPkg_id%>",document.NewVersion.FRpkgver.value,cancelled);
        self.close();
    return false;
}
// -->
</script>

</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
<form name="NewVersion" >
  <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_pkg_off.gif" width="22" height="25" hspace="5"></td>
      <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Get Package Version</td>
      <td background="images/lbox_bg_blue.gif" align="right" width="50%">
        <input type="reset" name="btn" value=" Get " class="form_btn_comp" onClick="return updateParent(false);">
        <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onClick="return updateParent(true);">
      </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_item" background="images/bg_form_lightbluedark.gif"><%=parPkg_name%></td>
            <td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
                        <select name="FRpkgver" class="form_item">
                                <option value=""></option>
                        <%Set rsLatest = OraDatabase.DbCreateDynaset( Get_Latest_All_Ext( parPkg_id, parPv_id ), cint(0))

                        If rsLatest.RecordCount > 0 Then

                                aVersions = rsLatest.GetRows()
                                lastRow = UBound( aVersions, 2 )

                                Set objSortHelper = New SortHelper

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

                                ' Descending order
                                For i = lastRow To 0 Step -1
                                %>
                                        <option value="<%=aVersions( rsLatest.FieldIndex("pkg_version"), i )%>" <%=aVersions( rsLatest.FieldIndex("selected"), i )%>><%If aVersions( rsLatest.FieldIndex("dlocked"), i ) = "Y" Then%>R&nbsp;<%Else%>&nbsp;&nbsp;&nbsp;&nbsp;<%End If%><%=aVersions( rsLatest.FieldIndex("pkg_version"), i )%></option>
                                <%
                                Next

                                Set objSortHelper = nothing

                        End If
                        %>
                        </select>
                        </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%"></td>
          </tr>
                  <tr>
            <td width="1%">&nbsp;</td>
            <td width="1%" nowrap class="form_field" colspan="2">R = Released</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"-->