Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
129 ghuddy 4
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 5
%>
6
<%
7
'=====================================================
129 ghuddy 8
'               Package Information
119 ghuddy 9
'=====================================================
10
%>
11
<!--#include file="common/conf.asp"-->
12
<!--#include file="common/globals.asp"-->
13
<!--#include file="common/formating.asp"-->
14
<!--#include file="common/qstr.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/common_dbedit.asp"-->
17
<!--#include file="common/_popup_window_common.asp"-->
18
<%
19
' Set rfile parameter. This is a return page after Login
20
Call objPMod.StoreParameter ( "rfile", "fixed_issues.asp" )
21
'------------ ACCESS CONTROL ------------------
22
%>
23
<!--#include file="_access_control_login.asp"-->
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_project.asp"-->
26
<%
27
'------------ Variable Definition -------------
28
Dim parPv_id
29
Dim query
30
Dim rsQry, rsTemp
31
Dim checked
32
Dim FRdeployableYES, FRdeployableNO
33
Dim objFormCollector
34
Dim pageIsEditable, criticalSectionIsEditable
35
Dim disableCriticalSectionEdit
129 ghuddy 36
Dim Query_String
37
Dim parVCSTag
38
Dim parBSName
39
Dim submit_action_url
40
Dim on_submit_validation
191 brianf 41
Dim sDefaultLabel, sLabel, sLabelReadOnly
42
Dim isWIP
119 ghuddy 43
'------------ Constants Declaration -----------
44
'------------ Variable Init -------------------
45
Set objFormCollector = CreateObject("Scripting.Dictionary")
46
parPv_id = QStrPar("pv_id")
129 ghuddy 47
parVCSTag = QStrPar("vcs_tag")
48
parBSName = QStrPar("bs_name")
119 ghuddy 49
'----------------------------------------------
50
%>
51
<%
129 ghuddy 52
Sub MessageBox_BM_Exclusivity()
119 ghuddy 53
%><script language="Javascript">
54
alert("You cannot select Generic with other BUILD MACHINE options!")
55
history.reload()
56
 
129 ghuddy 57
</script>
58
<%
59
End Sub
119 ghuddy 60
 
129 ghuddy 61
Sub MessageBox_RequiredFieldsEmpty()
62
%><script language="Javascript">
63
alert("One or more required fields are still empty!\nFill in and submit, or cancel.")
64
history.reload()
65
 
119 ghuddy 66
</script>
67
<%
68
End Sub
69
 
129 ghuddy 70
Sub MessageBox_Need_A_BuildStandard()
71
%><script language="Javascript">
72
alert("This is an auto-build package version, and so a build standard/environment is required!\nFill in and re-submit, or cancel.")
73
history.reload()
119 ghuddy 74
 
129 ghuddy 75
</script>
76
<%
119 ghuddy 77
End Sub
78
 
79
 
129 ghuddy 80
'----------------------------------------------------------------------------------------------------------------------
81
' Function to get the build standard name (eg. JATS) from a build standard ID
82
Function bs_name_from_bs_id( nBs_Id )
83
   Dim rsTemp, Query_String
119 ghuddy 84
 
129 ghuddy 85
   bs_name_from_bs_id = "NONE"
119 ghuddy 86
 
129 ghuddy 87
   If NOT IsNull(nBs_Id) Then
88
      Query_String = " SELECT * FROM build_standards WHERE bs_id = "& nBs_Id
89
      Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
90
      If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
91
         bs_name_from_bs_id = rsTemp("bs_name")
92
      End If
93
   End If
94
End Function
95
'----------------------------------------------------------------------------------------------------------------------
96
' Function to get the build standard ID from a build standard name (eg. JATS)
97
Function bs_id_from_bs_name( nBs_Name )
98
   Dim rsTemp, Query_String
119 ghuddy 99
 
129 ghuddy 100
   bs_id_from_bs_name = 0
119 ghuddy 101
 
129 ghuddy 102
   Query_String = " SELECT * FROM build_standards WHERE bs_name = '"& nBs_Name &"'"
103
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
104
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
105
      bs_id_from_bs_name = rsTemp("bs_id")
106
   End If
107
End Function
108
'----------------------------------------------------------------------------------------------------------------------
109
' Function to get the Version Control System type ID for ClearCase, based on the assumption that the TAG used for
110
' ClearCase is 'CC'
111
Function get_clearcase_vcs_type_id()
112
   Dim rsTemp, Query_String
119 ghuddy 113
 
129 ghuddy 114
   Query_String = _
115
   " SELECT * FROM VCS_TYPE WHERE tag = 'CC'"
119 ghuddy 116
 
129 ghuddy 117
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
118
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
119
      get_clearcase_vcs_type_id = rsTemp("vcs_type_id")
120
   Else
141 ghuddy 121
      Call RaiseMsg(enum_MSG_ERROR, "Database is missing a VCS setting for Name: ClearCase, Tag: CC")
129 ghuddy 122
   End If
123
   rsTemp.Close
124
   Set rsTemp = nothing
125
End Function
126
'----------------------------------------------------------------------------------------------------------------------
127
' Function to get the Version Control System type ID for Uncontrolled, based on the assumption that the TAG used for
128
' ClearCase is 'UC'
129
Function get_uncontrolled_vcs_type_id()
130
   Dim rsTemp, Query_String
119 ghuddy 131
 
129 ghuddy 132
   Query_String = _
133
   " SELECT * FROM VCS_TYPE WHERE tag = 'UC'"
119 ghuddy 134
 
129 ghuddy 135
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
136
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
137
      get_uncontrolled_vcs_type_id = rsTemp("vcs_type_id")
138
   Else
141 ghuddy 139
      Call RaiseMsg(enum_MSG_ERROR, "Database is missing a VCS setting for Name: Uncontrolled, Tag: UC")
129 ghuddy 140
   End If
141
   rsTemp.Close
142
   Set rsTemp = nothing
143
End Function
144
'----------------------------------------------------------------------------------------------------------------------
145
Sub Get_Form_Details( nPv_id, ByRef objDetails )
146
   Dim rsTemp, Query_String
119 ghuddy 147
 
129 ghuddy 148
   Dim CC_vcs_type_id
149
   Dim UC_vcs_type_id
119 ghuddy 150
 
129 ghuddy 151
   ' Get VCS type IDs to use when evaluating legacy rows created before the introduction of the VCS tables and logic.
152
   ' These get uses in the query (see below) in the CASE statement.
153
   CC_vcs_type_id = get_clearcase_vcs_type_id()
154
   UC_vcs_type_id = get_uncontrolled_vcs_type_id()
119 ghuddy 155
 
129 ghuddy 156
   Query_String = _
157
   " SELECT pkg.pkg_name, pv.pkg_version, pv.pkg_label, pv.src_path, pv.pv_description,"&_
158
   "        pv.pv_overview, pv.v_ext, is_deployable, is_build_env_required, pv.build_type,"&_
159
   "        pv.bs_id, pv.dlocked,"&_
