Subversion Repositories DevTools

Rev

Rev 6548 | Rev 6566 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
5623 dpurdie 4
'
5
'  Build Status Information
6
'
5357 dpurdie 7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
12
Response.Expires = 0  ' always load the page, dont store
13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
22
<!--#include file="common/daemon_instructions.asp"-->
6166 dpurdie 23
<!--#include file="common/common_daemon.asp"-->
6048 dpurdie 24
<% '------------ ACCESS CONTROL ------------------ %>
6181 dpurdie 25
<!--#include file="_access_control_login_optional.asp"-->
6070 dpurdie 26
<!--#include file="_access_control_general.asp"-->
6052 dpurdie 27
<!--#include file="_access_control_action_project.asp"-->
5357 dpurdie 28
<% '------------ Scripts -------------------------- %>
29
<%
30
'------------ Variable Definition -------------
31
Dim objSortHelper
32
Dim rsQry
33
Dim parRtagId
34
Dim query_string
35
Dim rcon_id
36
Dim shref_base
37
'------------ Constants Declaration -----------
38
'------------ Variable Init -------------------
39
parRtagId = Request("rtag_id")
40
objPMod.PersistInQryString("rtag_id")
41
'----------------------------------------------
6545 dpurdie 42
Sub IncludePackages()
5357 dpurdie 43
 
44
   On Error Resume Next
45
   objEH.ErrorRedirect = TRUE
46
   OraDatabase.Parameters.Add "PV_ID_LIST",  Request("pv_id_list"),  ORAPARM_INPUT, ORATYPE_VARCHAR2
47
   OraDatabase.Parameters.Add "RTAG_ID",     parRtag_id,  ORAPARM_INPUT, ORATYPE_NUMBER
48
   OraDatabase.Parameters.Add "USER_ID",     objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
49
 
50
   objEH.TryORA ( OraSession )
6545 dpurdie 51
   OraDatabase.ExecuteSQL "BEGIN  Ripple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
5357 dpurdie 52
   objEH.CatchORA ( OraSession )
53
 
54
   OraDatabase.Parameters.Remove "PV_ID_LIST"
55
   OraDatabase.Parameters.Remove "RTAG_ID"
56
   OraDatabase.Parameters.Remove "USER_ID"
57
 
58
End Sub
59
'--------------------------------------------------------------------------------------------------------------------------
60
'------------ RUN BEFORE PAGE RENDER ----------
61
shref_base = "http://" & archive_server & "/devl/abtlog/"
62
 
63
'----------------------------------------------------
64
' --- RUN onPostBack ---
65
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
66
 
67
  If objEH.Finally Then
68
    If Request("action") = "include" Then
6559 dpurdie 69
      Call IncludePackages ()
5357 dpurdie 70
      ' Redirect to the current page so that a refesh will not
71
      ' cause a form re-submit.
5957 dpurdie 72
      Call Destroy_All_Objects
5357 dpurdie 73
      Response.Redirect(ScriptName & "?rtag_id=" & parRtagId)
74
    Else
75
      Call OpenInWindow ( "dependencies.asp?rtag_id="& parRtagId )
76
    End If
77
  End If
78
 
79
End If
80
 
81
'----------------------------------------------
6546 dpurdie 82
Sub ShowBuildStatus
83
    <!-- FORM START -->
84
    objFormComponent.FormName = "FormName"
85
    objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId
86
    Call objFormComponent.FormStart()
87
    %>
88
    <table class="embedded_table" style="margin-bottom:20px">
89
      <tr>
90
         <td>
91
            <table width="95%" border="0" cellspacing="0" cellpadding="0" align="center">
92
                <tr>
93
                    <td nowrap class="form_ttl" align="left">BUILD STATUS INFORMATION</td>
94
                </tr>
95
            </table>
96
                <tr>
97
                    <td>
98
                        <table class="rounded_box embedded_table">
99
                            <tr>
6548 dpurdie 100
                                <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10"></td>
6546 dpurdie 101
                                <td bgcolor="#FFFFFF" valign="top">
102
                                <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
103
                                <!--#include file="messages/_msg_inline.asp"-->
104
                                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
