Subversion Repositories DevTools

Rev

Go to most recent revision | 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
141 ghuddy 55
   If (ScriptName <> "dependencies.asp") AND (ScriptName <> "find.asp")Then  Response.Redirect ("dependencies.asp?rtag_id="& Request("rtag_id"))
119 ghuddy 56
End If
57
 
58
 
59
'----------------------------------------------
60
%>
61
<%
62
'-----------------------------------------------------------------------------------------------------------------------------
183 brianf 63
Sub RenderPackageProperties (irtag_id)
119 ghuddy 64
%>
183 brianf 65
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
141 ghuddy 66
   <tr>
183 brianf 67
     <td>
141 ghuddy 68
         <%
69
         If pkgInfoHash.Item ("is_patch") = "Y" Then
70
            '--- PATCH ---
71
            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 72
 
141 ghuddy 73
            If pkgInfoHash.Item ("is_obsolete") = "Y" Then
74
               Dim rsTemp
75
               Set rsTemp = OraDatabase.DbCreateDynaset( "select patch_obsoleted_by from package_patches where patch_id ="&pkgInfoHash.Item ("pv_id"), cint(0))
119 ghuddy 76
 
141 ghuddy 77
               If rsTemp("patch_obsoleted_by") <> "" Then
119 ghuddy 78
 
141 ghuddy 79
                  Set rsTemp = OraDatabase.DbCreateDynaset( "select pkg_version from package_versions where pv_id ="&rsTemp("patch_obsoleted_by"), cint(0))
80
                  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 81
 
141 ghuddy 82
                  rsTemp.Close()
83
                  Set rsTemp = nothing
84
               Else
85
                  Call Messenger ( "<SPAN class='err_alert'><b>Patch Is Obsolete!</b></SPAN><br>"& NewLine_To_BR( pkgInfoHash.Item ("obsolete_comments") ), 3, "100%" )
86
               End If
87
               Response.write enum_imgPatchObsolete
88
            Else
89
               Response.write enum_imgPatch
90
            End If
119 ghuddy 91
 
92
 
141 ghuddy 93
            If pkgInfoHash.Item ("dlocked") = "Y" Then
94
               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>"
95
            Else
96
               Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_version") &"</SPAN>"
97
            End If
98
         Else
99
            '--- PACKAGE ---
183 brianf 100
            Response.write "<table cellspacing=1 cellpadding=0>"
101
            Response.write "<tr>"
102
            Response.write "<td>"
103
            Response.write "<SPAN class='lbox_ttl'>"& pkgInfoHash.Item ("pkg_name") &"&nbsp;"& pkgInfoHash.Item ("pkg_version") & "&nbsp;" & "&nbsp;" & "</SPAN>"
104
            Response.write "</td>"
105
 
106
            ' dlocked: Y - release, N - unlocked, P - pending, A - approved, R - rejected
4617 dpurdie 107
            Dim lState
141 ghuddy 108
            If pkgInfoHash.Item ("dlocked") = "Y" Then
4617 dpurdie 109
              lState = enum_imgReleasedLocked
183 brianf 110
            ElseIf pkgInfoHash("is_released") Then
4617 dpurdie 111
              lState = enum_imgReleasedUnlocked
183 brianf 112
            ElseIf pkgInfoHash.Item ("dlocked") = "P" Then
4617 dpurdie 113
              lState = enum_imgPending
183 brianf 114
            ElseIf (pkgInfoHash.Item ("dlocked") = "N") OR (pkgInfoHash.Item ("dlocked") = "R") Then
115
              'ElseIf (irtag_id<>"") Then
4617 dpurdie 116
              lState = enum_imgBuilding
141 ghuddy 117
            End If
4617 dpurdie 118
            If NOT isEmpty(lState) Then Response.write "<td>" & lState & "</td>"
183 brianf 119
 
120
            If pkgInfoHash.Item ("product_state") = 4 Then
4617 dpurdie 121
                Response.write "<td>" & enum_imgProductRejected & "</td>"
183 brianf 122
            End If
123
 
124
            Dim state_icon
125
            If Not IsNull(pkgInfoHash.Item ("deprecated_state")) Then
126
              Select Case CInt(pkgInfoHash.Item ("deprecated_state"))
127
                Case enumPKG_STATE_DEPRECATED
128
                  state_icon = enum_imgDeprecated
129
                Case enumPKG_STATE_DEPRECATED_DEPENDENT
130
                  state_icon = enum_imgDeprecatedDependent
131
              End Select
4617 dpurdie 132
              If NOT isEmpty(state_icon) Then Response.write "<td>" & state_icon & "</td>"
183 brianf 133
            End If
134
 
135
            If Not (IsNull(pkgInfoHash.Item ("pkg_state")) or pkgInfoHash.Item ("pkg_state") = 0) Then
136
              Select Case CInt(pkgInfoHash.Item ("pkg_state"))
137
                Case enumPKG_STATE_MAJOR
138
                  state_icon = enum_imgCritical
139
                Case enumPKG_STATE_MINOR
140
                  state_icon = enum_imgWarning
141
                Case enumPKG_STATE_MAJOR_READY
142
                  state_icon = enum_imgCReady
143
                Case enumPKG_STATE_MINOR_READY
144
                  state_icon = enum_imgWReady
145
                Case enumPKG_NOT_FOUND
146
                  state_icon = enum_imgNotFound
147
                Case enumPKG_STATE_NEW_PATCH
148
                  state_icon = enum_imgPatchAvailable
149
                Case enumPKG_ADVISORY_RIPPLE