160
   "        (CASE WHEN pkg_label = 'N/A' AND pv.vcs_type_id IS NULL THEN "& UC_vcs_type_id &_
161
   "              WHEN pv.vcs_type_id IS NULL THEN " & CC_vcs_type_id &_
162
   "              ELSE pv.vcs_type_id END) AS vcs_type_id "&_
163
   "   FROM package_versions pv, packages pkg"&_
164
   "  WHERE pv.pkg_id = pkg.pkg_id"&_
165
   "    AND pv_id = "& nPv_id
119 ghuddy 166
 
167
 
129 ghuddy 168
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
169
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
170
      objDetails.Item("pkg_name")              = rsTemp("pkg_name")
171
      objDetails.Item("pkg_version")           = rsTemp("pkg_version")
172
      objDetails.Item("pkg_label")             = rsTemp("pkg_label")
173
      objDetails.Item("src_path")              = rsTemp("src_path")
174
      objDetails.Item("pv_description")        = rsTemp("pv_description")
175
      objDetails.Item("pv_overview")           = rsTemp("pv_overview")
176
      objDetails.Item("v_ext")                 = rsTemp("v_ext")
177
      objDetails.Item("is_deployable")         = rsTemp("is_deployable")
178
      objDetails.Item("is_build_env_required") = rsTemp("is_build_env_required")
179
      objDetails.Item("build_type")            = rsTemp("build_type")
180
      objDetails.Item("bs_id")                 = rsTemp("bs_id")
181
      objDetails.Item("dlocked")               = rsTemp("dlocked")
182
      objDetails.Item("vcs_type_id")           = rsTemp("vcs_type_id")
119 ghuddy 183
 
129 ghuddy 184
      rsTemp.Close
119 ghuddy 185
 
129 ghuddy 186
      ' This code allows the form to be altered by the user from the original build std configuration to a new
187
      ' one without having to update the database - we only want to do that when the user hits the
188
      ' submit button. The relevant fields in the objDetails are obtained in different ways accordingly.
189
      If IsNull(parBSName) OR parBSName = "" Then
190
         objDetails.Item("bs_name") = bs_name_from_bs_id( objDetails.Item("bs_id") )
191
      Else
192
         objDetails.Item("bs_id") = bs_id_from_bs_name( parBSName )
193
         objDetails.Item("bs_name") = parBSName
194
      End If
119 ghuddy 195
 
129 ghuddy 196
      ' Re-evaluate the is_build_env_required flag setting based on the possibly updated bs_name
197
      If UCase(objDetails.Item("bs_name")) = "NONE" Then
198
         objDetails.Item("is_build_env_required") = "N"
199
      Else
200
         objDetails.Item("is_build_env_required") = "Y"
201
      End If
119 ghuddy 202
 
129 ghuddy 203
      ' This code allows the form to be altered by the user from the original VCS configuration to a new
204
      ' one without having to update the database - we only want to do that when the user hits the
205
      ' submit button. The relevant fields in the objDetails are obtained in different ways accordingly.
206
      If IsNull(parVCSTag) OR parVCSTag = "" Then
207
         call vcs_info_from_vcs_type_id( objDetails.Item("vcs_type_id"), objDetails )
208
      Else
209
         call vcs_info_from_vcs_tag( parVCSTag, objDetails )
210
      End If
119 ghuddy 211
 
129 ghuddy 212
   End If
119 ghuddy 213
 
129 ghuddy 214
   rsTemp.Close
215
   Set rsTemp = Nothing
216
End Sub
217
'----------------------------------------------------------------------------------------------------------------------
218
' Updates the database, specifically the is_build_env_required flag setting in the package_versions table
219
' The update is only performed if it is needed, ie. if the value is already correct, no update is needed.
220
Sub UpdateIsBuildEnvRequired( nPv_id, nBs_name )
221
   Dim rsTemp, Query_String
119 ghuddy 222
 
129 ghuddy 223
   Query_String = _
224
   " SELECT bs_id, is_build_env_required"&_
225
   " FROM package_versions"&_
226
   " WHERE pv_id = "& nPv_id
119 ghuddy 227
 
129 ghuddy 228
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
119 ghuddy 229
 
129 ghuddy 230
   If (UCase(nBs_name) = "NONE") AND (IsNull(rsTemp("is_build_env_required")) OR (rsTemp("is_build_env_required") <> "N")) Then
231
      rsTemp.Edit
232
      rsTemp.Fields("bs_id").Value = rsTemp("bs_id")
233
      rsTemp.Fields("is_build_env_required").Value = "N"
234
      rsTemp.Update
235
   ElseIf (UCase(nBs_name) <> "NONE") AND (IsNull(rsTemp("is_build_env_required")) OR (rsTemp("is_build_env_required") <> "Y")) Then
236
      rsTemp.Edit
237
      rsTemp.Fields("bs_id").Value = rsTemp("bs_id")
238
      rsTemp.Fields("is_build_env_required").Value = "Y"
239
      rsTemp.Update
240
   End If
119 ghuddy 241
 
129 ghuddy 242
   rsTemp.Close
243
   Set rsTemp = nothing
244
End Sub
245
'----------------------------------------------------------------------------------------------------------------------
246
' Deletes the rows belonging to the current PV_ID, from the package_build_info table.
247
' This is normally done in preparation for updating the package_build_info table based on the latest
248
' (and possibly updated) build standard for the current PV_ID.
249
Sub DeletePackageBuildInfo( nPv_id )
119 ghuddy 250
 
129 ghuddy 251
   On Error Resume Next
252
   objEH.TryORA ( OraSession )
119 ghuddy 253
 
129 ghuddy 254
   OraDatabase.ExecuteSQL _
255
   "DELETE  FROM PACKAGE_BUILD_INFO WHERE PV_ID ="& nPv_id
119 ghuddy 256
 
129 ghuddy 257
   objEH.CatchORA ( OraSession )
119 ghuddy 258
 
129 ghuddy 259
End Sub
260
'----------------------------------------------------------------------------------------------------------------------
261
' Updates the vcs_type_id column for the current PV_ID, in the package_versions table.
262
' The update is only performed if it is necessary, ie. the user has changed the setting via the form, or the existing
263
' value is not yet assigned.
264
Sub UpdateVCS ( nPv_id, nVcs_type_id, nVcs_name, nVcs_tag )
265
   Dim rsTemp, Query_String
266
   Dim new_bs_id
119 ghuddy 267
 
129 ghuddy 268
   Query_String = _
269
   " SELECT vcs_type_id"&_
270
   " FROM package_versions"&_
271
   " WHERE pv_id = "& nPv_id
119 ghuddy 272
 
129 ghuddy 273
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
119 ghuddy 274
 
129 ghuddy 275
   ' compare new bs_id to existing bs_id to see if a change has been requested
276
   If nVcs_type_id <> rsTemp("vcs_type_id") OR IsNull(rsTemp("vcs_type_id")) Then
119 ghuddy 277
 
129 ghuddy 278
      'update fields
279
      rsTemp.Edit
