Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                      view by version                      |
'|                                                   |
'=====================================================
%>
<%
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="class/classSortHelper.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim rsRep
Dim parFPkgVersion
Dim sLink
Dim parPkgId
Dim PackageName
Dim imgLock
Dim DestroyPackage
Dim CanDestroyPackage 
'------------ Constants Declaration -----------
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2'>"
'------------ Variable Init -------------------
parFPkgVersion = Request("fpkgversion")
If parFPkgVersion = "" Then  parFPkgVersion = "*"

parPkgId = Request("pkg_id")

'----------------------------------------------
%>
<%
'-----------------------------------------------------------------------------------------------------------------------
Function GetPackageName ( nPkgId )
        Dim rsQry, query
        
        query = _
        " SELECT PKG_NAME  FROM PACKAGES  WHERE PKG_ID = :PKG_ID"
        
        OraDatabase.Parameters.Add "PKG_ID", nPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
        
        Set rsQry = OraDatabase.DbCreateDynaset( query, 0 )
        
        OraDatabase.Parameters.Remove "PKG_ID"
        
        GetPackageName = rsQry("pkg_name")
        
        rsQry.Close()
        Set rsQry = nothing
End Function
'-----------------------------------------------------------------------------------------------------------------------
%>
<%
'==================== MAIN LINE ===============================
If (parPkgId = "") Then Response.Redirect ("index.asp")

