Subversion Repositories DevTools

Rev

Rev 7240 | Rev 7245 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7240 Rev 7244
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
'|                                                   |
-
 
5
'|                   wAddBuildMachine                |
4
'   wAddBuildMachine.asp
6
'|                                                   |
-
 
7
'=====================================================
5
'=====================================================
8
%>
6
%>
9
<%
7
<%
10
Option explicit
8
Option explicit
11
Response.Expires = 0
9
Response.Expires = 0
Line 14... Line 12...
14
<!--#include file="common/globals.asp"-->
12
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
13
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
14
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
15
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
16
<!--#include file="common/_form_window_common.asp"-->
19
 
-
 
20
 
-
 
21
<%
17
<%
22
'------------ ACCESS CONTROL ------------------
18
'------------ ACCESS CONTROL ------------------
23
%>
19
%>
24
<!--#include file="_access_control_login.asp"-->
20
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_general.asp"-->
21
<!--#include file="_access_control_general.asp"-->
26
<%
22
<%
27
'------------ VARIABLE DEFINITION -------------
23
'------------ VARIABLE DEFINITION -------------
28
Dim rsQry
-
 
29
Dim sMessage
24
Dim sMessage
30
Dim Query_String
-
 
31
 
25
 
32
Dim display_name
26
Dim display_name
33
Dim machine_hostname
27
Dim machine_hostname
34
Dim gbe_id
28
Dim gbe_id
35
Dim active, activeChecked
29
Dim active, activeChecked
36
Dim description
30
Dim description
-
 
31
Dim platformList
-
 
32
Dim bIsaClone : bIsaClone = FALSE
37
 
33
 
38
'------------ CONSTANTS DECLARATION -----------
34
'------------ CONSTANTS DECLARATION -----------
39
'------------ VARIABLE INIT -------------------
35
'------------ VARIABLE INIT -------------------
40
sMessage = NULL
36
sMessage = NULL
41
Set objFormCollector = CreateObject("Scripting.Dictionary")
37
Set objFormCollector = CreateObject("Scripting.Dictionary")
-
 
38
If Request("type") = "clone" Then
-
 
39
    bIsaClone = TRUE
-
 
40
End If
42
'------------ CONDITIONS ----------------------
41
'------------ CONDITIONS ----------------------
43
'----------------------------------------------
42
'----------------------------------------------
44
%>
43
%>
45
<%
44
<%
46
'--------------------------------------------------------------------------------------------------------------------------
45
'--------------------------------------------------------------------------------------------------------------------------
-
 
46
'   Get the data for the display
-
 
47
'   On first request, it will get the data from the database
-
 
48
'   Otherwise the data will be fetched from form elements
-
 
49
Sub GetData
-
 
50
    If CBool(Request("action")) Then
-
 
51
 
-
 
52
		'   Recover the data from the form
-
 
53
		'   It may contain user changes
-
 
54
    	display_name            =   Request("display_name")
-
 
55
    	machine_hostname        =   Request("machine_hostname")
-
 
56
    	gbe_id                  =   Request("gbe_id")
-
 
57
    	active                  =   Request("active")
-
 
58
    	description             =   Request("description")
-
 
59
        platformList            =   "," & Request("platform") & ","
-
 
60
        platformList = Replace(platformList," ","",1,-1)
-
 
61
 
-
 
62
    	if active = "Y" Then activeChecked = "checked"
-
 
63
 
-
 
64
    ElseIf Request("bmcon_id") <> "" Then
-
 
65
 
-
 
66
		'   Extract data from the database
-
 
67
        Dim rsQry, query
-
 
68
 
-
 
69
    	query = "select * from build_machine_config bm, gbe_machtype gbe "&_
-
 
70
    	  " where bm.bmcon_id = "& Request("bmcon_id") &_
-
 
71
    	  " and gbe.gbe_id = bm.gbe_id"
-
 
72
    	  
-
 
73
    	Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
-
 
74
 
-
 
75
    	display_name            =   rsQry("display_name")
-
 
76
    	machine_hostname        =   rsQry("machine_hostname")
-
 
77
    	gbe_id                  =   rsQry("gbe_id")
-
 
78
    	active                  =   rsQry("active")
-
 
79
    	description             =   rsQry("description")
-
 
80
 
-
 
81
    	activeChecked = ""
-
 
82
    	if active = "Y" Then activeChecked = "checked"
-
 
83
 
-
 
84
    	 If bIsaClone Then
-
 
85
            description = "Clone of " & machine_hostname & ".<br>" & description 
-
 
86
    		display_name = ""
-
 
87
    		machine_hostname = ""
-
 
88
    	 End If
-
 
89
 
-
 
90
    	rsQry.Close()
-
 
91
    	Set rsQry = Nothing
-
 
92
 
-
 
93
		'   Create a list of associated Platforms
-
 
94
		'
-
 
95
        platformList = ""
-
 
96
    	query = "select * from build_platforms_config2 bpc2 where bpc2.bmcon_id = "& Request("bmcon_id")
-
 
97
        Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
-
 
98
        While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
-
 
99
            platformList = platformList & "," & rsQry("BP_ID") 