280
      rsTemp.Fields("vcs_type_id").Value = nVcs_type_id
281
      rsTemp.Update
119 ghuddy 282
 
129 ghuddy 283
      Call Log_Action ( nPv_id, "vcs_type_id_update", "VCS Type ID Update: " & nVcs_name )
284
   End If
119 ghuddy 285
 
129 ghuddy 286
   rsTemp.Close
287
   Set rsTemp = nothing
288
End Sub
289
'----------------------------------------------------------------------------------------------------------------------
290
' Updates the bs_id column value for the current PV_ID in the package_versions table.
291
' The update is only performed if it is necessary, ie. the user has changed the setting via the form, or the existing
292
' value is not yet assigned.
293
Sub UpdateBuildStandard ( nPv_id, nBs_name )
294
   Dim rsTemp, Query_String
295
   Dim new_bs_id
119 ghuddy 296
 
129 ghuddy 297
   ' get the new bs_id from the bs_name parameter
298
   new_bs_id = bs_id_from_bs_name(nBs_name)
119 ghuddy 299
 
129 ghuddy 300
   Query_String = _
301
   " SELECT bs_id, is_build_env_required"&_
302
   " FROM package_versions"&_
303
   " WHERE pv_id = "& nPv_id
119 ghuddy 304
 
129 ghuddy 305
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
119 ghuddy 306
 
129 ghuddy 307
   ' compare new bs_id to existing bs_id to see if a change has been requested
308
   If new_bs_id <> rsTemp("bs_id") OR IsNull(rsTemp("bs_id")) Then
119 ghuddy 309
 
129 ghuddy 310
      'update fields
311
      rsTemp.Edit
312
      rsTemp.Fields("bs_id").Value = new_bs_id
119 ghuddy 313
 
129 ghuddy 314
      If UCase(nBs_name) = "NONE" Then
315
         rsTemp.Fields("is_build_env_required").Value = "N"
316
      Else
317
         rsTemp.Fields("is_build_env_required").Value = "Y"
318
      End If
319
      rsTemp.Update
119 ghuddy 320
 
129 ghuddy 321
      ' Clear out the build info table of entries for this PV_ID.
322
      Call DeletePackageBuildInfo(nPv_id)
119 ghuddy 323
 
129 ghuddy 324
      Call Log_Action ( nPv_id, "build_standard_update", "Build Standard Update: " & nBs_name )
325
   End If
119 ghuddy 326
 
129 ghuddy 327
   rsTemp.Close
328
   Set rsTemp = nothing
329
End Sub
330
'----------------------------------------------------------------------------------------------------------------------
331
' Updates the package_build_info table for the current PV_ID, based on the latest build_standard settings made
332
' by the user on the form
333
Sub UpdatePackageBuildInfo( NNpv_id )
334
   '--- Set Build Types ---
335
   Dim aBuildEnvList
336
   Dim OraParameter
337
   Dim nBuildMachine
119 ghuddy 338
 
129 ghuddy 339
   ' Before doing inserts for this PV_ID into the package_build_info table, we need to delete any existing
340
   ' rows for this PV_ID. This may have already been done if the user has changed the build standard, but
341
   ' there is no guarantee at this point that they have done that during this forms display.
342
   Call DeletePackageBuildInfo( NNpv_id )
119 ghuddy 343
 
129 ghuddy 344
   OraDatabase.Parameters.Add "PV_ID",  NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
345
   OraDatabase.Parameters.Add "BM_ID",  0,       ORAPARM_INPUT, ORATYPE_NUMBER
346
   OraDatabase.Parameters.Add "BSA_ID", 0,       ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 347
 
129 ghuddy 348
   Set OraParameter = OraDatabase.Parameters
119 ghuddy 349
 
129 ghuddy 350
   aBuildEnvList = Split( Replace( Request("be_id_list"), " ", "" ) , ",")
119 ghuddy 351
 
129 ghuddy 352
   On Error Resume Next
353
   objEH.TryORA ( OraSession )
119 ghuddy 354
 
129 ghuddy 355
   For Each nBuildMachine In aBuildEnvList
119 ghuddy 356
 
129 ghuddy 357
      OraParameter("BM_ID").Value = nBuildMachine
358
      OraParameter("BSA_ID").Value = Request("build_type_comb_"& nBuildMachine)
119 ghuddy 359
 
129 ghuddy 360
      If Err.Number = 0 Then
361
         OraDatabase.ExecuteSQL("begin INSERT INTO PACKAGE_BUILD_INFO ( PV_ID, BM_ID, BSA_ID ) "&_
362
                                " VALUES( :PV_ID, :BM_ID, :BSA_ID ); end;")
363
      End If
364
   Next
119 ghuddy 365
 
129 ghuddy 366
   objEH.CatchORA ( OraSession )
119 ghuddy 367
 
129 ghuddy 368
   OraDatabase.Parameters.Remove "PV_ID"
369
   OraDatabase.Parameters.Remove "BM_ID"
370
   OraDatabase.Parameters.Remove "BSA_ID"
371
End Sub
372
'----------------------------------------------------------------------------------------------------------------------
373
' This is the overall database update function called when the user hits the submit button on the form.
374
' It does some minor updates itself, but most of the work is done in subroutines.
375
' No attempt is made to keep the entire set of updates atomic. There really is no need to do that.
376
Sub Update_Pkg_Info ( NNpv_id, NNdeployable, SSLabel, SSPath, SSdesc, SSoverview )
377
   Dim rsTemp, Query_String
119 ghuddy 378
 
129 ghuddy 379
   On Error Resume Next
119 ghuddy 380
 
129 ghuddy 381
   Query_String = _
382
   " SELECT pkg_label, src_path, pv_description, pv_overview, is_deployable "&_
383
   " FROM package_versions"&_
384
   " WHERE pv_id = "& NNpv_id
119 ghuddy 385
 
129 ghuddy 386
   If SSdesc = "" Then SSdesc = NULL
387
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
119 ghuddy 388
 
129 ghuddy 389
   rsTemp.Edit
119 ghuddy 390
 
129 ghuddy 391
   ' Only update build critical sections (label, source path) if allowed
392
   If criticalSectionIsEditable Then
119 ghuddy 393
 
191 brianf 394
      If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) OR _
395
         (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then
396
        rsTemp.Fields("pkg_label").Value = SSLabel
397
      ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SVN_TAG) and isWIP Then
398
        rsTemp.Fields("pkg_label").Value = SSLabel
129 ghuddy 399
      Else
191 brianf 400
        rsTemp.Fields("pkg_label").Value = "N/A"
129 ghuddy 401
      End If
119 ghuddy 402
 
129 ghuddy 403
      rsTemp.Fields("src_path").Value = SSPath
404
   End If
119 ghuddy 405
 
129 ghuddy 406
   ' Update non-build critical sections
407
   rsTemp.Fields("pv_description").Value = SSdesc
408
   rsTemp.Fields("pv_overview").Value = SSoverview
119 ghuddy 409
 
129 ghuddy 410
   If NNdeployable = "1" Then