PackageName = GetPackageName ( parPkgId )
'==============================================================
%>
<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" >
<!-- MENU LAYERS -------------------------------------->
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)"> 
</div>
<!-- HEADER -->
<!--#include file="_header.asp"-->
<!-- BODY ---->
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr> 
    <td width="1%" background="images/bg_home_orange.gif" valign="top">
      <!--#include file="_front_explorer.asp"-->
    </td>
    <td rowspan="2" valign="top"> 
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td >
                  
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr> 
                          <td width="1%"></td>
                          <td width="100%" align="right"><img src="images/h_trsp_dot.gif" width="1" height="20"></td>
                          <td width="1%"></td>
                        </tr>
                        <tr> 
                          <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="500"></td>
                          <td bgcolor="#FFFFFF" valign="top"> 
                                <!-- PACKAGE SEARCH ------------------------------------------------>
                                <%
                                
                                Dim aVersions
                                Dim lastRow
                                Dim objSortHelper
                                Dim i
                                
                                OraDatabase.Parameters.Add "PKG_VERSION",       Replace( parFPkgVersion, "*", "%" ), ORAPARM_INPUT, ORATYPE_VARCHAR2
                                OraDatabase.Parameters.Add "PKG_ID",    parPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
                                
                                Set rsRep = OraDatabase.DbCreateDynaset( GetQuery("FindPackageVersion.sql"), 0 )
                                
                                OraDatabase.Parameters.Remove "PKG_ID"
                                OraDatabase.Parameters.Remove "PKG_VERSION"
                                
                                
                                %>
                                
                                <table width="100%"  border="0" cellspacing="0" cellpadding="5">
                                  <tr>
                    <td class="body_sect">Package Versions</td>
                  </tr>
                  <tr>
                    <td nowrap bgcolor="#E4E9EC" class="body_txt">
                                                Results for <b><%=PackageName%></b>
                                        </td>
                  </tr>
                </table>
                                
                                
                                
                                <table width="100%" border="0" cellspacing="1" cellpadding="5">
                                <form name="versions" method="get" action="<%=ScriptName%>">
                                  <input type="hidden" name="pkg_id" value="<%=parPkgId%>">
                                  <input type="hidden" name="listby" value="<%=parListBy%>">
                                 <tr>
                    <td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
                                        <td width="20%" nowrap class="body_col" bgcolor="#E4E9EC">Version</td>
                                        <td width="60%" nowrap class="body_col" bgcolor="#E4E9EC">Reason for Release</td>
                                        <td width="20%" nowrap class="body_col" bgcolor="#E4E9EC">Last Modified</td>
                                        <td width="1" nowrap class="body_col" bgcolor="#E4E9EC"></td>
                  </tr>
                                  <tr>
                    <td nowrap bgcolor="#E4E9EC"></td>
                                        <td nowrap bgcolor="#E4E9EC"><input name="fpkgversion" type="text" class="form_item" size="15" value="<%=parFPkgVersion%>"></td>
                                        <td nowrap bgcolor="#E4E9EC"></td>
                                        <td nowrap bgcolor="#E4E9EC"></td>
                                        <td nowrap bgcolor="#E4E9EC"></td>
                  </tr>
                                  <%
                                  ' Descending order
                                If rsRep.RecordCount = 0 Then
                                        
                                        With Response
                                                .write "<tr>"
                                                .write "<td colspan='5' class='body_row'>Found 0 records.</td>"
                                                .write "</tr>"
                                        End With
                                        
                                Else
                                        
                                        aVersions = rsRep.GetRows()
                                        lastRow = UBound( aVersions, 2 )
                                        
                                        Set objSortHelper = New SortHelper
                                        
                                        
                                        ' Sort versions
                                        Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsRep.FieldIndex("pkg_version") )
                                        
                                        
                                        DestroyPackage = ""
                                        CanDestroyPackage = objAccessControl.IsVisible ( "DestroyPackage" )
                                        
                                        
                                  ' Descending order
                                  For i = lastRow To 0 Step -1
                                        imgLock = IMG_NOT_OFFICIAL
                                        If (aVersions( rsRep.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsRep.FieldIndex("dlocked"), i ) = "A") Then
                                                imgLock = IMG_OFFICIAL
                                        End If
                                        
                                        sLink = "dependencies.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )
                                        
                                        ' Set destroy package action
                                        If CanDestroyPackage Then
                                                DestroyPackage = "<a href='_destroy_package.asp?pv_id="& aVersions( rsRep.FieldIndex("pv_id"), i )  &"&bfile="& ScriptName &"&pkg_id="& parPkgId &"&listby="& parListBy &"' "&_
                                                                                 " title='Destroy this package from the database.' "&_
                                                                                 " onClick='return confirmAction(""You are about to destroy ["& PackageName &" "& aVersions( rsRep.FieldIndex("pkg_version"), i ) &"]. You cannot undo this operation.\nDo you want to proceed?"");' ><img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ><a>"
                                        End If
                                  %>
                                          <tr> 
                                            <td valign="top" bgcolor="#F5F5F5"><%=imgLock%></td>
                                                <td nowrap class="body_row" valign="top" bgcolor="#F5F5F5"><a href="<%=sLink%>" class="body_link"><%=aVersions( rsRep.FieldIndex("pkg_version"), i )%></a></td>
                                                <td class="body_txt_gray" valign="top"  bgcolor="#F5F5F5"><%=NewLine_To_BR ( To_HTML( aVersions( rsRep.FieldIndex("comments"), i ) ) )%></td>
                                                <td nowrap class="body_row" valign="top" bgcolor="#F5F5F5"><%= "<a href='mailto:"& aVersions( rsRep.FieldIndex("user_email"), i ) &"' class='txt_linked'><img src='images/i_user.gif' width='10' height='13' hspace='2' border='0' align='absmiddle' alt='"& aVersions( rsRep.FieldIndex("full_name"), i ) &" &lt;"& aVersions( rsRep.FieldIndex("user_email"), i ) &"&gt;'>"& aVersions( rsRep.FieldIndex("full_name"), i ) &"</a> "& EuroDateTime ( aVersions( rsRep.FieldIndex("modified_stamp"), i ) )%></td>
                                                <td valign="top" bgcolor="#F5F5F5"><%=DestroyPackage%></td>
                                          </tr>
                                  <%  
                                          
                                  Next
                                  
                                  rsRep.Close()
                                  
                                End If
                                  %>
                                  <tr> 
                                        <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                                  </tr>
                                  
                                  </form>
                                </table>
                                <br>
                                <!------------------------------------------------------------>                 
                                
                                  
                                </td>
                          <td background="images/lbox_bgside_white.gif">&nbsp;</td>
                        </tr>
                  </table>
                  
                  </td>
        </tr>
      </table>
    </td>
    <td width="11%">&nbsp;</td>
  </tr>
  <tr> 
    <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_gear.gif" width="107" height="107" vspace="20" hspace="30"></td>
    <td>&nbsp;</td>
  </tr>
</table>
<!-- FOOTER -->
<!--#include file="_footer.asp"-->
</body>
</html>