Subversion Repositories DevTools

Rev

Rev 6591 | Rev 7022 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%
'===================================================================
'                     Package Common
'===================================================================
%>
<!--#include file="../class/classTemplateManager.asp"-->
<!--#include file="../class/classTabControl.asp"-->
<!--#include file="../class/classActionButtonControl.asp"-->
<!--#include file="daemon_instructions.asp"-->
<!--#include file="daemon_status.asp"-->
<!--#include file="../_pkg_action_buttons.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim parPv_id
Dim nEnvTab         ' remember environment tab
Dim objBtnControl
Dim aTabBtnsDef
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------
parPv_id = Request("pv_id")
Set objBtnControl = New ActionButtonControl
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------

'--- Make sure rtag_id is always present
If (Request("rtag_id") = "") AND (Request("pv_id") = "") Then 
    Call Destroy_All_Objects
    Response.Redirect("index.asp")
End If


'--- Rebuild Environment
If (Request("rtag_id") <> "") Then
   Call Rebuild_Environment ( parRtag_id )
End If

'--- Persist following parameters between postbacks
objPMod.PersistInQryString ( aPersistList(enumPAR_RTAG_ID) )
objPMod.PersistInQryString ( aPersistList(enumPAR_PV_ID) )


'--- Get Environment (lefthand side menu) tab
nEnvTab = GetEnvTab ( Request("envtab") )


'--- Get Package General Information
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
If Request("pv_id") <> "" Then
   Call Get_Pkg_Info ( Request("pv_id"), Request("rtag_id") )

    ' Make sure pv_id exists as it may be removed
    If pkgInfoHash.Item("pv_id") = "" Then 
        Call Destroy_All_Objects
        Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
    End If

ElseIf isDefined("allowNoPackage") Then
    ' Get basic information - if no package is present
    ' Used by dependencies.asp, find.asp and sdk_add_release.asp
    Call Get_NoPkg_Info( Request("rtag_id") )
Else
    ' Don't know how we got here without a pvid - display default page
    Call Destroy_All_Objects
    Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
End If