411
      rsTemp.Fields("is_deployable").Value = "Y"
412
   Else
413
      rsTemp.Fields("is_deployable").Value = NULL
414
   End If
119 ghuddy 415
 
129 ghuddy 416
   rsTemp.Update
119 ghuddy 417
 
129 ghuddy 418
   rsTemp.Close
419
   Set rsTemp = nothing
420
 
421
   ' Only update build critical sections if allowed
422
   If criticalSectionIsEditable Then
423
 
424
      ' Update the VCS if necessary for this PV_ID
425
      Call UpdateVCS( NNpv_id, objFormCollector.Item("vcs_type_id"), objFormCollector.Item("vcs_name"), objFormCollector.Item("vcs_tag") )
426
 
427
      ' Update the build standard if necessary for this PV_ID
428
      Call UpdateBuildStandard( NNpv_id, objFormCollector.Item("bs_name") )
429
 
430
      ' Update the 'is build_env_required' flag for this PV_ID
431
      Call UpdateIsBuildEnvRequired( NNpv_id, objFormCollector.Item("bs_name") )
432
 
433
      ' Update the package_build_info table for this PV_ID
434
      Call UpdatePackageBuildInfo( NNpv_id )
435
   End If
436
End Sub
119 ghuddy 437
'----------------------------------------------------------------------------------------------------------------------
438
Function ShowHideBuildType( sBuildEnvChecked )
439
 
129 ghuddy 440
   ShowHideBuildType = "style='display:none;'"
119 ghuddy 441
 
129 ghuddy 442
   If (sBuildEnvChecked <> "") Then
443
      ShowHideBuildType = "style='display:block;'"
444
   End If
119 ghuddy 445
 
446
End Function
447
'----------------------------------------------------------------------------------------------------------------------
129 ghuddy 448
' Renders the HTML for the build standard addendum drop down list boxes, ie. Prod, Debug, Prod+Debug, Java 1.4, Java 1.5, etc.
119 ghuddy 449
Sub RenderBuildTypeCombo( nBuildAddendum, nBuildMachine, nBuildStandard )
450
 
129 ghuddy 451
   Query_String = "SELECT * FROM build_standards_addendum WHERE bs_id ="& nBuildStandard & " ORDER BY bsa_id DESC"
119 ghuddy 452
 
129 ghuddy 453
   Response.Write "<select name='build_type_comb_"& nBuildMachine &"' class='form_item'"& disableCriticalSectionEdit &">"
119 ghuddy 454
 
129 ghuddy 455
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
456
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
119 ghuddy 457
 
129 ghuddy 458
   If nBuildAddendum = rsTemp.Fields("bsa_id") Then
459
      Response.write "<option value='"& rsTemp.Fields("bsa_id") &"' selected>"& rsTemp.Fields("bsa_name") &"</option>"
460
   Else
461
      Response.write "<option value='"& rsTemp.Fields("bsa_id") &"'>"& rsTemp.Fields("bsa_name") &"</option>"
462
   End If
463
   rsTemp.MoveNext
464
   WEnd
465
   Response.Write "</select>"
119 ghuddy 466
 
129 ghuddy 467
   rsTemp.Close()
468
   Set rsTemp = nothing
469
End Sub
470
'----------------------------------------------------------------------------------------------------------------------
471
' Renders the HTML for the Version Control Settings drop down list box
472
Sub RenderVCSCombo(nTag)
119 ghuddy 473
 
129 ghuddy 474
   Query_String = "SELECT * FROM vcs_type ORDER BY name"
119 ghuddy 475
 
129 ghuddy 476
   Response.Write "<select id='vcs_name_combo' name='vcs_name_combo' class='form_item' "& disableCriticalSectionEdit &" onchange='vcs_changed();'>"
477
 
478
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
479
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
480
 
481
      If nTag = rsTemp.Fields("tag") Then
482
         Response.write "<option value='"& rsTemp.Fields("name") &"' selected>"& rsTemp.Fields("name") &"</option>"
483
      Else
484
         ' Add item to drop down only if it is not UC (uncontrolled). If it is UC, then only add it if the package
485
         ' version is a manual build type. It is not valid to allow autobuild packages to be uncontrolled (ie. the
486
         ' build (daemon) tool needs a label or something doesn't it?)
487
         If rsTemp.Fields("tag") <> enum_VCS_UNCONTROLLED_TAG OR objFormCollector.Item("build_type") = "M" Then
488
            Response.write "<option value='"& rsTemp.Fields("name") &"'>"& rsTemp.Fields("name") &"</option>"
489
         End If
490
      End If
491
      rsTemp.MoveNext
492
   WEnd
493
   Response.Write "</select>"
494
 
495
   ' Create a hidden combo containing tags instead of names - we can use this to get a tag for a name without
496
   ' doing a database query
497
   Response.Write "<td nowrap background='images/bg_form_lightbluedark.gif'><div id='div_vcs_tag_combo' name='div_vcs_tag_combo' style='visibility:hidden'   >"
498
   Response.Write "<select id='vcs_tag_combo' name='vcs_tag_combo' disabled hidden  class='form_item' "& disableCriticalSectionEdit &">"
499
   rsTemp.MoveFirst
500
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
501
      Response.write "<option value='"& rsTemp.Fields("tag") &"'>"& rsTemp.Fields("tag") &"</option>"
502
      rsTemp.MoveNext
503
   WEnd
504
   Response.Write "</select>"
505
   Response.Write "</div></td>"
506
 
507
   rsTemp.Close()
508
   Set rsTemp = nothing
119 ghuddy 509
End Sub
510
'----------------------------------------------------------------------------------------------------------------------
129 ghuddy 511
' Renders the HTML for the build standard drop down list box
512
'
513
' Typically, this drop down would contain ANT, JATS, and NONE, although ofcoarse this is dependant upon what data is
514
' present in the build_standards table of the database
515
Sub RenderBldStdCombo(nBldStdName)
516
 
517
   Query_String = "SELECT * FROM build_standards"
518
 
519
   Response.Write "<select id='bld_std_combo' name='bld_std_combo' class='form_item' "& disableCriticalSectionEdit &" onchange='bld_std_changed();'>"
520
 
521
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
522
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
523
 
524
      If nBldStdName = rsTemp.Fields("bs_name") Then
525
         Response.write "<option value='"& rsTemp.Fields("bs_name") &"' selected>"& rsTemp.Fields("bs_name") &"</option>"
526
      Else
527
         Response.write "<option value='"& rsTemp.Fields("bs_name") &"'>"& rsTemp.Fields("bs_name") &"</option>"
528
      End If
529
      rsTemp.MoveNext
530
   WEnd
531
   Response.Write "</select>"
532
   Response.Write "<td nowrap background='images/bg_form_lightbluedark.gif'>&nbsp;</td>"
533
 
534
   rsTemp.Close()
535
   Set rsTemp = nothing
