Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
161 iaugusti 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
167 brianf 5
'|                   wAddBuildMachine                |
161 iaugusti 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
%>
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_login.asp"-->
26
<%
27
'------------ VARIABLE DEFINITION -------------
28
Dim rsQry, healthTag, cmdInterface, pkgOwner, isInterface, package, procDesc
29
Dim sMessage
30
Dim GBE_MACHTYPE
31
Dim Query_String
32
Dim RecordCount
33
 
34
Dim display_name
35
Dim machine_hostname
36
Dim gbe_id
4979 dpurdie 37
Dim active, activeChecked
161 iaugusti 38
Dim description
39
 
40
'------------ CONSTANTS DECLARATION -----------
41
Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
42
Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
43
Const LIMG_PRODUCT_PATCH = "<img src='icons/i_patch_small.gif' hspace='2' align='absmiddle'>"
44
'------------ VARIABLE INIT -------------------
45
sMessage = NULL
46
 
47
 
48
Set objFormCollector = CreateObject("Scripting.Dictionary")
49
'------------ CONDITIONS ----------------------
50
'----------------------------------------------
51
%>
52
<%
53
'--------------------------------------------------------------------------------------------------------------------------
54
Function GetMachType ( ngbe_id )
55
   Dim rsQry, query
56
 
57
   OraDatabase.Parameters.Add "gbe_id",   ngbe_id,   ORAPARM_INPUT, ORATYPE_NUMBER
58
 
59
   query = GetQuery ("GBE_MACHTYPECombo.sql")
60
 
61
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
62
   If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
63
      GetMachType = rsQry.GetRows()
64
   Else
65
      GetMachType = NULL
66
   End If
67
 
68
   rsQry.Close()
69
   Set rsQry = Nothing
70
 
71
   OraDatabase.Parameters.Remove "gbe_id"
72
End Function
73
'--------------------------------------------------------------------------------------------------------------------------
74
%>
75
<%
76
'------------ RUN BEFORE PAGE RENDER ----------
77
 
78
If CBool(Request("action")) Then
79
 
80
   If Request("bmcon_id") <> "" Then
81
 
82
      OraDatabase.Parameters.Add "BMCON_ID",              Request("bmcon_id"),              ORAPARM_INPUT, ORATYPE_NUMBER
83
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
84
      OraDatabase.Parameters.Add "MACHINE_HOSTNAME",      Request("machine_hostname"),      ORAPARM_INPUT, ORATYPE_VARCHAR2
85
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
86
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
4979 dpurdie 87
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
161 iaugusti 88
 
89
      objEH.TryORA ( OraSession )
90
      On Error Resume Next
91
 
92
      OraDatabase.ExecuteSQL _
4979 dpurdie 93
      "BEGIN  PK_BUILDAPI.UPDATE_BUILD_MACHINE(:BMCON_ID, :DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE);  END;"
161 iaugusti 94
 
95
      objEH.CatchORA ( OraSession )
96
 
97
      OraDatabase.Parameters.Remove "BMCON_ID"
98
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
99
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
100
      OraDatabase.Parameters.Remove "GBE_ID"
101
      OraDatabase.Parameters.Remove "DESCRIPTION"
4979 dpurdie 102
      OraDatabase.Parameters.Remove "ACTIVE"
161 iaugusti 103
 
104
      If objEH.Finally Then
105
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
106
         Call CloseWindow()
107
      End If
108
 
109
      rsQry.Close
110
      Set rsQry = nothing
111
 
112
   Else
113
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
114
      OraDatabase.Parameters.Add "MACHINE_HOSTNAME",      Request("machine_hostname"),      ORAPARM_INPUT, ORATYPE_VARCHAR2
115
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
116
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2
4979 dpurdie 117
      OraDatabase.Parameters.Add "ACTIVE",                Request("active"),                ORAPARM_INPUT, ORATYPE_CHAR
161 iaugusti 118
 
119
      objEH.TryORA ( OraSession )
120
      On Error Resume Next
121
 
122
      OraDatabase.ExecuteSQL _
4979 dpurdie 123
      "BEGIN  PK_BUILDAPI.ADD_BUILD_MACHINE(:DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION, :ACTIVE);  END;"
161 iaugusti 124
 
125
      objEH.CatchORA ( OraSession )
126
 
127
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
128
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
129
      OraDatabase.Parameters.Remove "GBE_ID"
130
      OraDatabase.Parameters.Remove "DESCRIPTION"
4979 dpurdie 131
      OraDatabase.Parameters.Remove "ACTIVE"
161 iaugusti 132
 
133
      If objEH.Finally Then
