Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'   Build Release Log
'   Display the Build Instances for the specified release
'=====================================================
%>
<%
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/_form_window_common.asp"-->
<!--#include file="_action_buttons.asp"-->
<!--#include file="class/classActionButtonControl.asp"-->
<%'------------ ACCESS CONTROL ------------------ %>
<% '------------ Scripts -------------------------- %>
<%
'------------ Variable Definition -------------
Dim parRtagId
Dim parPage
Dim parRefresh
Dim rsQry
Dim nextPage, lastPage, maxPage

'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parRtagId = Request("rtag_id")
parPage = NiceInt(Request("page"),0)
parRefresh = NiceInt(Request("refresh"),0) 

'----------------------------------------------
Sub GetFormDetails ( parRtagId, page, ByRef rsQry )
   Dim query, qwrapper, perPage
   Dim qCount, rsQryCount
   Dim rtagQuery, rtagQuery1

   perPage = 40

   rtagQuery = ""
   rtagQuery1 = ""
   If parRtagId <> "" Then
       rtagQuery = " where bi.RTAG_ID = :RTAG_ID"
       rtagQuery1 = " and bi.RTAG_ID = :RTAG_ID"
   End If

   query = _
        "select bi.PV_ID, bi.RTAG_ID,pv.pkg_id," &_
        "  SUBSTR(pj.PROJ_NAME, 0, 30) as PROJ_NAME, " &_
        "  pj.PROJ_ID, " &_
        "  SUBSTR(rt.RTAG_NAME, 0, 30) as RTAG_NAME, " &_
        "  p.PKG_NAME, " &_
        "  pv.PKG_VERSION, " &_
        "  pv.PV_DESCRIPTION, " &_
        "  pv.COMMENTS, " &_
        "  NVL(pv.V_EXT, '') as V_EXT, " &_
        "  TO_CHAR(bi.TIMESTAMP, 'Dy DD-Mon-YYYY HH24:MI:SS') as TIMESTAMP, " &_
        "  DECODE(bi.reason, 'N', 'New Version', 'R', 'Ripple', 'Unknown') as REASON" &_
        " from BUILD_INSTANCES bi, " &_
        "     projects pj, " &_
        "     RELEASE_TAGS rt, " &_
        "     packages p, " &_
        "     PACKAGE_VERSIONS pv" &_
        " where bi.PV_ID = pv.pv_id " &_
        "  and pv.PKG_ID = p.PKG_ID" &_
        "  and bi.RTAG_ID = rt.RTAG_ID" &_
        "  and rt.proj_id = pj.proj_id" &_
        rtagQuery1 &_
        " order by bi.BUILD_ID desc"

    qwrapper = _
        "select * " &_
        "  from ( select /*+ FIRST_ROWS(n) */ " &_
        "  a.*, ROWNUM rnum " &_
        "      from ( "&query&" ) a " &_
        "      where ROWNUM <= :MAX_ROW_TO_FETCH) " &_
        "where rnum  >= :MIN_ROW_TO_FETCH"

    qCount = "select count(*) as count from BUILD_INSTANCES bi" & rtagQuery

   OraDatabase.Parameters.Add "MIN_ROW_TO_FETCH",   page * perPage,    ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "MAX_ROW_TO_FETCH",   (page +1 )*perPage,    ORAPARM_INPUT, ORATYPE_NUMBER
   OraDatabase.Parameters.Add "RTAG_ID",   parRtagId,    ORAPARM_INPUT, ORATYPE_NUMBER
   Set rsQryCount = OraDatabase.DbCreateDynaset( qCount, ORADYN_DEFAULT )
   Set rsQry = OraDatabase.DbCreateDynaset( qwrapper, ORADYN_DEFAULT )
   OraDatabase.Parameters.Remove "RTAG_ID"
   OraDatabase.Parameters.Remove "MAX_ROW_TO_FETCH"
   OraDatabase.Parameters.Remove "MIN_ROW_TO_FETCH"

   ' Calculate next and last page numbers
   maxPage = Int((rsQryCount("count")-1) / perPage)

   If (page + 1) <= maxPage Then
       nextPage = page + 1
   End If
   If parPage > 0 Then
       lastPage = page - 1
   End If

   rsQryCount.Close()
   Set rsQryCount = nothing

End Sub

