Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%
2
'===================================================================
141 ghuddy 3
'                     Package Common
119 ghuddy 4
'===================================================================
5
%>
6
<!--#include file="../class/classTemplateManager.asp"-->
7
<!--#include file="../class/classTabControl.asp"-->
8
<!--#include file="../class/classActionButtonControl.asp"-->
147 ghuddy 9
<!--#include file="daemon_instructions.asp"-->
183 brianf 10
<!--#include file="daemon_status.asp"-->
185 brianf 11
<!--#include file="../_pkg_action_buttons.asp"-->
119 ghuddy 12
<%
13
'------------ VARIABLE DEFINITION -------------
14
Dim parPv_id
141 ghuddy 15
Dim nEnvTab         ' remember environment tab
119 ghuddy 16
Dim objBtnControl
17
Dim aTabBtnsDef
18
'------------ CONSTANTS DECLARATION -----------
19
'------------ VARIABLE INIT -------------------
20
parPv_id = Request("pv_id")
21
Set objBtnControl = New ActionButtonControl
22
'------------ CONDITIONS ----------------------
23
'----------------------------------------------
24
%>
25
<%
26
'------------ RUN BEFORE PAGE RENDER ----------
27
 
28
'--- Make sure rtag_id is always present
29
If (Request("rtag_id") = "") AND (Request("pv_id") = "") Then Response.Redirect("index.asp")
30
 
31
 
32
'--- Rebuild Environment
33
If (Request("rtag_id") <> "") Then
141 ghuddy 34
   Call Rebuild_Environment ( parRtag_id )
119 ghuddy 35
End If
36
 
37
'--- Persist following parameters between postbacks
38
objPMod.PersistInQryString ( aPersistList(enumPAR_RTAG_ID) )
39
objPMod.PersistInQryString ( aPersistList(enumPAR_PV_ID) )
40
 
41
 
42
'--- Get Environment (lefthand side menu) tab
43
nEnvTab = GetEnvTab ( Request("envtab") )
44
 
45
 
46
'--- Get Package General Information
47
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
48
If Request("pv_id") <> "" Then
141 ghuddy 49
   Call Get_Pkg_Info ( Request("pv_id"), Request("rtag_id") )
119 ghuddy 50
 
141 ghuddy 51
   ' Make sure pv_id exists as it may be removed
52
   If pkgInfoHash.Item("pv_id") = "" Then Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
119 ghuddy 53
 
54
Else
5020 dpurdie 55
   If (ScriptName <> "dependencies.asp") AND (ScriptName <> "find.asp") Then  Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
4703 dpurdie 56
   ' Get basic information - if no package is present
57
   Call Get_NoPkg_Info( Request("rtag_id") )
119 ghuddy 58
End If
59
 
60
 
61
'----------------------------------------------
62
%>
63
<%
64
'-----------------------------------------------------------------------------------------------------------------------------
183 brianf 65
Sub RenderPackageProperties (irtag_id)
119 ghuddy 66
%>
183 brianf 67
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
141 ghuddy 68
   <tr>
183 brianf 69
     <td>
141 ghuddy 70
         <%
71
         If pkgInfoHash.Item ("is_patch") = "Y" Then
72
            '--- PATCH ---
73
            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>"
119 ghuddy 74
 
141 ghuddy 75
            If pkgInfoHash.Item ("is_obsolete") = "Y" Then
76
               Dim rsTemp
77
               Set rsTemp = OraDatabase.DbCreateDynaset( "select patch_obsoleted_by from package_patches where patch_id ="&pkgInfoHash.Item ("pv_id"), cint(0))
119 ghuddy 78
 
141 ghuddy 79
               If rsTemp("patch_obsoleted_by") <> "" Then
119 ghuddy 80
 
141 ghuddy 81
                  Set rsTemp = OraDatabase.DbCreateDynaset( "select pkg_version from package_versions where pv_id ="&rsTemp("patch_obsoleted_by"), cint(0))
82
                  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%" )
119 ghuddy 83
 
141 ghuddy 84
                  rsTemp.Close()
85
                  Set rsTemp = nothing
86
               Else
87
                  Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )
88
               End If
89
               Response.write enum_imgPatchObsolete
90
            Else
91
               Response.write enum_imgPatch
92
            End If
119 ghuddy 93
 
94
 
141 ghuddy 95
            If pkgInfoHash.Item ("dlocked") = "Y" Then
96
               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>"
97
            Else
98
               Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"</SPAN>"
99
            End If
100
         Else
101
            '--- PACKAGE ---