'----------------------------------------------
%>
<%
'-----------------------------------------------------------------------------------------------------------------------------
Sub RenderPackageProperties (irtag_id)
%>
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td>
         <%
         If pkgInfoHash.Item ("is_patch") = "Y" Then
            '--- PATCH ---
            Response.write "<br><a href='patches.asp?pv_id="& pkgInfoHash.Item ("patch_parent_id") &"&rtag_id="& Request("rtag_id") &"' class='txt_linked'><img src='icons/i_caretone.gif' hspace='2' border='0' align='absmiddle'>Back To "& pkgInfoHash.Item ("pkg_name") &"</a><br><br>"

            If pkgInfoHash.Item ("is_obsolete") = "Y" Then
               Dim rsTemp
               Set rsTemp = OraDatabase.DbCreateDynaset( "select patch_obsoleted_by from package_patches where patch_id ="&pkgInfoHash.Item ("pv_id"), cint(0))

               If rsTemp("patch_obsoleted_by") <> "" Then

                  Set rsTemp = OraDatabase.DbCreateDynaset( "select pkg_version from package_versions where pv_id ="&rsTemp("patch_obsoleted_by"), cint(0))
                  Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( "<b>Obsoleted by patch "& rsTemp("pkg_version") & ". </b> " ) & NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )

                  rsTemp.Close()
                  Set rsTemp = nothing
               Else
                  Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )
               End If
               Response.write enum_imgPatchObsolete
            Else
               Response.write enum_imgPatch
            End If


            If pkgInfoHash.Item ("dlocked") = "Y" Then
               Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"<img src='images/i_locked.gif' width='12' height='14' border='0' hspace='5' align='top'></SPAN>"
            Else
               Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"</SPAN>"
            End If
         Else
            '--- PACKAGE ---
            Response.write "<table cellspacing=1 cellpadding=0>"
            Response.write "<tr>"
            Response.write "<td>"
            Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") & "&nbsp;" & "&nbsp;" & "</SPAN>"
            Response.write "</td>"

            ' dlocked: Y - release, N - unlocked, P - pending, A - approved, R - rejected
            Dim lState
            If pkgInfoHash.Item ("dlocked") = "Y" Then
              lState = enum_imgReleasedLocked
            ElseIf pkgInfoHash("is_released") Then
              lState = enum_imgReleasedUnlocked
            ElseIf pkgInfoHash.Item ("dlocked") = "P" Then
              lState = enum_imgPending
            ElseIf (pkgInfoHash.Item ("dlocked") = "N") OR (pkgInfoHash.Item ("dlocked") = "R") Then
              'ElseIf (irtag_id<>"") Then
              lState = enum_imgBuilding
            End If
            If NOT isEmpty(lState) Then Response.write "<td>" & lState & "</td>"

            If pkgInfoHash.Item ("product_state") = 4 Then
                Response.write "<td>" & enum_imgProductRejected & "</td>"
            End If

            Dim state_icon
            If Not IsNull(pkgInfoHash.Item ("deprecated_state")) Then
              Select Case CInt(pkgInfoHash.Item ("deprecated_state"))
                Case enumPKG_STATE_DEPRECATED
                  state_icon = enum_imgDeprecated
                Case enumPKG_STATE_DEPRECATED_DEPENDENT
                  state_icon = enum_imgDeprecatedDependent
              End Select
              If NOT isEmpty(state_icon) Then Response.write "<td>" & state_icon & "</td>"
            End If

            If Not (IsNull(pkgInfoHash.Item ("pkg_state")) or pkgInfoHash.Item ("pkg_state") = 0) Then
              Select Case CInt(pkgInfoHash.Item ("pkg_state"))
                Case enumPKG_STATE_MAJOR
                  state_icon = enum_imgCritical
                Case enumPKG_STATE_MINOR
                  state_icon = enum_imgWarning
                Case enumPKG_STATE_MAJOR_READY
                  state_icon = enum_imgCReady
                Case enumPKG_STATE_MINOR_READY
                  state_icon = enum_imgWReady
                Case enumPKG_NOT_FOUND
                  state_icon = enum_imgNotFound
                Case enumPKG_STATE_NEW_PATCH
                  state_icon = enum_imgPatchAvailable
                Case enumPKG_ADVISORY_RIPPLE
                  state_icon = enum_imgAR
                Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
                  state_icon = enum_imgARD
                Case enumPKG_SDK_IMPORT
                  state_icon = enum_imgSdkImport
                Case enumPKG_SDK_DEPENDENCY
                  state_icon = enum_imgSdkDep
              End Select
                Response.write "<td>"
                Response.write state_icon
                Response.write "</td>"
            End If

            ' Package peg status
            ' Not done as a part of pkg_state some states are not mutually exclusive
            If pkgInfoHash.Item ("is_pegged") Then
                Response.write "<td>"
                Response.write enum_imgGreenPin
                Response.write "</td>"
            End If

            'build_type', and a value of 'M' = manual and 'A' = auto , 'U' = UnBuildable
            If pkgInfoHash.Item("build_type") = "M" Then
                Response.write "<td>"
                Response.write "<img src='icons/i_manual.gif' width='12' height='14' border='0' title='Manually built package'>"
                Response.write "</td>"
            ElseIf pkgInfoHash.Item("build_type") = "U" Then
                Response.write "<td>"
                Response.write enum_imgUnBuildable
                Response.write "</td>"
            End If

            ' check if a daemon instruction exists for this package
            If pkgInfoHash.Item("hasRippleInstr") Then
                Response.write "<td>"
                Response.write "<img src='images/Cascade.gif' width='17' height='17' border='0' title='Ripple Build Request." & "&#13;" & "Click to view details." & "' onClick=""location.href='build_status.asp?rtag_id=" & irtag_id & "';"" >"
                Response.write "</td>"
            End If

            If pkgInfoHash.Item("hasTestInstr") <> "" Then
                Response.write "<td>"
                Response.write "<img src='images/Test.gif' width='17' height='17' border='0' title='Test Build Request." & "&#13;" & "Click to view details." & "' onClick=""location.href='build_status.asp?rtag_id=" & irtag_id & "';"" >"
                Response.write "</td>"
            End If


            ' check if this package has a build failure file
            If pkgInfoHash("has_build_failure") Then
                Response.write "<td>"
                Response.write "<img src='icons/i_build_failure.gif' width='19' height='17' border='0' title='Package build failure." & "&#13;" & "Click to view details." &"' onClick=""location.href='build_status.asp?rtag_id=" & irtag_id & "';"" >"
                Response.write "</td>"
            ElseIf pkgInfoHash("is_excluded") Then
            ' check if this package has been excluded from the build
                Response.write "<td>"
                Response.write "<img src='icons/i_build_exclusion.gif' width='19' height='17' border='0' title='Package excluded from build." & "&#13;" & "Click to view details." &"' onClick=""location.href='build_status.asp?rtag_id=" & irtag_id & "';"" >"
                Response.write "</td>"
            End If

            ' Warn if the package is not in the package archive
            ' Use http access for package test as this does not require AD authentication
             If (pkgInfoHash.Item ("dlocked") = "Y") OR pkgInfoHash.Item("build_type") = "M" Then
                 If NOT pkgInfoHash.Item ("isInArchive") Then
                     Response.write "<td>"
                     Response.write enum_imgNotInArchive
                     Response.write "</td>"
                 End If
             End If

             ' Warn if the package has hit a rippel stop and is waiting for the user
             If (pkgInfoHash.Item ("ripple_stop") = "w") Then
                 Response.write "<td>"
                 Response.write enum_imgRippleStop
                 Response.write "</td>"
             ElseIf (pkgInfoHash.Item ("ripple_stop") = "g") Then
                 Response.write "<td>"
                 Response.write enum_imgRippleGo
                 Response.write "</td>"
             End If



             ' Warn if the package versionis not in the release
             If pkgInfoHash.Exists("notInRelease")  Then
                     Response.write "<td>"

                     If pkgInfoHash.Exists("pv_id_InRelease") Then Response.write "<a href=gotoLatestInRelease.asp?pv_id=" & pkgInfoHash.Item("pv_id") & "&rtag_id="&irtag_id & "&page=" & scriptName & ">"
                     Response.write enum_imgNotInRelease
                     If pkgInfoHash.Exists("pv_id_InRelease") Then Response.write "</a>"

                     Response.write "</td>"
             End If

            Response.write "<td class=pointer onClick='showmenu(event,copyPackageMenu)' onmouseout='delayhidemenu()'>"
            Response.Write enum_imgClipBoard
            Response.write "</td>"

            Response.write "</tr>"
            Response.write "</table>"

         End If
         %>

      </td>
   </tr>
   <tr>
      <td style=color:Red>
      </td>
   </tr>
   </table>