536
End Sub
537
'----------------------------------------------------------------------------------------------------------------------
538
' Figures out what the url should be for when the form is submitted, ensuring that all of the paramters are present if
539
' need be. Note that the VCS and BSName parameters are optional. They will only be present if the user has made modifications
540
' to the respective drop down list boxes before submitting the form.
541
Sub Determine_submit_action_url ()
542
   ' Work out what the reload url should be for when the user hits the submit button
543
   If IsNull(parVCSTag) OR parVCSTag = "" Then
544
      If IsNull(parBSName) OR parBSName = "" Then
545
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id
546
      Else
547
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&bs_name=" & parBSName
548
      End If
549
   Else
550
      If IsNull(parBSName) OR parBSName = "" Then
551
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag
552
      Else
553
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag & "&bs_name=" & parBSName
554
      End If
555
   End If
556
End Sub
557
'----------------------------------------------------------------------------------------------------------------------
558
' This subroutine sets up the on_submit_validation string to be used in the form tag to validate certain fields
559
' in client-side javascript when a user tries to submit the form
560
Sub Determine_On_Submit_Validation
561
   on_submit_validation = ""
1376 dpurdie 562
   Dim args
129 ghuddy 563
 
564
   If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then
565
      ' Do clearcase path + label validation
1376 dpurdie 566
      args = "'FRlabel','Label','RisCCLabel','FRpath','Source Path','RisCCPath'"
129 ghuddy 567
   ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then
568
      ' Do subversion tag validation
1376 dpurdie 569
      args = "'FRpath','Source Path','RisSVNPath'"
570
      args = args & ",'FRlabel','Subversion Tag','RisSVNTag'"
571
      If (objFormCollector.Item("build_type") = "M" ) Then
572
          args = args & ",'FRlabel','Subversion Tag','RisSVNPegTag'"
573
      End If
129 ghuddy 574
   End If
1376 dpurdie 575
   on_submit_validation = "onSubmit=""MM_validateForm(" & args & "); return document.MM_returnValue"""
129 ghuddy 576
 
577
End Sub
578
'----------------------------------------------------------------------------------------------------------------------
579
' This function obtains a BM_ID (build machine ID) from a buidl machine name by querrying the database
580
Function Get_BM_ID_for_BM_Name(nBm_Name)
581
   Dim rsTemp, Query_String
582
 
583
   Get_BM_ID_for_BM_Name = ""
584
 
585
   Query_String = "SELECT bm_id FROM build_machines bm WHERE bm.bm_name = '" & nBm_Name & "'"
586
 
587
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
588
 
589
   Get_BM_ID_for_BM_Name = ""
590
 
591
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
592
      Get_BM_ID_for_BM_Name = rsTemp("bm_id")
593
   End If
594
 
595
End Function
596
'----------------------------------------------------------------------------------------------------------------------
119 ghuddy 597
Function GetRowColor( sRowColor )
129 ghuddy 598
   If sRowColor = "#FFFFFF" Then
599
      GetRowColor = "#F5F5F5"
600
   Else
601
      GetRowColor = "#FFFFFF"
602
   End If
119 ghuddy 603
End Function
129 ghuddy 604
'----------------------------------------------------------------------------------------------------------------------
119 ghuddy 605
%>
606
<%
607
'------------------------------- RUN BEFORE PAGE RENDER ----------------------------
129 ghuddy 608
 
609
Call LoadFieldRules ( "'FRlabel','FRpath','pv_description','pv_overview','be_id_list'", objForm )      ' Load Validation Rules
119 ghuddy 610
Call Get_Form_Details( parPv_id, objFormCollector )
611
 
612
 
613
 
129 ghuddy 614
'--- From Validation Rule Changes ----
119 ghuddy 615
 
1376 dpurdie 616
' Dont need the label if the package version is uncontrolled
617
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
129 ghuddy 618
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
619
End If
119 ghuddy 620
 
129 ghuddy 621
' Dont need the path if the package version is uncontrolled
622
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
623
   objForm.UpdateRules ("id='FRpath' IsRequired='N'")
119 ghuddy 624
End If
625
 
129 ghuddy 626
' Dont need the build environment if the is_build_env_required is "N"
627
If objFormCollector.Item("is_build_env_required") = "N" Then
628
   objForm.UpdateRules ("id='be_id_list' IsRequired='N'")
119 ghuddy 629
End If
630
 
631
 
129 ghuddy 632
 
119 ghuddy 633
'--- Access Control Setup ------------
634
pageIsEditable = Is_Page_Editable ( objFormCollector.Item ("dlocked") )
635
criticalSectionIsEditable = Is_Critical_Section_Editable ( objFormCollector.Item("dlocked") )
191 brianf 636
isWIP = PackageExists(parRtag_id,parPv_id,"work_in_progress")
119 ghuddy 637
 
638
If criticalSectionIsEditable then
129 ghuddy 639
   disableCriticalSectionEdit = ""
119 ghuddy 640
Else
129 ghuddy 641
   disableCriticalSectionEdit = "disabled"
119 ghuddy 642
End If
643
 
129 ghuddy 644
' Disable "Required" warnings for fields that cannot be edited by the current user at this time
645
If NOT criticalSectionIsEditable Then
646
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
647
   objForm.UpdateRules ("id='FRpath' IsRequired='N'")
648
   objForm.UpdateRules ("id='be_id_list' IsRequired='N'")
649
End If
119 ghuddy 650
 
129 ghuddy 651
 
119 ghuddy 652
'--- Process Submission ---------------
653
 
129 ghuddy 654
If objForm.IsPostBack Then
655
   ' use of the drop down lists or the submit button gets us in here
119 ghuddy 656
 
129 ghuddy 657
   If objForm.IsValidOnPostBack Then
658
      ' only get here if the form is valid
119 ghuddy 659
 
129 ghuddy 660
      ' has the user pressed the submit button?
661
      If Request("btn") = "Submit" Then
119 ghuddy 662
 
129 ghuddy 663
         If objFormCollector.Item("build_type") = "A" AND UCase(objFormCollector.Item("bs_name")) = "NONE" Then
119 ghuddy 664
 
129 ghuddy 665
            Call MessageBox_Need_A_BuildStandard()
119 ghuddy 666
 
129 ghuddy 667
         Else
119 ghuddy 668
 
129 ghuddy 669
            Dim aBuildEnvList, nBuildEnv, display
670
            display = false
671
 
672
            If UCase(objFormCollector.Item("bs_name")) <> "NONE" Then
673
               ' Check for mutual exclusivity rules on the build standard addendum items
674
               aBuildEnvList = Split( Replace( Request("be_id_list"), " ", "" ) , ",")
675
 
676
               ' If >1 build machine items have been selected....
677
               If UBound(aBuildEnvList) > 0 Then
678
                  Dim bm_id_generic
679
                  bm_id_generic = Get_BM_ID_for_BM_Name("Generic")
680
 
681
                  ' If one of the selected build mnachines is "Generic" then we have a mutual exclusivity violation
682
                  For Each nBuildEnv In aBuildEnvList
683
                     If nBuildEnv = bm_id_generic Then
684
                        display = true
685
                     End If
686
                  Next
687
               End If
688
            End If