183 brianf 102
            Response.write "<table cellspacing=1 cellpadding=0>"
103
            Response.write "<tr>"
104
            Response.write "<td>"
105
            Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") & "&nbsp;" & "&nbsp;" & "</SPAN>"
106
            Response.write "</td>"
107
 
108
            ' dlocked: Y - release, N - unlocked, P - pending, A - approved, R - rejected
4617 dpurdie 109
            Dim lState
141 ghuddy 110
            If pkgInfoHash.Item ("dlocked") = "Y" Then
4617 dpurdie 111
              lState = enum_imgReleasedLocked
183 brianf 112
            ElseIf pkgInfoHash("is_released") Then
4617 dpurdie 113
              lState = enum_imgReleasedUnlocked
183 brianf 114
            ElseIf pkgInfoHash.Item ("dlocked") = "P" Then
4617 dpurdie 115
              lState = enum_imgPending
183 brianf 116
            ElseIf (pkgInfoHash.Item ("dlocked") = "N") OR (pkgInfoHash.Item ("dlocked") = "R") Then
117
              'ElseIf (irtag_id<>"") Then
4617 dpurdie 118
              lState = enum_imgBuilding
141 ghuddy 119
            End If
4617 dpurdie 120
            If NOT isEmpty(lState) Then Response.write "<td>" & lState & "</td>"
183 brianf 121
 
122
            If pkgInfoHash.Item ("product_state") = 4 Then
4617 dpurdie 123
                Response.write "<td>" & enum_imgProductRejected & "</td>"
183 brianf 124
            End If
125
 
126
            Dim state_icon
127
            If Not IsNull(pkgInfoHash.Item ("deprecated_state")) Then
128
              Select Case CInt(pkgInfoHash.Item ("deprecated_state"))
129
                Case enumPKG_STATE_DEPRECATED
130
                  state_icon = enum_imgDeprecated
131
                Case enumPKG_STATE_DEPRECATED_DEPENDENT
132
                  state_icon = enum_imgDeprecatedDependent
133
              End Select
4617 dpurdie 134
              If NOT isEmpty(state_icon) Then Response.write "<td>" & state_icon & "</td>"
183 brianf 135
            End If
136
 
137
            If Not (IsNull(pkgInfoHash.Item ("pkg_state")) or pkgInfoHash.Item ("pkg_state") = 0) Then
138
              Select Case CInt(pkgInfoHash.Item ("pkg_state"))
139
                Case enumPKG_STATE_MAJOR
140
                  state_icon = enum_imgCritical
141
                Case enumPKG_STATE_MINOR
142
                  state_icon = enum_imgWarning
143
                Case enumPKG_STATE_MAJOR_READY
144
                  state_icon = enum_imgCReady
145
                Case enumPKG_STATE_MINOR_READY
146
                  state_icon = enum_imgWReady
147
                Case enumPKG_NOT_FOUND
148
                  state_icon = enum_imgNotFound
149
                Case enumPKG_STATE_NEW_PATCH
150
                  state_icon = enum_imgPatchAvailable
151
                Case enumPKG_ADVISORY_RIPPLE
152
                  state_icon = enum_imgAR
153
                Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
154
                  state_icon = enum_imgARD
155
                Case enumPKG_PEGGED_VERSION
156
                  state_icon = enum_imgGreenPin
157
              End Select
4617 dpurdie 158
                Response.write "<td>"
159
                Response.write state_icon
160
                Response.write "</td>"
183 brianf 161
            End If
162
 
163
 
164
            'build_type', and a value of 'M' = manual and 'A' = auto
165
            If pkgInfoHash.Item("build_type") = "M" Then
4617 dpurdie 166
                Response.write "<td>"
167
                Response.write "<img src='icons/i_manual.gif' width='12' height='14' border='0' title='Manually versioned package'>"
168
                Response.write "</td>"
183 brianf 169
            End If
170
 
171
            ' check if a daemon instruction exists for this package
172
            Dim sDmInstr
173
            sDmInstr = GetOpCodeListForRtagIdAndPvId( "", Request("rtag_id"), pkgInfoHash.Item("pv_id"), "" )
174
            If sDmInstr <> "" Then
4617 dpurdie 175
                Response.write "<td>"
176
                Response.write "<img src='icons/i_daemon_instr.gif' width='19' height='17' border='0' title='Daemon instruction:" & "&#13;" & sDmInstr & "&#13;" & "Click to view details." & "' onClick=""location.href='build_status.asp?rtag_id=" & irtag_id & "';"" >"
177
                Response.write "</td>"
183 brianf 178
            End If