105
                                <table width="100%" border="0" cellspacing="2" cellpadding="0">
106
                                    <tr>
107
                                        <td colspan=4 class='err_alert'><font size='2'><b>Packages Excluded From Build</b></font></td>
108
                                    </tr>
109
                                    <tr>
110
                                    <td></td>
111
                                    <td  colspan=3 class="body_row">
112
                                       <fieldset class="fset" align="right" style=" border: 1px groove;">
113
                                            Show
114
                                            <input type="checkbox" checked value=0 name="showManual"   id="manualCause"   onClick="toggleDispClass('manualCause',1);">Manual Exclusions
115
                                            <input type="checkbox" checked value=0 name="showCause"    id="rootCause"     onClick="toggleDispClass('rootCause',1);">Config Errors
116
                                            <input type="checkbox" checked value=0 name="showNoEnv"    id="rootNoEnv"     onClick="toggleDispClass('rootNoEnv',1);">Env Errors
117
                                            <input type="checkbox" checked value=0 name="showFile"     id="rootFile"      onClick="toggleDispClass('rootFile',1);">Build Errors
118
                                            <input type="checkbox" checked value=0 name="showIndirect" id="rootIndirect"  onClick="toggleDispClass('rootIndirect',1);">Indirect Exclusions
119
                                       </fieldset>
120
                                       </td>
121
                                    </tr>
122
 
123
                                   <tr>
124
                                      <td background="images/bg_table_col.gif" class="err_alert"><b>Directly</b></td>
125
                                      <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
126
                                      <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
127
                                      <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause</td>
128
                                   </tr>
129
                                   <tr>
130
               <%
131
               query_string = " select pkg.pkg_name, pv.pkg_version, pv.pv_id, dnr.rtag_id, dnr.root_cause, dnr.root_file, pv.pv_description, dnr.root_pv_id"&_
132
                              "   from do_not_ripple dnr, package_versions pv, packages pkg"&_
133
                              "  where dnr.rtag_id = "& parRtagId &_
134
                              "    and pv.pv_id    = dnr.pv_id"&_
135
                              "    and pkg.pkg_id  = pv.pkg_id"&_
136
                              "    and nvl(dnr.root_pv_id, -1) < 0 " &_
137
                              "  order by pkg_name"
138
               Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
139
               '--- Render rows ---
140
               Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
141
                Dim rowClass
142
                Dim rowData
143
                '
144
                ' Manually excluded packages have no root_cause or root_file or root_pv_id
145
                '
146
                ' root_file, if supplied, indicates a build failure log file exists
147
                ' this should always prevail over the textual root_cause
148
                '
149
                If (IsNull(rsQry("root_file")) AND IsNull(rsQry("root_cause"))) Then
150
                    rowData = "Manually Excluded"
151
                    rowClass = "manualCause"
152
 
153
                ElseIf IsNull(rsQry("root_file")) Then
154
                   rowData = rsQry("root_cause")
155
                   If InStr(rowData, "no build env") Then
156
                       rowClass = "rootNoEnv"
157
                   Else
158
                       rowClass = "rootCause"
159
                   End If
160
 
161
                Else
162
                    rowClass = "rootFile"
163
                    rowData = "<a class=""txt_linked"" title=""" & rsQry("root_file") &_
164
                              " Log file may have expired."" " &_