134
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
135
         Call CloseWindow()
136
      End If
137
 
138
      rsQry.Close
139
      Set rsQry = nothing
140
 
141
   End If
142
 
143
End If
144
 
145
 
146
'----------------------------------------------
147
%>
148
<html>
149
<head>
150
<title>Release Manager</title>
151
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
152
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
153
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
154
<script language="JavaScript" src="scripts/common.js"></script>
155
</head>
156
 
157
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.display_name.focus();">
158
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
159
   <tr>
160
      <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add/Update Build Machine</span> <br>
161
         Add a new Build Machine or edit an existing Build Machine.
162
      </td>
163
   </tr>
164
 
165
   <%
166
   '-- FROM START --------------------------------------------------------------------------------------------------------------
167
   objFormComponent.FormName = "FormName"
168
   objFormComponent.Action = ScriptName
169
   objFormComponent.OnSubmit = "ShowProgress();"
170
   Call objFormComponent.FormStart()
171
 
172
   %>
173
   <tr>
174
      <td background="images/bg_login.gif">
175
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
176
            <tr>
177
               <td><%=ProgressBar()%></td>
178
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
179
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
180
               </td>
181
            </tr>
182
         </table>
183
      </td>
184
   </tr>
185
   <tr>
186
      <td>
187
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
188
         <%Call Messenger ( sMessage , 3, "100%" )%>
189
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
190
         <!--#include file="messages/_msg_inline.asp"-->
191
         <br>
192
         <%
193
         If Request("bmcon_id") <> "" Then
194
            %>
195
            <input type="hidden" name="bmcon_id" value="<%=Request("bmcon_id")%>">
196
            <%
197
            Dim rsTemp
198
 
199
            Query_String = "select * from build_machine_config bm, gbe_machtype gbe "&_
200
              " where bm.bmcon_id = "& Request("bmcon_id") &_
201
              " and gbe.gbe_id = bm.gbe_id"
202
 
203
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
204
 
205
            display_name            =   rsTemp("display_name")
206
            machine_hostname        =   rsTemp("machine_hostname")
4979 dpurdie 207
            gbe_id                  =   rsTemp("gbe_id")
208
            active                  =   rsTemp("active")
209
            description             =   rsTemp("description")
161 iaugusti 210
 
4979 dpurdie 211
            activeChecked = ""
212
            if active = "Y" Then activeChecked = "checked"
213
 
214
 
161 iaugusti 215
            rsTemp.Close()
216
            Set rsTemp = Nothing      
4979 dpurdie 217
          Else
218
            activeChecked = "checked"
161 iaugusti 219
          End If%>
220
 
221
         <table width="50%" border="0">
222
            <tr>
223
               <td><span class="body_txt">Display Name</span></td>
224
               <td>
225
                  <input name="display_name" type="text" class="body_txt" value="<%=display_name%>" size=24 maxlength=20>
226
               </td>
227
            </tr>
228
            <tr>
229
               <td><span class="body_txt">Machine HostName</span></td>
230
               <td>
231
                  <input name="machine_hostname" type="text" class="body_txt" value="<%=machine_hostname%>" size=60 maxlength=50>
232
               </td>
233
            </tr>
234
            <tr>
235
               <td><span class="body_txt">GBE_MACHTYPE</span></td>
236
               <td><%=objFormComponent.Combo ( "gbe_id", GetMachtype( gbe_id ), FALSE, "size=1 class='body_txt'" )%></td>
237
            </tr>
238
            <tr>
4979 dpurdie 239
               <td><span class="body_txt">Allow Use</span></td>
240
               <td>
241
                  <input type="checkbox" name="active" value="Y" <%=activeChecked%>>
242
                  <span class="body_txt">Allow users to add this machine to a build set</span>
243
               </td>
244
            </tr>
245
            <tr>
161 iaugusti 246
               <td><span class="body_txt">Description</span></td>
247
               <td>
248
                  <textarea name="Description" cols=50 rows=5 class='body_txt'><%=Description%></textarea>
249
               </td>
250
            </tr>
251
            <tr>
252
               <td>&nbsp;</td>
253
            </tr>
254
         </table>
255
      </td>
256
   </tr>
257
   <%=objPMod.ComposeHiddenTags()%>
258
   <input type="hidden" name="action" value="true">
259
 
260
   <%
261
   Call objFormComponent.FormEnd()
262
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
263
   %>
264
</table>
265
</body>
266
</html>
267
<%
268
'------------ RUN AFTER PAGE RENDER -----------
269
Set objFormCollector = Nothing
270
'----------------------------------------------
271
Call Destroy_All_Objects
272
%>
273
 
274