Subversion Repositories DevTools

Rev

Rev 7235 | Rev 7244 | 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
'=====================================================
4
'|                                                   |
5
'|                   wAddBuildMachine                |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
19
 
20
 
21
<%
22
'------------ ACCESS CONTROL ------------------
23
%>
6048 dpurdie 24
<!--#include file="_access_control_login.asp"-->
5357 dpurdie 25
<!--#include file="_access_control_general.asp"-->
26
<%
27
'------------ VARIABLE DEFINITION -------------
5384 dpurdie 28
Dim rsQry
5357 dpurdie 29
Dim sMessage
30
Dim Query_String
31
 
32
Dim display_name
33
Dim machine_hostname
34
Dim gbe_id
35
Dim active, activeChecked
36
Dim description
37
 
38
'------------ CONSTANTS DECLARATION -----------
39
'------------ VARIABLE INIT -------------------
40
sMessage = NULL
41
Set objFormCollector = CreateObject("Scripting.Dictionary")
42
'------------ CONDITIONS ----------------------
43
'----------------------------------------------
44
%>
45
<%
46
'--------------------------------------------------------------------------------------------------------------------------
47
Function GetMachType ( ngbe_id )
48
   Dim rsQry, query
49
 
50
   OraDatabase.Parameters.Add "gbe_id",   ngbe_id,   ORAPARM_INPUT, ORATYPE_NUMBER
51
 
52
   query = GetQuery ("GBE_MACHTYPECombo.sql")
53
 
54
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
55
   If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
56
      GetMachType = rsQry.GetRows()
57
   Else
58
      GetMachType = NULL
59
   End If
60
 
61
   rsQry.Close()
62
   Set rsQry = Nothing
63
 
64
   OraDatabase.Parameters.Remove "gbe_id"
65
End Function
66
'--------------------------------------------------------------------------------------------------------------------------
7240 dpurdie 67
Function GetPlatforms ()
68
    Dim rsQry, query, selectData
69
 
70
    query = "SELECT bp.BP_ID, bp.BP_ACTIVE, bp.BP_NAME, bp.BP_DESCRIPTION FROM BUILD_PLATFORMS bp, BUILD_PLATFORMS_CONFIG bpc WHERE bp.bp_id = bpc.bp_id AND bpc.gbe_id = 90 ORDER BY UPPER(bp.BP_NAME)"
71
 
72
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
73
    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
74
       Dim checkText
75
       'If InStr(selectData, "," & rsQry("BMCON_ID") & ",") > 0 Then
76
       ' checkText = "checked"
77
       'else 
78
       ' checkText = ""
79
       'End If
80
       GetPlatforms = GetPlatforms & "<tr class=body_txt>"
81
       GetPlatforms = GetPlatforms & "<td> <input type=checkbox name=platform value='"& rsQry("BP_ID") &"' "& checkText &">" & rsQry("BP_NAME") & "</td>"
82
       GetPlatforms = GetPlatforms & "</tr>"
83
 
84
       rsQry.MoveNext
85
    Wend
86
    rsQry.Close()
87
    Set rsQry = Nothing
88
 
89
   GetPlatforms = "<table>" & GetPlatforms & "</table>"
90
 
91
End Function
92
 
93
'--------------------------------------------------------------------------------------------------------------------------
5357 dpurdie 94
%>
95
<%
96
'------------ RUN BEFORE PAGE RENDER ----------
97
 
98
If CBool(Request("action")) Then
99
 
100
   If Request("bmcon_id") <> "" Then
101
 
102
      OraDatabase.Parameters.Add "BMCON_ID",              Request("bmcon_id"),              ORAPARM_INPUT, ORATYPE_NUMBER
103
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
104
      OraDatabase.Parameters.Add "MACHINE_HOSTNAME",      Request("machine_hostname"),      ORAPARM_INPUT, ORATYPE_VARCHAR2
105
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
106
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
107
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
108
 
5590 dpurdie 109
      objEH.ErrorRedirect = FALSE
5357 dpurdie 110
      objEH.TryORA ( OraSession )
111
      On Error Resume Next
112
 
113
      OraDatabase.ExecuteSQL _
114
      "BEGIN  PK_BUILDAPI.UPDATE_BUILD_MACHINE(:BMCON_ID, :DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE);  END;"
115
 
116
      objEH.CatchORA ( OraSession )
117
 
118
      OraDatabase.Parameters.Remove "BMCON_ID"
119
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
120
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
121
      OraDatabase.Parameters.Remove "GBE_ID"
122
      OraDatabase.Parameters.Remove "DESCRIPTION"
123
      OraDatabase.Parameters.Remove "ACTIVE"
124
 
125
      If objEH.Finally Then
126
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
127
         Call CloseWindow()
128
      End If
129
 
130
      rsQry.Close
131
      Set rsQry = nothing
132
 
133
   Else
134
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
135
      OraDatabase.Parameters.Add "MACHINE_HOSTNAME",      Request("machine_hostname"),      ORAPARM_INPUT, ORATYPE_VARCHAR2
136
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
137
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
138
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
139
 
5590 dpurdie 140
      objEH.ErrorRedirect = FALSE
5357 dpurdie 141
      objEH.TryORA ( OraSession )
142
      On Error Resume Next
143
 
144
      OraDatabase.ExecuteSQL _
145
      "BEGIN  PK_BUILDAPI.ADD_BUILD_MACHINE(:DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE);  END;"
146
 
147
      objEH.CatchORA ( OraSession )
148
 
149
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
150
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
151
      OraDatabase.Parameters.Remove "GBE_ID"
152
      OraDatabase.Parameters.Remove "DESCRIPTION"