689
 
690
            If display then
691
               Call MessageBox_BM_Exclusivity()
692
            Else
693
               Call Update_Pkg_Info ( parPv_id, QStrPar("FRdeployable"), QStrPar("FRlabel"), QStrPar("FRpath"), QStrPar("pv_description"), QStrPar("pv_overview") )
694
               Call OpenInParentWindow ( "fixed_issues.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&hidenv=true" )
695
               Call CloseWindow
696
            End If
697
 
698
         End If
699
 
700
 
701
      Else
702
         ' We come through here when a user modifies the VCS or Build Standard drop down list settings
703
         ' We must stay in the form. There is nothing to do yet. The user may not have finished making their edits yet.
704
      End If
705
   Else
706
      ' The form is still invalid but we only want to issue the warning message if the user pressed the submit button
707
      If Request("btn") = "Submit" Then
708
         Call MessageBox_RequiredFieldsEmpty()
709
      End If
710
   End If
119 ghuddy 711
End If
129 ghuddy 712
 
713
' Determine the URL to use when and if this form is refreshed using F5, or when a user changes the
714
' values in one of the drop down lists and the form is reloaded with additional or changed parameters
715
' The html form will use the result of this in its action tag.
716
Call Determine_submit_action_url()
717
 
718
Call Determine_On_Submit_Validation()
719
 
119 ghuddy 720
'--------------------------------------------------------------------------------------------
721
%>
722
<html>
723
<head>
724
<title>Release Manager</title>
725
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
726
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
727
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
728
<link rel="stylesheet" href="images/navigation.css" type="text/css">
729
<script language="JavaScript" src="images/common.js"></script>
730
<!-- TIPS -->
731
<script language="JavaScript" src="images/tipster.js"></script>
732
<script language="JavaScript" src="images/_help_tips.js"></script>
733
<script language="JavaScript" type="text/javascript">
734
<!--
735
 
129 ghuddy 736
// This function is the onchange event handler for the Version Control System drop down list box.
737
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
738
// and submit the form using the updated URL.
739
function vcs_changed() {
740
   var f = document.getElementById('pkginfo');
741
   if (f == null) {
742
      alert('Javascript Error : Failed to get pkginfo');
743
   }
744
   else {
119 ghuddy 745
 
129 ghuddy 746
      var nc = document.getElementById('vcs_name_combo');
747
      if (nc == null) {
748
         alert('Javascript Error : Failed to get vcs_name_combo');
749
      }
750
      else {
751
         var tc = document.getElementById('vcs_tag_combo');
752
         if (tc == null) {
753
            alert('Javascript Error : Failed to get vcs_tag_combo');
754
         }
755
         else {
756
            // Form the new URL with the updated VCS tag passed as a parameter
139 ghuddy 757
            var tc2 = document.getElementById('vcs_name_combo');
758
            if (tc2.options[nc.selectedIndex].value == 'Concurrent Versions System')
759
            {
760
               alert('The Concurrent Versions System (CVS) is not fully supported by ERG.\n' +
761
                     'This means you will have to manually build this package.\n' +
151 ghuddy 762
                     'Please ensure you assign the version number manually, if that is not already so.\n');
139 ghuddy 763
            }
129 ghuddy 764
            <%If IsNull(parBSName) OR parBSName = "" Then%>
765
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
766
            <%Else%>
767
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=<%=parBSName%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
768
            <%End If%>
769
 
770
            f.submit();
771
         }
772
      }
773
   }
119 ghuddy 774
}
129 ghuddy 775
 
776
// This function is the onchange event handler for the Build Standard drop down list box.
777
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
778
// and submit the form using the updated URL.
779
function bld_std_changed() {
780
   var f = document.getElementById('pkginfo');
781
   if (f == null) {
782
      alert('Javascript Error : Failed to get pkginfo');
783
   }
784
   else {
785
      var nc = document.getElementById('bld_std_combo');
786
      if (nc == null) {
787
         alert('Javascript Error : Failed to get bld_std_combo');
788
      }
789
      else {
790
         // Form the new URL with the updated build standard name passed as a parameter
791
         <%If IsNull(parVCSTag) OR parVCSTag = "" Then%>
792
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=" + nc.options[nc.selectedIndex].value;
793
         <%Else%>
794
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=<%=parVCSTag%>&bs_name=" + nc.options[nc.selectedIndex].value;
795
         <%End If%>
796
 
797
         f.submit();
798
      }
799
   }
800
}
801
 
802
// This function will replace back slashes with forward slashes and can be used with an onchange event on fields
803
// where back slashes may be entered
804
function replace_back_slashes(e) {
1376 dpurdie 805
   strip_whitespace(e);
129 ghuddy 806
   var str = e.value;
807
   e.value = str.replace(/\\/g,"/");
808
}
809
 
1376 dpurdie 810
function strip_whitespace(e) {
811
   var str = e.value;
812
   str = str.replace(/^\s+/,"");
813
   e.value =  str.replace(/\s+$/,"");
814
}
815
 
119 ghuddy 816
//-->
817
</script>
818
</head>
819
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
820
<!-- TIPS LAYERS -------------------------------------->
821
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
822
<!----------------------------------------------------->
129 ghuddy 823
<form id="pkginfo" name="pkginfo" method="post" <%=on_submit_validation%> action="<%=submit_action_url%>">
824
   <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
825
      <tr>
826
         <td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/s_info_off.gif" width="21" height="21" hspace="5" border="0"></td>
827
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Package Information </td>
828
         <td background="images/lbox_bg_blue.gif" align="right" width="50%">
829
            <input type="submit" name="btn" value="Submit" <%If pageIsEditable Then%>class="form_btn_comp"<%Else%>disabled class="form_btn_comp_disabled"<%End If%>>
830
            <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
831
         </td>
832
         <td background="images/lbox_bg_blue.gif" align="right" width="1%" nowrap>
833
         <img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
834
      </tr>
119 ghuddy 835
 
129 ghuddy 836
      <tr>
837
         <td height="100%" width="1%">&nbsp;</td>
838
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
839
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
840
               <tr>
841
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
842
                  <td width="1%" nowrap class="form_group" valign="bottom"></td>
843
                  <td nowrap width="1%">&nbsp; </td>
844
                  <td nowrap width="100%">&nbsp;</td>
845
               </tr>
846
               <tr>
847
                  <td>&nbsp;</td>
848
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
849
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objFormCollector.Item("pkg_name") &" "& objFormCollector.Item("pkg_version")%></td>
850
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
851
               </tr>
852
               <tr>
853
                  <td>&nbsp;</td>
854
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Deployable?<%=Quick_Help ( "deployable" )%></td>
855
                  <%
856
                  FRdeployableYES = ""
857
                  FRdeployableNO = ""
119 ghuddy 858
 
129 ghuddy 859
                  If objForm.IsPostBack Then
860
                     If Request("FRdeployable") = "1" Then
861
                        FRdeployableYES = "checked"
862
                     Else
863
                        FRdeployableNO = "checked"
864
                     End If