165
                              "href=""" & shref_base & rsQry("root_file") & """>" &_
166
                              "Build Failure Log File</a>"
167
                End If
168
 
169
                Dim checkBoxData, checkBoxClass
170
                If NiceInt(rsQry("root_pv_id"), -1) = -1   Then
171
                    checkBoxData = ""
172
                    checkBoxClass = "directInclude"
173
                Else
174
                    checkBoxData = "disabled"
175
                    checkBoxClass = ""    
176
                End If
177
 
178
               %>
179
                  <tr class="<%=rowClass%>">
180
                     <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
181
                  </tr>
182
                  <tr class="<%=rowClass%>">
183
                     <td nowrap width="1%">
184
                        <a name="PkgName_<%=rsQry("pkg_name")%>">
185
                        <input class="<%=checkBoxClass%>" type="checkbox" value="<%=rsQry("pv_id")%>" name="pv_id_list" <%=checkBoxData%>>
186
                        </a>
187
                     </td>
188
                     <td nowrap class="body_rowg"><a class="txt_linked" href="dependencies.asp?pv_id=<%=rsQry("pv_id")%>&rtag_id=<%=rsQry("rtag_id")%>" title="<%=rsQry("pv_description")%>"><%=rsQry("pkg_name")%></a></td>
189
                     <td nowrap class="body_rowg"><%=rsQry("pkg_version")%></td>
190
                     <td nowrap class="body_rowg"><%=rowData%></td>
191
                  </tr>
192
               <%
193
                rsQry.MoveNext
194
               Loop
195
 
196
               query_string = " select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description"&_
197
                              "   from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg"&_
198
                              "  where dnr.rtag_id = "& parRtagId &_
199
                              "    and pv.pv_id    = dnr.pv_id"&_
200
                              "    and pkg.pkg_id  = pv.pkg_id"&_
201
                              "    and qv.pv_id    = dnr.root_pv_id"&_
202
                              "    and qkg.pkg_id  = qv.pkg_id"&_
203
                              "    and nvl(dnr.root_pv_id, -1) > 0"&_
204
                              "  order by pkg.pkg_name"
205
               Dim rsQry2
206
               Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
207
               ' -- DISPLAY INDIRECTLY EXCLUDED PACKAGES
208
               '--- Render rows ---
209
                If rsQry2.recordCount > 0    Then 
210
                %>
211
                  <tr>
212
                  <td background="images/bg_table_col.gif" class="err_alert"><b>Indirectly</b></td>
213
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
214
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
215
                  <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause Package</td>
216
                  </tr>
217
               <%
218
                End If
219
               Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)%>
220
                  <tr class="rootIndirect">
221
                     <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
222
                  </tr>
223
                  <tr class="rootIndirect">
224
 
225
                     <td nowrap><input type="checkbox" value=0 disabled=true name="notused"></td>
226
                     <td nowrap class="body_rowg"><a class="txt_linked" href="dependencies.asp?pv_id=<%=rsQry2(0)%>&rtag_id=<%=rsQry2(4)%>" title="<%=rsQry2(5)%>"><%=rsQry2(1)%></a></td>
227
                     <td nowrap class="body_rowg"><%=rsQry2(2)%></td>
228
                     <td nowrap class="body_rowg"><a href="#PkgName_<%=rsQry2(3)%>" style="text-decoration: none;">&raquo;&nbsp;<%=rsQry2(3)%></a></td>
229
                  </tr>
230
                  <%
231
                  rsQry2.MoveNext
232
               Loop%>
233
            </table>
234
         </td>
235
         <td background="images/lbox_bgside_white.gif">&nbsp;</td>
236
      </tr>
237
      <tr background="images/bg_action_norm.gif">
238
         <td></td>
239
         <td>
240
         <table class="full_table">
241
             <tr>
242
                 <td><input id="toggleDirect" 
243
                            <%=Iif(rsQry.RecordCount > 0, "", " disabled ")%>
244
                            type="checkbox" title="Toggle all visible directly excluded packages"></td>
245
                 <td align="right">
246
                    <%
247
                    Response.Write(objFormComponent.SubmitButton ( "Include", "name='IncludeSubmit' id='IncludeSubmit' class='form_btn' disabled style='color:silver' onClick=""return vixConfirm('Are you sure you want to include these packages for building?',{title:'Include Packages', post : 'FormName'})""" ))
248
                    Response.Write(objPMod.ComposeHiddenTags())
249
                    %>
250
                 </td>
251
             </tr>
252
         </table>
253
         </td>
254
         <td background="images/bg_action_norm.gif"><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
255
      </tr>
256
    </table>
257
    </td>
258
    </tr>
259
    </table>
260
    <!-- ACTION BUTTONS ---------------------------------------------->
261
    <input type="hidden" name="action" value="include">
262
    <!-- ACTION BUTTONS END  ------------------------------------------>
263
    <%Call objFormComponent.FormEnd()%>
264
    <!-- FORM END ----------------------------------------------------->
265
    <%
