Subversion Repositories DevTools

Rev

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