<%
End Sub

'-----------------------------------------------------------------------------------------------------------------------------
Sub RenderStatus(irtag_id,ipv_id)
%>
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td width="100%">
       <!-- PACKAGE PROPERTIES ----------------------------  -->
       <%
         If ipv_id <> "" Then
           Call RenderPackageProperties (irtag_id)
         End If
       %>
     </td>
   </tr>
   </table>
<%
End Sub

'-----------------------------------------------------------------------------------------------------------------------------
Sub RenderDaemonBar(irtag_id,ipv_id)
%>
   <!-- Daemon Bar ----------------------------  -->
   <table border="0" cellspacing="0" cellpadding="0">
   <tr>
     <td valign=bottom>
       <%
         If irtag_id<>"" Then
           Dim objDmSts: Set objDmSts = New DaemonStatus
       %>
           <fieldset style="margin:0px;padding:2px;">
               <%Call objDmSts.RenderDaemonStatusForRelease(irtag_id,16)%>
           </fieldset>
       <%
           Set objDmSts = Nothing
         End If
       %>
     </td>
   </tr>
   </table>
<%
End Sub

'-----------------------------------------------------------------------------------------------------------------------------
Sub RenderActionBar(irtag_id,ipv_id)
   Response.write("<table border=0 cellpadding=0 cellspacing=0>")
   Response.write("  <tr>")
   Response.write("    <td width='99%'>")
   If Not ((ipv_id = "") or (IsNull(ipv_id))) Then
     Call RenderActionButtons
   End If
   Response.write("    </td>")

   Response.write("    <td width='1%'>")
   Call RenderDaemonBar(irtag_id,ipv_id)
   Response.write("    </td>")
   Response.write("  </tr>")
   Response.write("</table>")
End Sub
'-----------------------------------------------------------------------------------------------------------------------------
%>