Subversion Repositories DevTools

Rev

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