266
    rsQry.Close()
267
    Set rsQry = nothing
268
    rsQry2.Close()
269
    Set rsQry2 = nothing
270
End Sub
271
'-------------------------------------------------
272
' 
273
Sub ShowDaemonStatus
5357 dpurdie 274
%>
6546 dpurdie 275
<table class="embedded_table" style="margin-bottom:20px">
276
  <tr>
277
     <td>
278
        <table width="95%" align="center" class="embedded_table">
279
           <tr>
280
              <td nowrap class="form_ttl"><p>DAEMON STATUS INFORMATION</p>
281
              </td>
282
              <td  valign="bottom" class="body_rowg">
283
                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
284
              </td>
285
              <td align="right" valign="bottom">
286
                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a>
287
              </td>
288
           </tr>
289
        </table>
290
     </td>
291
  </tr>
292
  <tr>
293
   <td>
294
   <table class="rounded_box embedded_table">
295
  <tr>
296
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
297
     <td bgcolor="#FFFFFF" valign="top">
298
        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
299
        <!--#include file="messages/_msg_inline.asp"-->
300
        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
301
        <br>
302
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
303
           <%
304
           Dim bInactiveMachine : bInactiveMachine = false
305
           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
306
           ' Insert a warning into the page if the build daemons are indefintely paused.
307
           If indefinitelyPaused Then %>
308
              <tr>
309
                 <span class='err_alert'>
310
                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
311
                 </span>
312
              </tr>
313
           <%End If
314
           %>
315
           <td width="9%" valign="top"></td>
316
           <tr>
317
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
318
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
319
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
320
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
321
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
322
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
323
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
324
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
325
           </tr>
326
           <%
327
           ' Get the number of release configurations for this RTAG_ID, and iterate through them
328
           query_string = " select rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') as ACTIVE" &_
329
                          " from release_config rc, gbe_machtype gm, build_machine_config bm"&_
330
                          "  where rc.rtag_id = "& parRtagId &_
331
                          "    and gm.gbe_id = rc.gbe_id"&_
332
                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
333
                          "  order by bm.display_name, rc.rcon_id"
334
 
335
           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
336
 
337
           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
338
              rcon_id = rsQry("rcon_id")
339
 
340
              Dim pkgName
341
              Dim pkgPvid
342
              Dim pkgBuildTime
343
              Dim currentRunLevel
344
              Dim daemonState
345
              Dim delta
346
              Dim pkgId
347
              Dim bActive : bActive = rsQry("active")
348
              If bActive = "N" Then bInactiveMachine = true
349
 
350
              ' For this release configuration, get its entry from the run_level table. This table may not
351
              ' have an entry so we must handle that outcome too.
352
              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
353
                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
354
                             "   from run_level rl"&_
355
                             "  where rl.rcon_id = "& rcon_id
356
 
357
              Dim rsQry2
358
              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
359
 
360
              currentRunLevel = -1
361
              pkgId = Null
362
              pkgName = NULL
363
              pkgPvid = NULL
364
              pkgBuildTime = NULL
365
              daemonState = 0
366
              delta = NULL
367
 
368
              If (rsQry2.RecordCount > 0) Then
369
                ' Get the run level from the run_level table
370
                currentRunLevel = rsQry2("current_run_level")
371
                pkgId = rsQry2("current_pkg_id_being_built")
372
 
373
                daemonState = rsQry2("pause")
374
                If IsNull(daemonState) Then daemonState = 0
375
                If daemonState = "2" Then pkgId = Null
376
 
377
                delta = rsQry2("delta")
378
 
379
              End If
380
 
381
              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
382
              ' package name from the packages table
383
              Dim rsQry3
384
              If NOT IsNull(pkgId) Then
385
                 query_string = " select pkg_name,rl.current_pv_id, pv.build_time from run_level rl, packages pk, package_versions pv"&_
386
                                "  where rl.rcon_id = "& rcon_id &_
387
                                "   and  rl.current_pkg_id_being_built = pk.pkg_id" &_
388
                                "   and  rl.current_pv_id = pv.pv_id"
389
 
390
                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
391
                 If (rsQry3.RecordCount > 0) Then