179
 
180
            ' check if this package has a build failure file
181
            If pkgInfoHash("has_build_failure") Then
4617 dpurdie 182
                Response.write "<td>"
183
                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 & "';"" >"
184
                Response.write "</td>"
183 brianf 185
            ElseIf pkgInfoHash("is_excluded") Then
186
            ' check if this package has been excluded from the build
4617 dpurdie 187
                Response.write "<td>"
188
                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 & "';"" >"
189
                Response.write "</td>"
183 brianf 190
            End If
191
 
4617 dpurdie 192
            ' Warn if the package is not in the package archive
4710 dpurdie 193
            ' Use http access for package test as this does not require AD authentication
194
             If (pkgInfoHash.Item ("dlocked") = "Y") OR (pkgInfoHash.Item ("dlocked") = "P") Then
195
                 If NOT testArchiveAccessPkg(pkgInfoHash.Item ("pkg_name"), pkgInfoHash.Item ("pkg_version")) Then
196
                     Response.write "<td>"
197
                     Response.write enum_imgNotInArchive
198
                     Response.write "</td>"
199
                 End If
200
             End If
183 brianf 201
 
4764 dpurdie 202
             ' Warn if the package versionis not in the release
203
             If pkgInfoHash.Exists("notInRelease")  Then
204
                     Response.write "<td>"
205
                     Response.write enum_imgNotInRelease
206
                     Response.write "</td>"
207
             End If
208
 
183 brianf 209
            Response.write "</tr>"
210
            Response.write "</table>"
211
 
141 ghuddy 212
         End If
213
         %>
183 brianf 214
 
141 ghuddy 215
      </td>
216
   </tr>
217
   <tr>
183 brianf 218
      <td style=color:Red>
219
         <%'=GetOpCodeListForRtagIdAndPvId( "NOTE: '", Request("rtag_id"), pkgInfoHash.Item("pv_id"), "' has been requested" )%>
220
      </td>
147 ghuddy 221
   </tr>
183 brianf 222
   </table>
119 ghuddy 223
<%
224
End Sub
225
 
226
'-----------------------------------------------------------------------------------------------------------------------------
183 brianf 227
Sub RenderStatus(irtag_id,ipv_id)
119 ghuddy 228
%>
4687 dpurdie 229
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
183 brianf 230
   <tr>
185 brianf 231
     <td width="100%">
183 brianf 232
       <!-- PACKAGE PROPERTIES ----------------------------  -->
233
       <%
234
         If ipv_id <> "" Then
235
           Call RenderPackageProperties (irtag_id)
236
         End If
237
       %>
238
     </td>
185 brianf 239
   </tr>
240
   </table>
241
<%
242
End Sub
243
 
244
'-----------------------------------------------------------------------------------------------------------------------------
245
Sub RenderDaemonBar(irtag_id,ipv_id)
246
%>
4687 dpurdie 247
   <!-- Daemon Bar ----------------------------  -->
5009 dpurdie 248
   <table border="0" cellspacing="0" cellpadding="0">
185 brianf 249
   <tr>
250
     <td valign=bottom>
183 brianf 251
       <%
252
         If irtag_id<>"" Then
253
           Dim objDmSts: Set objDmSts = New DaemonStatus
254
       %>
5009 dpurdie 255
           <fieldset style="margin:0px;padding:2px;">
183 brianf 256
               <%Call objDmSts.RenderDaemonStatusForRelease(irtag_id,16)%>
257
           </fieldset>
258
       <%
259
           Set objDmSts = Nothing
260
         End If
261
       %>
262
     </td>
263
   </tr>
264
   </table>
265
<%
266
End Sub
267
 
268
'-----------------------------------------------------------------------------------------------------------------------------
185 brianf 269
Sub RenderActionBar(irtag_id,ipv_id)
270
   Response.write("<table border=0 cellpadding=0 cellspacing=0>")
271
   Response.write("  <tr>")
4703 dpurdie 272
   Response.write("    <td width='99%'>")
185 brianf 273
   If Not ((ipv_id = "") or (IsNull(ipv_id))) Then
274
     Call RenderActionButtons
275
   End If
276
   Response.write("    </td>")
4082 dpurdie 277
 
185 brianf 278
   Response.write("    <td width='1%'>")
279
   Call RenderDaemonBar(irtag_id,ipv_id)
280
   Response.write("    </td>")
281
   Response.write("  </tr>")
282
   Response.write("</table>")
283
End Sub
284
'-----------------------------------------------------------------------------------------------------------------------------
183 brianf 285
%>