119 ghuddy 865
 
129 ghuddy 866
                  Else
867
                     If objFormCollector.Item("is_deployable") = enumDB_YES Then
868
                        FRdeployableYES = "checked"
869
                     Else
870
                        FRdeployableNO = "checked"
871
                     End If
119 ghuddy 872
 
129 ghuddy 873
                  End If
874
                  %>
875
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">Yes<input name="FRdeployable" type="radio" value="1" <%=FRdeployableYES%>>
876
                  &nbsp;&nbsp;No<input name="FRdeployable" type="radio" value="0" <%=FRdeployableNO%>></td>
877
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
878
               </tr>
879
               <tr>
880
                  <td>&nbsp;</td>
881
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Version Control System</td>
882
                  <td nowrap background="images/bg_form_lightbluedark.gif">
883
                     <% Call RenderVCSCombo(objFormCollector.Item("vcs_tag"))%>
884
                  </td>
885
               </tr>
119 ghuddy 886
 
129 ghuddy 887
               <%If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then%>
1376 dpurdie 888
 
129 ghuddy 889
                  <tr>
890
                     <td>&nbsp;</td>
1376 dpurdie 891
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
892
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
893
                        <input name="FRpath" type="text" class="form_item" <%=disableCriticalSectionEdit%> id="FRpath" onchange="replace_back_slashes(this);" value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>" size="60" maxlength="2000">
894
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs <br>
895
                     </td>
896
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
897
                  </tr>
898
 
899
                  <tr>
900
                     <td>&nbsp;</td>
129 ghuddy 901
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
902
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
903
                        <%
904
                        sLabelReadOnly = ""
905
                        sDefaultLabel = Default_Label(parPv_id, objFormCollector.Item("build_type"), objFormCollector.Item("pkg_name"), objFormCollector.Item("pkg_version"), objFormCollector.Item("v_ext"))
119 ghuddy 906
 
129 ghuddy 907
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
908
                           sLabelReadOnly = "readonly"
909
                        End If
119 ghuddy 910
 
129 ghuddy 911
                        If objForm.IsPostBack Then
912
                           sLabel = Request("FRlabel")
119 ghuddy 913
 
129 ghuddy 914
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
915
                           ' the FRlabel request we just did will return a null/empty, so set sLabel to the default label once more if this is the case.
916
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
917
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
918
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
919
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
920
                           If IsNull(sLabel) OR sLabel = "" Then
921
                              sLabel = sDefaultLabel
922
                              objForm.SetValueForced "FRlabel", sLabel
923
                           End If
924
                        Else
925
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
926
                              sLabel = "N/A"
927
                           Else
928
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
929
                                 sLabel = sDefaultLabel
930
                              Else
931
                                 sLabel = objFormCollector.Item("pkg_label")
932
                              End If
933
                              objForm.SetValue "FRlabel", sLabel
934
                           End If
935
                        End If
936
                        %>
1376 dpurdie 937
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
938
                        <br>&nbsp;Example: core_cs_1.0.0000.cr<br>
129 ghuddy 939
                     </td>
940
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
941
                  </tr>
1376 dpurdie 942
 
129 ghuddy 943
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then%>
944
                  <tr>
945
                     <td>&nbsp;</td>
1376 dpurdie 946
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "svn_source_path" )%></td>
129 ghuddy 947
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
948
                        <input name="FRpath" type="text" class="form_item" <%=disableCriticalSectionEdit%> id="FRpath" onchange="replace_back_slashes(this);" value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>" size="60" maxlength="2000">
1376 dpurdie 949
                        <br>&nbsp;Example: AUPERASVN01/RepoName/myPackage/trunk<br>
129 ghuddy 950
                     </td>
951
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
952
                  </tr>
191 brianf 953
                  <tr>
954
                     <td>&nbsp;</td>
1376 dpurdie 955
                     <td nowrap valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Tag<%=Quick_Help ( "svn_tag" )%></td>
191 brianf 956
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
957
                        <%
958
                        sLabelReadOnly = ""
959
                        sDefaultLabel = Default_Label(parPv_id, objFormCollector.Item("build_type"), objFormCollector.Item("pkg_name"), objFormCollector.Item("pkg_version"), objFormCollector.Item("v_ext"))
960
 
961
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
962
                           sLabelReadOnly = "readonly"
963
                        End If
964
 
965
                        If objForm.IsPostBack Then
966
                           sLabel = Request("FRlabel")
967
 
968
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
969
                           ' the FRlabel request we just did will return a null/empty, so set sLabel to the default label once more if this is the case.
970
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
971
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
972
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
973
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
974
                           If IsNull(sLabel) OR sLabel = "" Then
975
                              sLabel = sDefaultLabel
976
                              objForm.SetValueForced "FRlabel", sLabel
977
                           End If
978
                        Else
979
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
980
                              sLabel = "N/A"
981
                           Else
982
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
983
                                 sLabel = sDefaultLabel
984
                              Else
985
                                 sLabel = objFormCollector.Item("pkg_label")
986
                              End If
987
                              objForm.SetValue "FRlabel", sLabel
988
                           End If
989
                        End If
990
                        %>
1376 dpurdie 991
 
992
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
993
                        <%
994
                        If objFormCollector.Item("build_type") = "M" Then
995
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>@1234<br> <%
996
                        Else
997
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>[@1234]<br> <%
998
                        End If
999
                        %>
191 brianf 1000
                     </td>
1001
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
1002
                  </tr>
1376 dpurdie 1003
 
139 ghuddy 1004
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then%>
1005
                  <tr>
1006
                     <td>&nbsp;</td>
1376 dpurdie 1007
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
139 ghuddy 1008
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1376 dpurdie 1009
                        <input name="FRpath" type="text" class="form_item" <%=disableCriticalSectionEdit%> id="FRpath" onchange="replace_back_slashes(this);" value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>" size="60" maxlength="2000">
1010
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs<br>
139 ghuddy 1011
                     </td>
1376 dpurdie 1012
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
139 ghuddy 1013
                  </tr>
1376 dpurdie 1014
 
139 ghuddy 1015
                  <tr>
1016
                     <td>&nbsp;</td>
1376 dpurdie 1017
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
139 ghuddy 1018
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1376 dpurdie 1019
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=objForm.GetValue( "FRlabel", objFormCollector.Item("pkg_label") )%>" >
139 ghuddy 1020
                     </td>
1376 dpurdie 1021
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
139 ghuddy 1022
                  </tr>
1376 dpurdie 1023
 
129 ghuddy 1024
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then%>
1376 dpurdie 1025
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
129 ghuddy 1026
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1027
               <%Else%>
1028
                  <tr>
1029
                     <td>&nbsp;</td>
1030
                     <td colspan=3 background="images/bg_form_lightbluedark.gif" class="sublbox_txt">
1031
                        <span class='err_alert'><b>WARNING:</b> Release Manager Website does not currently support the selected Version Control System</span>
1032
                     </td>
1033
                  </tr>
1376 dpurdie 1034
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
129 ghuddy 1035
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1036
               <%End If%>