153
      OraDatabase.Parameters.Remove "ACTIVE"
154
 
155
      If objEH.Finally Then
156
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
157
         Call CloseWindow()
158
      End If
159
 
160
      rsQry.Close
161
      Set rsQry = nothing
162
 
163
   End If
164
 
165
End If
166
 
167
 
168
'----------------------------------------------
169
%>
170
<html>
171
<head>
172
<title>Release Manager</title>
173
<link rel="shortcut icon" href="<%=FavIcon%>"/>
174
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
175
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 176
<link href="images/release_manager_style.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
6676 dpurdie 177
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 178
</head>
5590 dpurdie 179
<body leftmargin="0" topmargin="0" onLoad="self.focus();FormName.display_name.focus();">
5357 dpurdie 180
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
181
   <tr>
5590 dpurdie 182
      <td class="body_txt">
5357 dpurdie 183
         Add a new Build Machine or edit an existing Build Machine.
184
      </td>
185
   </tr>
186
   <%
187
   '-- FROM START --------------------------------------------------------------------------------------------------------------
188
   objFormComponent.FormName = "FormName"
5590 dpurdie 189
   objFormComponent.FormClass = "form_tight"
5357 dpurdie 190
   objFormComponent.Action = ScriptName
191
   objFormComponent.OnSubmit = "ShowProgress();"
192
   Call objFormComponent.FormStart()
193
   %>
194
   <tr>
5590 dpurdie 195
      <td class="form_field_bg" >
5357 dpurdie 196
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
197
         <%Call Messenger ( sMessage , 3, "100%" )%>
198
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
199
         <!--#include file="messages/_msg_inline.asp"-->
200
         <br>
201
         <%
202
         If Request("bmcon_id") <> "" Then
203
            %>
204
            <input type="hidden" name="bmcon_id" value="<%=Request("bmcon_id")%>">
205
            <%
206
            Dim rsTemp
207
 
208
            Query_String = "select * from build_machine_config bm, gbe_machtype gbe "&_
209
              " where bm.bmcon_id = "& Request("bmcon_id") &_
210
              " and gbe.gbe_id = bm.gbe_id"
211
 
212
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
213
 
214
            display_name            =   rsTemp("display_name")
215
            machine_hostname        =   rsTemp("machine_hostname")
216
            gbe_id                  =   rsTemp("gbe_id")
217
            active                  =   rsTemp("active")
218
            description             =   rsTemp("description")
219
 
220
            activeChecked = ""
221
            if active = "Y" Then activeChecked = "checked"
222
 
223
 
224
            rsTemp.Close()
225
            Set rsTemp = Nothing      
226
          Else
227
            activeChecked = "checked"
228
          End If%>
229
 
230
         <table width="50%" border="0">
231
            <tr>
5590 dpurdie 232
               <td><span class="body_txt nowrap">Display Name</span></td>
5357 dpurdie 233
               <td>
234
                  <input name="display_name" type="text" class="body_txt" value="<%=display_name%>" size=24 maxlength=20>
235
               </td>
236
            </tr>
237
            <tr>
238
               <td><span class="body_txt">Machine HostName</span></td>
239
               <td>
7240 dpurdie 240
                  <input name="machine_hostname" type="text" class="body_txt" value="<%=machine_hostname%>" size=50 maxlength=50>
5357 dpurdie 241
               </td>
242
            </tr>
243
            <tr>
5590 dpurdie 244
               <td><span class="body_txt nowrap">GBE_MACHTYPE</span></td>
7235 dpurdie 245
               <td><%=objFormComponent.Combo ( "gbe_id", GetMachType( gbe_id ), FALSE, "size=1 class='body_txt'" )%></td>
5357 dpurdie 246
            </tr>
247
            <tr>
5590 dpurdie 248
               <td><span class="body_txt nowrap">Allow Use</span></td>
5357 dpurdie 249
               <td>
250
                  <input type="checkbox" name="active" value="Y" <%=activeChecked%>>
251
                  <span class="body_txt">Allow users to add this machine to a build set</span>
252
               </td>
253
            </tr>
254
            <tr>
5590 dpurdie 255
               <td><span class="body_txt nowrap">Description</span></td>
5357 dpurdie 256
               <td>
257
                  <textarea name="Description" cols=50 rows=5 class='body_txt'><%=Description%></textarea>
258
               </td>
259
            </tr>
7240 dpurdie 260
            <tr>
261
               <td><span class="body_txt nowrap">Platfroms</span></td>
262
               <td style="border: darkgrey 1px solid">
263
				<div style="overflow-y: scroll;height: 10em;">
264
					  <%=GetPlatforms%>
265
				</div>
266
               </td>
267
            </tr>
268
 
5590 dpurdie 269
         </table>
270
      </td>
271
   </tr>
272
   <tr>
273
      <td>
274
         <table class="full_table">
5357 dpurdie 275
            <tr>
5590 dpurdie 276
               <td><%=ProgressBar()%></td>
277
               <td align="right">
278
                  <input name="btn" type="submit" class="form_btn" value="Add/Update">
279
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();">
280
               </td>
5357 dpurdie 281
            </tr>
282
         </table>
283
      </td>
284
   </tr>
285
   <%=objPMod.ComposeHiddenTags()%>
286
   <input type="hidden" name="action" value="true">
287
   <%
288
   Call objFormComponent.FormEnd()
289
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
290
   %>
291
</table>
292
</body>
293
</html>
294
<%
295
'------------ RUN AFTER PAGE RENDER -----------
296
Set objFormCollector = Nothing
297
'----------------------------------------------
298
Call Destroy_All_Objects
299
%>
300
 
301