150
                  state_icon = enum_imgAR
151
                Case enumPKG_ADVISORY_RIPPLE_DEPENDENT
152
                  state_icon = enum_imgARD
153
                Case enumPKG_PEGGED_VERSION
154
                  state_icon = enum_imgGreenPin
155
              End Select
4617 dpurdie 156
                Response.write "<td>"
157
                Response.write state_icon
158
                Response.write "</td>"
183 brianf 159
            End If
160
 
161
 
162
            'build_type', and a value of 'M' = manual and 'A' = auto
163
            If pkgInfoHash.Item("build_type") = "M" Then
4617 dpurdie 164
                Response.write "<td>"
165
                Response.write "<img src='icons/i_manual.gif' width='12' height='14' border='0' title='Manually versioned package'>"
166
                Response.write "</td>"
183 brianf 167
            End If
168
 
169
            ' check if a daemon instruction exists for this package
170
            Dim sDmInstr
171
            sDmInstr = GetOpCodeListForRtagIdAndPvId( "", Request("rtag_id"), pkgInfoHash.Item("pv_id"), "" )
172
            If sDmInstr <> "" Then
4617 dpurdie 173
                Response.write "<td>"
174
                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 & "';"" >"
175
                Response.write "</td>"
183 brianf 176
            End If
177
 
178
            ' check if this package has a build failure file
179
            If pkgInfoHash("has_build_failure") Then
4617 dpurdie 180
                Response.write "<td>"
181
                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 & "';"" >"
182
                Response.write "</td>"
183 brianf 183
            ElseIf pkgInfoHash("is_excluded") Then
184
            ' check if this package has been excluded from the build
4617 dpurdie 185
                Response.write "<td>"
186
                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 & "';"" >"
187
                Response.write "</td>"
183 brianf 188
            End If
189
 
4617 dpurdie 190
            ' Warn if the package is not in the package archive
191
            If (pkgInfoHash.Item ("dlocked") = "Y") OR (pkgInfoHash.Item ("dlocked") = "P") Then
192
                Dim fso
193
                Set fso = server.createObject("Scripting.FileSystemObject")
194
                If NOT fso.FolderExists(dpkg_archiveRoot & "\" & pkgInfoHash.Item ("pkg_name") & "\" & pkgInfoHash.Item ("pkg_version")) Then
195
                    Response.write "<td>"
196
                    Response.write enum_imgNotInArchive
197
                    Response.write "</td>"
198
                End If
199
            End If
183 brianf 200
 
201
            Response.write "</tr>"
202
            Response.write "</table>"
203
 
141 ghuddy 204
         End If
205
         %>
183 brianf 206
 
141 ghuddy 207
      </td>
208
   </tr>
209
   <tr>
183 brianf 210
      <td style=color:Red>
211
         <%'=GetOpCodeListForRtagIdAndPvId( "NOTE: '", Request("rtag_id"), pkgInfoHash.Item("pv_id"), "' has been requested" )%>
212
      </td>
147 ghuddy 213
   </tr>
183 brianf 214
   </table>
119 ghuddy 215
<%
216
End Sub
217
 
218
'-----------------------------------------------------------------------------------------------------------------------------
183 brianf 219
Sub RenderStatus(irtag_id,ipv_id)
119 ghuddy 220
%>
4687 dpurdie 221
   <table width="100%" border="0" cellspacing="0" cellpadding="0">
183 brianf 222
   <tr>
185 brianf 223
     <td width="100%">
183 brianf 224
       <!-- PACKAGE PROPERTIES ----------------------------  -->
225
       <%
226
         If ipv_id <> "" Then
227
           Call RenderPackageProperties (irtag_id)
228
         End If
229
       %>
230
     </td>
185 brianf 231
   </tr>
232
   </table>
233
<%
234
End Sub
235
 
236
'-----------------------------------------------------------------------------------------------------------------------------
237
Sub RenderDaemonBar(irtag_id,ipv_id)
238
%>
4687 dpurdie 239
   <!-- Daemon Bar ----------------------------  -->
185 brianf 240
   <table width="100%" border="0" cellspacing="2" cellpadding="0">
241
   <tr>
242
     <td valign=bottom>
183 brianf 243
       <%
244
         If irtag_id<>"" Then
245
           Dim objDmSts: Set objDmSts = New DaemonStatus
246
       %>
185 brianf 247
           <fieldset style="margin:0px;padding:0px;">
183 brianf 248
               <%Call objDmSts.RenderDaemonStatusForRelease(irtag_id,16)%>
249
           </fieldset>
250
       <%
251
           Set objDmSts = Nothing
252
         End If
253
       %>
254
     </td>
255
   </tr>
256
   </table>
257
<%
258
End Sub
259
 
260
'-----------------------------------------------------------------------------------------------------------------------------
185 brianf 261
Sub RenderActionBar(irtag_id,ipv_id)
262
   Response.write("<table border=0 cellpadding=0 cellspacing=0>")
263
   Response.write("  <tr>")
264
   Response.write("    <td width='50%'>")
265
   If Not ((ipv_id = "") or (IsNull(ipv_id))) Then
266
     Call RenderActionButtons
267
   End If
268
   Response.write("    </td>")
4082 dpurdie 269
 
185 brianf 270
   Response.write("    <td width='1%'>")
271
   Call RenderDaemonBar(irtag_id,ipv_id)
272
   Response.write("    </td>")
273
   Response.write("  </tr>")
274
   Response.write("</table>")
275
End Sub
276
'-----------------------------------------------------------------------------------------------------------------------------
183 brianf 277
%>