-
 
100
           rsQry.MoveNext
-
 
101
        Wend
-
 
102
        rsQry.Close()
-
 
103
        Set rsQry = Nothing
-
 
104
        platformList = platformList & ","
-
 
105
    
-
 
106
    Else
-
 
107
        ' New Machine - set defaults
-
 
108
    	activeChecked = "checked"
-
 
109
	End If
-
 
110
End Sub
-
 
111
 
-
 
112
'--------------------------------------------------------------------------------------------------------------------------
-
 
113
'   Get MachTypes - to populate a dropdron list
47
Function GetMachType ( ngbe_id )
114
Function GetMachType ( ngbe_id )
48
   Dim rsQry, query
115
   Dim rsQry, query
49
 
116
 
50
   OraDatabase.Parameters.Add "gbe_id",   ngbe_id,   ORAPARM_INPUT, ORATYPE_NUMBER
117
   OraDatabase.Parameters.Add "gbe_id",   ngbe_id,   ORAPARM_INPUT, ORATYPE_NUMBER
51
 
118
 
Line 62... Line 129...
62
   Set rsQry = Nothing
129
   Set rsQry = Nothing
63
 
130
 
64
   OraDatabase.Parameters.Remove "gbe_id"
131
   OraDatabase.Parameters.Remove "gbe_id"
65
End Function
132
End Function
66
'--------------------------------------------------------------------------------------------------------------------------
133
'--------------------------------------------------------------------------------------------------------------------------
-
 
134
'   Get configured platforms
-
 
135
'
67
Function GetPlatforms ()
136
Function GetPlatforms ()
68
    Dim rsQry, query, selectData
137
    Dim rsQry, query
69
 
138
 
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)"
139
    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
 
140
 
72
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
141
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
73
    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
142
    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
74
       Dim checkText
143
       Dim checkText
75
       'If InStr(selectData, "," & rsQry("BMCON_ID") & ",") > 0 Then
144
       If InStr(platformList, "," & rsQry("BP_ID") & ",") > 0 Then
76
       ' checkText = "checked"
145
        checkText = "checked"
77
       'else 
146
       else 
78
       ' checkText = ""
147
        checkText = ""
79
       'End If
148
       End If
80
       GetPlatforms = GetPlatforms & "<tr class=body_txt>"
149
       GetPlatforms = GetPlatforms & "<tr class=body_txt>"
81
       GetPlatforms = GetPlatforms & "<td> <input type=checkbox name=platform value='"& rsQry("BP_ID") &"' "& checkText &">" & rsQry("BP_NAME") & "</td>"
150
       GetPlatforms = GetPlatforms & "<td> <input type=checkbox name=platform value='"& rsQry("BP_ID") &"' "& checkText &">" & rsQry("BP_NAME") & "</td>"
82
       GetPlatforms = GetPlatforms & "</tr>"
151
       GetPlatforms = GetPlatforms & "</tr>"
83
 
152
 
84
       rsQry.MoveNext
153
       rsQry.MoveNext
Line 103... Line 172...
103
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
172
      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
173
      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
174
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
106
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
175
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
107
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
176
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
-
 
177
      OraDatabase.Parameters.Add "PLATFORM",              Request("platform"),              ORAPARM_INPUT, ORATYPE_VARCHAR2
108
 
178
 
109
      objEH.ErrorRedirect = FALSE
179
      objEH.ErrorRedirect = FALSE
110
      objEH.TryORA ( OraSession )
180
      objEH.TryORA ( OraSession )
111
      On Error Resume Next
181
      On Error Resume Next
112
 
182
 
113
      OraDatabase.ExecuteSQL _
183
      OraDatabase.ExecuteSQL _
114
      "BEGIN  PK_BUILDAPI.UPDATE_BUILD_MACHINE(:BMCON_ID, :DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE);  END;"
184
      "BEGIN  PK_BUILDAPI.UPDATE_BUILD_MACHINE(:BMCON_ID, :DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE, :PLATFORM);  END;"
115
 
185
 
116
      objEH.CatchORA ( OraSession )
186
      objEH.CatchORA ( OraSession )
117
 
187
 
118
      OraDatabase.Parameters.Remove "BMCON_ID"
188
      OraDatabase.Parameters.Remove "BMCON_ID"
119
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
189
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
120
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
190
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
121
      OraDatabase.Parameters.Remove "GBE_ID"
191
      OraDatabase.Parameters.Remove "GBE_ID"
122
      OraDatabase.Parameters.Remove "DESCRIPTION"
192
      OraDatabase.Parameters.Remove "DESCRIPTION"
123
      OraDatabase.Parameters.Remove "ACTIVE"
193
      OraDatabase.Parameters.Remove "ACTIVE"
-
 
194
      OraDatabase.Parameters.Remove "PLATFORM"
124
 
195
 
125
      If objEH.Finally Then
196
      If objEH.Finally Then
126
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
197
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
127
         Call CloseWindow()
198
         Call CloseWindow()
128
      End If
199
      End If
Line 134... Line 205...
134
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
205
      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
206
      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
207
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
137
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
208
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
138
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
209
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
-
 