392
                    pkgName = rsQry3("pkg_name")
393
                    pkgPvid = rsQry3("current_pv_id")
394
                    pkgBuildTime = rsQry3("build_time")
395
                 End If
396
                 rsQry3.Close()
397
                 Set rsQry3 = nothing
398
              End If
399
 
400
              ' --- Now render HTML for this release configuration ---
401
              %>
402
              <tr>
403
                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
404
              </tr>
405
              <tr>
406
                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
407
                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
408
                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
409
                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
410
                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, bActive)%></td>
411
                 <td nowrap class="body_rowg"><%=IIF(rsQry("daemon_mode") = "M", pkgBuildTime, "")%></td>
412
                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
413
                 <td nowrap class="body_rowg">
414
                    <%
415
                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
416
                       If canActionControlInProject("BuildControl") Then
417
                          If bActive = "U" Then
418
                          ElseIf bActive = "N" Then
419
                             Call Action_Buttons ( "Daemon Unavailable" )
420
                          ElseIf daemonState = 0 Then
421
                             Call Action_Buttons ( "Daemon Pause" )
422
                          ElseIf daemonState = 1 Then
423
                             Call Action_Buttons ( "Daemon Resume" )
424
                          ElseIf daemonState = 2 Then
425
                             Call Action_Buttons ( "Daemon Start" )
426
                          Else
427
                             Call Action_Buttons ( "Daemon Resume" )
428
                          End If
429
                       Else
430
                          If bActive = "U" Then
431
                          ElseIf bActive = "N" Then
432
                             Call Action_Buttons ( "Daemon Unavailable" )
433
                          ElseIf daemonState = 0 Then
434
                             Call Action_Buttons ( "Daemon Pause Disabled" )
435
                          ElseIf daemonState = 1 Then
436
                             Call Action_Buttons ( "Daemon Resume Disabled" )
437
                          ElseIf daemonState = 2 Then
438
                             Call Action_Buttons ( "Daemon Start Disabled" )
439
                          Else
440
                             Call Action_Buttons ( "Daemon Resume Disabled" )
441
                          End If
442
                       End If
443
                    Else
444
                       %>Unavailable<%
445
                    End If
446
                    %>
447
                 </td>
448
              </tr>
449
              <%
450
              rsQry2.Close()
451
              Set rsQry2 = nothing
452
              rsQry.MoveNext
453
           Loop
454
           %>
455
           <tr>
456
             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>
457
             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
458
                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
459
                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
460
                </a>
461
             <%End If%>
462
             </td>
463
             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
464
             <%
465
               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
466
                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
467
                   Call Action_Buttons ( "Daemon Control All" )
468
                 Else 
469
                   Call Action_Buttons ( "Daemon Control All Disabled" )
470
                 End If
471
               Else
472
                 %>&nbsp<%
473
               End If
474
             %>
475
             </td>
476
           </tr>
477
           <%
478
             rsQry.Close()
479
             Set rsQry = nothing
480
           %>
481
        </table>
482
     </td>
483
     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
484
  </tr>
485
  <tr>
486
     <input type="hidden" name="action" value="true">
487
     <%=objPMod.ComposeHiddenTags()%>
488
  </tr>
489
</table>
490
</td>
491
</table>
492
 
493
<%
494
End Sub
495
'-------------------------------------------------
496
'
497
Sub ShowDaemonInstructions
498
%>
499
<!-- Daemon Instructions Display -->
500
<table class="embedded_table" style="margin-bottom:10px">
501
  <tr>
502
     <td>
503
        <table align="center" width="95%" class="embedded_table">
504
           <tr>
505
              <td nowrap class="form_ttl">DAEMON INSTRUCTIONS FOR THIS RELEASE</td>
506
           </tr>
507
        </table>
508
     </td>
509
  </tr>
510
  <tr>
511
   <td>
512
   <table class="rounded_box embedded_table">
513
  <tr>
514
     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
515
     <td bgcolor="#FFFFFF" valign="top">
516
        <table width="100%" border="0" cellspacing="2" cellpadding="0">
517
           <tr>
518
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Operation</td>
519
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
520
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
521
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Scheduled Time<%=Quick_Help("SchedTime")%>
522
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Repeat</td>
523
              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">In Progress</td>
