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