210
      OraDatabase.Parameters.Add "PLATFORM",              Request("platform"),              ORAPARM_INPUT, ORATYPE_VARCHAR2
139
 
211
 
140
      objEH.ErrorRedirect = FALSE
212
      objEH.ErrorRedirect = FALSE
141
      objEH.TryORA ( OraSession )
213
      objEH.TryORA ( OraSession )
142
      On Error Resume Next
214
      On Error Resume Next
143
 
215
 
144
      OraDatabase.ExecuteSQL _
216
      OraDatabase.ExecuteSQL _
145
      "BEGIN  PK_BUILDAPI.ADD_BUILD_MACHINE(:DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE);  END;"
217
      "BEGIN  PK_BUILDAPI.ADD_BUILD_MACHINE(:DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE, :PLATFORM);  END;"
146
 
218
 
147
      objEH.CatchORA ( OraSession )
219
      objEH.CatchORA ( OraSession )
148
 
220
 
149
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
221
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
150
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
222
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
151
      OraDatabase.Parameters.Remove "GBE_ID"
223
      OraDatabase.Parameters.Remove "GBE_ID"
152
      OraDatabase.Parameters.Remove "DESCRIPTION"
224
      OraDatabase.Parameters.Remove "DESCRIPTION"
153
      OraDatabase.Parameters.Remove "ACTIVE"
225
      OraDatabase.Parameters.Remove "ACTIVE"
-
 
226
      OraDatabase.Parameters.Remove "PLATFORM"
154
 
227
 
155
      If objEH.Finally Then
228
      If objEH.Finally Then
156
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
229
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
157
         Call CloseWindow()
230
         Call CloseWindow()
158
      End If
231
      End If
Line 188... Line 261...
188
   objFormComponent.FormName = "FormName"
261
   objFormComponent.FormName = "FormName"
189
   objFormComponent.FormClass = "form_tight"
262
   objFormComponent.FormClass = "form_tight"
190
   objFormComponent.Action = ScriptName
263
   objFormComponent.Action = ScriptName
191
   objFormComponent.OnSubmit = "ShowProgress();"
264
   objFormComponent.OnSubmit = "ShowProgress();"
192
   Call objFormComponent.FormStart()
265
   Call objFormComponent.FormStart()
-
 
266
   Call GetData()
193
   %>
267
   %>
194
   <tr>
268
   <tr>
195
      <td class="form_field_bg" >
269
      <td class="form_field_bg" >
196
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
270
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
197
         <%Call Messenger ( sMessage , 3, "100%" )%>
271
         <%Call Messenger ( sMessage , 3, "100%" )%>
198
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
272
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
199
         <!--#include file="messages/_msg_inline.asp"-->
273
         <!--#include file="messages/_msg_inline.asp"-->
200
         <br>
274
         <br>
201
         <%
275
         <%
202
         If Request("bmcon_id") <> "" Then
276
         If Request("bmcon_id") <> "" Then%>
203
            %>
277
			<%If NOT bIsaClone Then%>
204
            <input type="hidden" name="bmcon_id" value="<%=Request("bmcon_id")%>">
278
				<input type="hidden" name="bmcon_id" value="<%=Request("bmcon_id")%>">
205
            <%
279
            <%End If
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%>
280
          End If%>
229
         
-
 
230
         <table width="50%" border="0">
281
         <table width="50%" border="0">
231
            <tr>
282
            <tr>
232
               <td><span class="body_txt nowrap">Display Name</span></td>
283
               <td><span class="body_txt nowrap">Display Name</span></td>
233
               <td>
284
               <td>
234
                  <input name="display_name" type="text" class="body_txt" value="<%=display_name%>" size=24 maxlength=20>
285
                  <input name="display_name" type="text" class="body_txt" value="<%=display_name%>" size=24 maxlength=20>
Line 240... Line 291...
240
                  <input name="machine_hostname" type="text" class="body_txt" value="<%=machine_hostname%>" size=50 maxlength=50>
291
                  <input name="machine_hostname" type="text" class="body_txt" value="<%=machine_hostname%>" size=50 maxlength=50>
241
               </td>
292
               </td>
242
            </tr>
293
            </tr>
243
            <tr>
294
            <tr>
244
               <td><span class="body_txt nowrap">GBE_MACHTYPE</span></td>
295
               <td><span class="body_txt nowrap">GBE_MACHTYPE</span></td>
245
               <td><%=objFormComponent.Combo ( "gbe_id", GetMachType( gbe_id ), FALSE, "size=1 class='body_txt'" )%></td>
296
               <td><%=objFormComponent.Combo ( "gbe_id", GetMachType( gbe_id ), CBool(Request("bmcon_id") = ""), "size=1 class='body_txt'" )%></td>
246
            </tr>
297
            </tr>
247
            <tr>
298
            <tr>
248
               <td><span class="body_txt nowrap">Allow Use</span></td>
299
               <td><span class="body_txt nowrap">Allow Use</span></td>
249
               <td>
300
               <td>
250
                  <input type="checkbox" name="active" value="Y" <%=activeChecked%>>
301
                  <input type="checkbox" name="active" value="Y" <%=activeChecked%>>