524
           </tr>
525
           <%
526
           Dim PkgVersion
527
           Dim UserName
528
           Dim UserEmail
529
           Dim bInProgress
530
           Dim bIsOverdue
531
           Dim bIsReady
532
 
533
           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_
534
                                                  "       OP_CODE,"&_
535
                                                  "       RTAG_ID,"&_
536
                                                  "       PV_ID,"&_
537
                                                  "       SCHEDULED_DATETIME,"&_
538
                                                  "       REPEAT_SECS,"&_
539
                                                  "       ADDED_DATETIME,"&_
540
                                                  "       USER_ID,"&_
541
                                                  "       IN_PROGRESS,"&_
542
                                                  "       (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_
543
                                                  "       (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_
544
                                                  "  FROM DAEMON_INSTRUCTIONS "&_
545
                                                  "  WHERE RTAG_ID = "& parRtagId &_
546
                                                  "  ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT )
547
           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
548
 
549
              If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then
550
                 bInProgress = False
551
              Else
552
                 bInProgress = True
553
              End If
554
 
555
              ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress.
556
              If rsQry("OVERDUE") AND NOT bInProgress Then
557
                 bIsOverdue = True
558
              Else
559
                 bIsOverdue = False
560
              End If
561
 
562
              If rsQry("READY") Then
563
                 bIsReady = True
564
              Else
565
                 bIsReady = False
566
              End If
567
 
568
              ' Get as much info about the package as we can
569
              Dim PkgId: PkgId = 0
570
              Dim PkgName : PkgName = "N/A"
571
              If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then
572
                 Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL)
573
              End If
574
              %>
575
              <tr>
576
                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
577
              </tr>
578
              <tr>
579
                 <td align="left" valign="top" class="body_rowg nowrap">
580
                    <%=DaemonInstructionOperationName(rsQry("OP_CODE"))%>
581
                 </td>
582
 
583
                 <td align="left" valign="top" class="body_rowg">
584
                    <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%>
585
                       <a href='fixed_issues.asp?rtag_id=<%=rsQry("RTAG_ID")%>&pv_id=<%=rsQry("PV_ID")%>'><%=PkgName%>
586
                    <%Else%>
587
                       <%=PkgName%>
588
                    <%End If%>
589
                 </td>
590
 
591
                 <td align="left" valign="top" class="body_rowg">
592
                    <%=PkgVersion%>
593
                 </td>
594
 
595
                 <td align="left" valign="top" class="body_rowg" <%If bIsOverdue Then%>style=color:Red<%Elseif bIsReady Then%>style=color:Green<%End If%>><%=DisplayDateTime(rsQry("SCHEDULED_DATETIME"))%></td>
596
 
597
                 <td align="left" valign="top" class="body_rowg"><%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%></td>
598
 
599
                 <td align="left" valign="top" class="body_rowg">
600
                    <%If bInProgress Then%>
601
                       YES
602
                    <%Else%>
603
                       NO
604
                    <%End If%>
605
                 </td>
606
              </tr>
607
              <%
608
              rsQry.MoveNext()
609
           Wend
610
           rsQry.Close()
611
           Set rsQry = nothing
612
           %>
613
        </table>
614
     </td>
615
     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
616
  </td>
617
  </tr>
618
  </table>
619
  </td>
620
   </tr>
621
</table>
622
<%
623
End Sub
624
%>
5357 dpurdie 625
<html>
626
   <head>
627
      <title>Release Manager</title>
628
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
629
      <meta http-equiv="Pragma" content="no-cache">
630
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
631
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
632
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
633
      <script language="JavaScript" src="images/common.js"></script>
634
      <!--#include file="_jquery_includes.asp"-->
635
      <!-- TIPS -->
636
      <script type="text/javascript" src="scripts/json2.js"></script>
637
      <script language="JavaScript" src="images/tipster.js"></script>
638
      <script language="JavaScript" src="images/_help_tips.js"></script>
639
      <script language="JavaScript" type="text/JavaScript">