119 ghuddy 1037
 
129 ghuddy 1038
               <tr>
1039
                  <td>&nbsp;</td>
1040
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Short Package Description<%=Quick_Help ( "pkg_info_short_desc" )%></td>
1041
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1042
                     <textarea name="pv_description" cols="57" rows="5" class="form_item" id="pv_description"><%=objForm.GetValue( "pv_description", objFormCollector.Item("pv_description") )%></textarea>
1043
                  </td>
1044
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_description")%></td>
1045
               </tr>
1046
               <tr>
1047
                  <td>&nbsp;</td>
1048
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Package Overview<%=Quick_Help ( "pkg_info_overview" )%></td>
1049
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1050
                     <textarea name="pv_overview" cols="57" rows="10" class="form_item" id="pv_overview"><%=objForm.GetValue( "pv_overview", objFormCollector.Item("pv_overview") )%></textarea>
1051
                  </td>
1052
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_overview")%></td>
1053
               </tr>
119 ghuddy 1054
 
129 ghuddy 1055
               <tr>
1056
                  <td>&nbsp;</td>
1057
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Standard</td>
1058
                  <td nowrap background="images/bg_form_lightbluedark.gif">
1059
                     <% Call RenderBldStdCombo(objFormCollector.Item("bs_name"))%>
1060
                  </td>
1061
               </tr>
119 ghuddy 1062
 
129 ghuddy 1063
               <tr>
1064
                  <td>&nbsp;</td>
1065
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Environment<%=Quick_Help ( "build_environment" )%></td>
1066
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1067
                     <%If objFormCollector.Item("is_build_env_required") = "N" Then%>
1068
                        &nbsp;Build Environment not applicable
1069
                     <%End If%>
119 ghuddy 1070
 
129 ghuddy 1071
                     <div id="divBuildEnv" name="divBuildEnv" style="width:320px; height:150px; overflow: auto; <%If (objFormCollector.Item("is_build_env_required") = "N") Then%>display:none;<%Else%>display:block;<%End If%>">
1072
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
1073
                           <tr>
1074
                              <td bgcolor="#FFFFFF">
1075
                                 <table width="100%" border="0" cellspacing="0" cellpadding="3">
1076
                                    <%
1077
                                    OraDatabase.Parameters.Add "PV_ID",    parPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 1078
 
129 ghuddy 1079
                                    query = _
1080
                                    " SELECT DECODE ( pkgbinfo.BM_ID,"&_
1081
                                    "                    bm.BM_ID, 'checked',"&_
1082
                                    "            NULL ) AS checked,"&_
1083
                                    "      bm.BM_ID,"&_
1084
                                    "      bm.BM_NAME, "&_
1085
                                    "      pkgbinfo.BSA_ID"&_
1086
                                    "  FROM BUILD_MACHINES bm,"&_
1087
                                    "        PACKAGE_BUILD_INFO pkgbinfo"&_
1088
                                    " WHERE pkgbinfo.BM_ID (+)= bm.BM_ID"&_
1089
                                    "   AND pkgbinfo.PV_ID (+)= :PV_ID"&_
1090
                                    " ORDER BY UPPER(bm.bm_name) "
119 ghuddy 1091
 
1092
 
129 ghuddy 1093
                                    Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
1094
                                    Dim rowColor
119 ghuddy 1095
 
129 ghuddy 1096
                                    rowColor = "#F5F5F5"
119 ghuddy 1097
 
129 ghuddy 1098
                                    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
1099
                                       checked = ""
1100
                                       If objForm.IsTicked( "be_id_list", rsQry("bm_id"), rsQry("checked") ) Then
1101
                                          checked = "checked"
1102
                                          objForm.SetValue "be_id_list", checked
1103
                                       End If
119 ghuddy 1104
 
129 ghuddy 1105
                                       rowColor = GetRowColor( rowColor )
1106
                                       %>
1107
                                       <tr>
1108
                                          <td nowrap class="form_txt" bgcolor="<%=rowColor%>"><input type="checkbox" name="be_id_list" onClick="ToggleDisplay('build_type_<%=rsQry("bm_id")%>');" <%=disableCriticalSectionEdit%> value="<%=rsQry("bm_id")%>" <%=checked%>></td>
1109
                                          <td nowrap class="form_txt" bgcolor="<%=rowColor%>"><%=rsQry("bm_name")%></td>
1110
                                          <td nowrap class="form_txt" bgcolor="<%=rowColor%>"><div id="build_type_<%=rsQry("bm_id")%>" <%=ShowHideBuildType( checked )%>><% Call RenderBuildTypeCombo( rsQry("bsa_id"), rsQry("bm_id"), objFormCollector.Item("bs_id") )%></div></td>
1111
                                          <%If checked = "checked" AND rsQry("bsa_id") = 0 Then%>
1112
                                             <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><td background='images/red_dot.gif'><img src='images/spacer.gif' width='1' height='1'></td><td valign='top'><img src='icons/i_bulet_red.gif' width='4' height='4' hspace='3' vspace='4' border='0' align='absmiddle'></td><td class='val_err'>Required</td></td>
1113
                                          <%End If%>
1114
                                       </tr>
1115
                                       <%rsQry.MoveNext
1116
                                    WEnd
119 ghuddy 1117
 
129 ghuddy 1118
                                    rsQry.Close
1119
                                    Set rsQry = Nothing
1120
 
1121
                                    OraDatabase.Parameters.Remove "PV_ID"
1122
                                    %>
1123
                                    <tr>
1124
                                       <td width="1"></td>
1125
                                       <td width="1"></td>
1126
                                       <td width="100%"></td>
1127
                                    </tr>
1128
                                 </table>
1129
                              </td>
1130
                           </tr>
1131
                        </table>
1132
                     </div>
1133
                  </td>
1134
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate("be_id_list")%></td>
1135
               </tr>
1136
               <tr>
1137
                  <td>&nbsp;</td>
1138
                  <td nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
1139
                  <td nowrap> <p>&nbsp;</p></td>
1140
                  <td nowrap>&nbsp;</td>
1141
               </tr>
1142
            </table>
1143
         </td>
1144
      </tr>
1145
      <tr>
1146
         <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
1147
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
1148
      </tr>
1149
   </table>
1150
   <input type="hidden" name="pv_id"   id="pv_id"   value="<%=parPv_id%>">
1151
   <input type="hidden" name="rtag_id" id="rtag_id" value="<%=parRtag_id%>">
1152
   <input type="hidden" name="vcs_tag" id="vcs_tag" value="<%=parVCSTag%>">
1153
   <input type="hidden" name="bs_name" id="bs_name" value="<%=parBSName%>">
119 ghuddy 1154
</form>
1155
</body>
1156
</html>
1157
<%
1158
'------------- RUN AFTER PAGE RENDER ---------------
1159
Set objFormCollector = Nothing
1160
'---------------------------------------------------
1161
%>
1162
 
1163
<!-- DESTRUCTOR ------->
1164
<!--#include file="common/destructor.asp"-->