' Write out a pagination indication
' Supress the link iff there is no page
Sub writePageTag( pageNum, text, parm )
    If pageNum <> "" Then Response.Write "<a class=""txt_linked"" href=""build_release_log.asp?rtag_id=" & parRtagId & "&page=" & pageNum & parm & """>"
    Response.Write text
    If pageNum <> "" Then Response.Write "</a>"
End Sub
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------

'----------------------------------------------
%>
<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">
      <%If parRefresh > 0 Then%>
         <META HTTP-EQUIV=REFRESH CONTENT=<%=parRefresh * 60%>>
      <%End If%>
      <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 type="text/javascript" src="scripts/json2.js"></script>
      <script language="JavaScript" src="images/tipster.js"></script>
      <script language="JavaScript" src="images/_help_tips.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" onload="isChecked('pv_id_list','submit');">
      <!-- MENU LAYERS -------------------------------------->
      <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
      <!-- TIPS LAYERS -------------------------------------->
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</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"></td>
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
               
               <!-- Build Instances Display -->
               <table width="10" border="0" cellspacing="0" cellpadding="0">
                  <!-- Display Title -->
                  <tr>
                     <td width="1%"></td>
                     <td width="100%">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                           <tr>
                              <%If parRtagId = "" Then %>
                              <td nowrap class="form_ttl">SYSTEM BUILD LOG</td>
                              <%Else%>
                              <td nowrap class="form_ttl">RELEASE BUILD LOG</td>
                              <%End If%>
                              <td align="right" valign="bottom"></td>
                           </tr>
                        </table>
                     </td>
                     <td width="1%"></td>
                  </tr>
                  <!-- Display Top Border -->
                  <tr>
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
                  </tr>
                  <!-- Display Body -->
                  <tr>
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
                     <td bgcolor="#FFFFFF" valign="top">
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
                           <!-- Column Headings -->
                           <tr align="left" nowrap class="body_col" background="images/bg_table_col.gif">
                              <%If parRtagId = "" Then %>
                                <td>PROJECT</td>
                                <td>RELEASE</td>
                              <%End If%>
                              <td>PACKAGE</td>
                              <td>VERSION</td>
                              <td>TIME</td>
                              <td>REASON</td>
                           </tr>
                           <tr>
                                 <td colspan="4" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                           </tr>
                           <!-- Column Data -->
                           <%
                            Call GetFormDetails( parRtagId, parPage, rsQry )
                            Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                           %>
                           <tr class="body_rowg" align="left" nowrap>
                              <%If parRtagId = "" Then %>
                               <td nowrap >
                                    <a class="txt_linked" href="rtree.asp?proj_id=<%=rsQry("proj_id")%>">
                                        <%=rsQry("PROJ_NAME")%>&nbsp;
                                    </a>
                               <td nowrap ><%=rsQry("RTAG_NAME")%>&nbsp;
                              <%End If%>
                               <td nowrap >
                                    <a class="txt_linked" href="view_by_version.asp?pkg_id=<%=rsQry("pkg_id")%>&fpkgversion=*<%=rsQry("v_ext")%>" title="<%=rsQry("pv_description")%>">
                                        <%=rsQry("PKG_NAME")%>&nbsp;
                                    </a>
                               <td nowrap >
                                    <a class="txt_linked" href="dependencies.asp?pv_id=<%=rsQry("pv_id")%>&rtag_id=<%=rsQry("rtag_id")%>" title="<%=rsQry("comments")%>">
                                        <%=rsQry("PKG_VERSION")%>&nbsp;
                                    </a>
                               <td nowrap ><%=rsQry("TIMESTAMP")%>&nbsp;
                               <td nowrap ><%=rsQry("REASON")%>
                           </tr>
                           <%
                            rsQry.MoveNext
                           Loop
                           rsQry.Close()
                           Set rsQry = nothing

                           %>
                        </table>
                     </td>
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
                  </tr>
                  <tr>
                    <td colspan="3">
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
                          <tr class="body_row">
                            <td align="left">   <%Call writePageTag(0 ,"&lt;&lt;First", "" )%> </td>
                            <td align="center"> Page:<%=parPage + 1%> of <%=maxPage + 1%> </td>
                            <td align="center"> <%Call writePageTag(lastPage ,"&lt;Previous" ,"")%> </td>
                            <td align="center"> <%Call writePageTag(parPage ,"[Auto]", "&refresh=1" )%>
                            <%Call writePageTag(parPage ,"[Refresh]", "" )%> </td>
                            <td align="center"> <%Call writePageTag(nextPage ,"Next&gt;","" )%> </td>
                            <td align="right">  <%Call writePageTag(maxPage ,"Last&gt;&gt;","" )%> </td>
                          </tr>
                          </table>    
                    </td>
                    </tr>
                  <!-- Display Bottom Border -->
                  <tr>
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
                     <td background="images/lbox_bg_blue.gif"></td>
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
                  </tr>
               </table>
            </td>
         </tr>
         <tr>
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
                <img src="images/img_gear.gif" width="86" height="99" vspace="20" hspace="30">
            </td>
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350">
            </td>
         </tr>
      </table>
      <!-- FOOTER -->
      <!--#include file="_footer.asp"-->
   </body>
</html>
<%
Call Destroy_All_Objects
%>