6538 dpurdie 640
      formTips.tips.h_buildtime       = stdTip(300, 'Est. Build Duration', 'Estimated build duration in seconds. Based simply on the last build duration for this package');
641
 
5623 dpurdie 642
      formTips.tips.h_lastchange       = stdTip(300, 'Last Change', 'This is an indication of the time since the daemon interogated the database.' +
643
                                                                  '<p>Short times will be shown as seconds. Longer times will be shown as a time within ' + 
644
                                                                  'the last 24 hours. Longer times will be shown as a date.' 
645
                                                                  );
5357 dpurdie 646
      </script>
6544 dpurdie 647
    <script language="JavaScript" type="text/JavaScript">
648
    $(document).ready(function() {
6545 dpurdie 649
        //
650
        //  Init the check boxes
651
        InitShow();
6546 dpurdie 652
        isChecked('pv_id_list','IncludeSubmit');
6545 dpurdie 653
 
6544 dpurdie 654
        // Attach function to toggle checkbox
655
        // toggle all visible checkboxes
656
         $('#toggleDirect').click(function(){
657
            var state = this.checked;
6545 dpurdie 658
            var list = $('.directInclude:visible:enabled');
6544 dpurdie 659
            list.prop('checked', state);
660
            isChecked('pv_id_list','IncludeSubmit');
661
         });
6545 dpurdie 662
 
663
         $('.directInclude').click(function(){
664
             isChecked('pv_id_list','IncludeSubmit');
665
         });
666
 
6544 dpurdie 667
    });
6545 dpurdie 668
 
669
    function InitShow(e)
670
    {
671
        toggleDispClass('rootCause',0);
672
        toggleDispClass('rootNoEnv',0);
673
        toggleDispClass('rootFile',0);
674
        toggleDispClass('rootIndirect',0);
675
        toggleDispClass('manualCause',0);
676
    }
677
 
678
    function toggleDispClass(cname,flip)
679
    {
680
        var cookieName = 'RELMGR_BUILDSTATUS';
681
        var cv = JSON.parse(getCookie(cookieName));
682
        if (!cv)
683
            cv = new Object;
684
        if (!cv.BuildStatus)
685
            cv.BuildStatus = new Object;
686
 
687
        var state = cv.BuildStatus[cname];
688
        if (state === undefined)
689
            state = true;
690
 
691
        if (flip>0)
692
            state = !state;
693
 
694
        cv.BuildStatus[cname] = state;
695
 
696
        // Reflect the current state in the checkbox
697
        var de = document.getElementById(cname);
698
        if (de)
699
            de.checked = state;
700
 
701
        var elements = new Array();
702
        elements = getElementsByClassName(cname);
703
        for(i in elements ){
704
            if (state) {
705
                elements[i].style.display = "";
706
            }
707
            else {
708
                elements[i].style.display = "none";
709
            }
710
        }
711
        setCookie(cookieName, JSON.stringify(cv), 365 );
712
    }
713
 
6544 dpurdie 714
    </script>
5357 dpurdie 715
      <!-- DROPDOWN MENUS -->
716
      <!--#include file="_menu_def.asp"-->
717
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
718
   </head>
6546 dpurdie 719
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
5357 dpurdie 720
      <!-- HEADER -->
721
      <!--#include file="_header.asp"-->
722
      <!-- BODY ---->
6546 dpurdie 723
      <table class="full_table">
5357 dpurdie 724
         <tr>
6546 dpurdie 725
            <td width="146px" class="panel_bg" valign="top">
726
                <%Call BuildMenuPane%>
5357 dpurdie 727
            </td>
728
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6546 dpurdie 729
                <%Call ShowBuildStatus%>
730
                <%Call ShowDaemonStatus%>
731
                <%Call ShowDaemonInstructions%>
5357 dpurdie 732
            </td>
733
         </tr>
734
         <tr>
6546 dpurdie 735
            <td class="panel_bg" valign="bottom" align="center" height="350">
736
                <img src="images/img_gears.png" vspace="20" hspace="30"></td>
5357 dpurdie 737
         </tr>
738
      </table>
739
      <!-- FOOTER -->
740
      <!--#include file="_footer.asp"-->
741
   </body>
742
</html>
6546 dpurdie 743