Subversion Repositories DevTools

Rev

Rev 3844 | Details | Compare with Previous | 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'
3610 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 = _
3610 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
3610 dpurdie 138
      get_subversion_vcs_type_id = rsTemp("vcs_type_id")
129 ghuddy 139
   Else
3610 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
3610 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
 
3610 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.
3610 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 &_
3610 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
3844 dpurdie 415
      rsTemp.Fields("pkg_label").Value = SSLabel
129 ghuddy 416
      rsTemp.Fields("src_path").Value = SSPath
417
   End If
119 ghuddy 418
 
129 ghuddy 419
   ' Update non-build critical sections
420
   rsTemp.Fields("pv_description").Value = SSdesc
421
   rsTemp.Fields("pv_overview").Value = SSoverview
119 ghuddy 422
 
129 ghuddy 423
   If NNdeployable = "1" Then
424
      rsTemp.Fields("is_deployable").Value = "Y"
425
   Else
426
      rsTemp.Fields("is_deployable").Value = NULL
427
   End If
119 ghuddy 428
 
129 ghuddy 429
   rsTemp.Update
119 ghuddy 430
 
129 ghuddy 431
   rsTemp.Close
432
   Set rsTemp = nothing
433
 
434
   ' Only update build critical sections if allowed
435
   If criticalSectionIsEditable Then
436
 
437
      ' Update the VCS if necessary for this PV_ID
438
      Call UpdateVCS( NNpv_id, objFormCollector.Item("vcs_type_id"), objFormCollector.Item("vcs_name"), objFormCollector.Item("vcs_tag") )
439
 
440
      ' Update the build standard if necessary for this PV_ID
441
      Call UpdateBuildStandard( NNpv_id, objFormCollector.Item("bs_name") )
442
 
443
      ' Update the 'is build_env_required' flag for this PV_ID
444
      Call UpdateIsBuildEnvRequired( NNpv_id, objFormCollector.Item("bs_name") )
445
 
446
      ' Update the package_build_info table for this PV_ID
447
      Call UpdatePackageBuildInfo( NNpv_id )
448
   End If
449
End Sub
119 ghuddy 450
'----------------------------------------------------------------------------------------------------------------------
451
Function ShowHideBuildType( sBuildEnvChecked )
452
 
129 ghuddy 453
   ShowHideBuildType = "style='display:none;'"
119 ghuddy 454
 
129 ghuddy 455
   If (sBuildEnvChecked <> "") Then
456
      ShowHideBuildType = "style='display:block;'"
457
   End If
119 ghuddy 458
 
459
End Function
460
'----------------------------------------------------------------------------------------------------------------------
129 ghuddy 461
' 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 462
Sub RenderBuildTypeCombo( nBuildAddendum, nBuildMachine, nBuildStandard )
463
 
129 ghuddy 464
   Query_String = "SELECT * FROM build_standards_addendum WHERE bs_id ="& nBuildStandard & " ORDER BY bsa_id DESC"
119 ghuddy 465
 
129 ghuddy 466
   Response.Write "<select name='build_type_comb_"& nBuildMachine &"' class='form_item'"& disableCriticalSectionEdit &">"
119 ghuddy 467
 
129 ghuddy 468
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
469
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
119 ghuddy 470
 
129 ghuddy 471
   If nBuildAddendum = rsTemp.Fields("bsa_id") Then
472
      Response.write "<option value='"& rsTemp.Fields("bsa_id") &"' selected>"& rsTemp.Fields("bsa_name") &"</option>"
473
   Else
474
      Response.write "<option value='"& rsTemp.Fields("bsa_id") &"'>"& rsTemp.Fields("bsa_name") &"</option>"
475
   End If
476
   rsTemp.MoveNext
477
   WEnd
478
   Response.Write "</select>"
119 ghuddy 479
 
129 ghuddy 480
   rsTemp.Close()
481
   Set rsTemp = nothing
482
End Sub
483
'----------------------------------------------------------------------------------------------------------------------
484
' Renders the HTML for the Version Control Settings drop down list box
485
Sub RenderVCSCombo(nTag)
119 ghuddy 486
 
3610 dpurdie 487
   If IsNull(nTag) OR nTag = "" Then
488
    nTag = enum_VCS_SUBVERSION_TAG
489
   End If
490
 
129 ghuddy 491
   Query_String = "SELECT * FROM vcs_type ORDER BY name"
119 ghuddy 492
 
129 ghuddy 493
   Response.Write "<select id='vcs_name_combo' name='vcs_name_combo' class='form_item' "& disableCriticalSectionEdit &" onchange='vcs_changed();'>"
494
 
495
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
496
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
497
 
498
      If nTag = rsTemp.Fields("tag") Then
499
         Response.write "<option value='"& rsTemp.Fields("name") &"' selected>"& rsTemp.Fields("name") &"</option>"
500
      Else
501
         ' Add item to drop down only if it is not UC (uncontrolled). If it is UC, then only add it if the package
502
         ' version is a manual build type. It is not valid to allow autobuild packages to be uncontrolled (ie. the
503
         ' build (daemon) tool needs a label or something doesn't it?)
504
         If rsTemp.Fields("tag") <> enum_VCS_UNCONTROLLED_TAG OR objFormCollector.Item("build_type") = "M" Then
505
            Response.write "<option value='"& rsTemp.Fields("name") &"'>"& rsTemp.Fields("name") &"</option>"
506
         End If
507
      End If
508
      rsTemp.MoveNext
509
   WEnd
510
   Response.Write "</select>"
511
 
512
   ' Create a hidden combo containing tags instead of names - we can use this to get a tag for a name without
513
   ' doing a database query
514
   Response.Write "<td nowrap background='images/bg_form_lightbluedark.gif'><div id='div_vcs_tag_combo' name='div_vcs_tag_combo' style='visibility:hidden'   >"
515
   Response.Write "<select id='vcs_tag_combo' name='vcs_tag_combo' disabled hidden  class='form_item' "& disableCriticalSectionEdit &">"
516
   rsTemp.MoveFirst
517
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
518
      Response.write "<option value='"& rsTemp.Fields("tag") &"'>"& rsTemp.Fields("tag") &"</option>"
519
      rsTemp.MoveNext
520
   WEnd
521
   Response.Write "</select>"
522
   Response.Write "</div></td>"
523
 
524
   rsTemp.Close()
525
   Set rsTemp = nothing
119 ghuddy 526
End Sub
527
'----------------------------------------------------------------------------------------------------------------------
129 ghuddy 528
' Renders the HTML for the build standard drop down list box
529
'
530
' Typically, this drop down would contain ANT, JATS, and NONE, although ofcoarse this is dependant upon what data is
531
' present in the build_standards table of the database
532
Sub RenderBldStdCombo(nBldStdName)
533
 
534
   Query_String = "SELECT * FROM build_standards"
535
 
536
   Response.Write "<select id='bld_std_combo' name='bld_std_combo' class='form_item' "& disableCriticalSectionEdit &" onchange='bld_std_changed();'>"
537
 
538
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
539
   While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
540
 
541
      If nBldStdName = rsTemp.Fields("bs_name") Then
542
         Response.write "<option value='"& rsTemp.Fields("bs_name") &"' selected>"& rsTemp.Fields("bs_name") &"</option>"
543
      Else
544
         Response.write "<option value='"& rsTemp.Fields("bs_name") &"'>"& rsTemp.Fields("bs_name") &"</option>"
545
      End If
546
      rsTemp.MoveNext
547
   WEnd
548
   Response.Write "</select>"
549
   Response.Write "<td nowrap background='images/bg_form_lightbluedark.gif'>&nbsp;</td>"
550
 
551
   rsTemp.Close()
552
   Set rsTemp = nothing
553
End Sub
554
'----------------------------------------------------------------------------------------------------------------------
555
' Figures out what the url should be for when the form is submitted, ensuring that all of the paramters are present if
556
' need be. Note that the VCS and BSName parameters are optional. They will only be present if the user has made modifications
557
' to the respective drop down list boxes before submitting the form.
558
Sub Determine_submit_action_url ()
559
   ' Work out what the reload url should be for when the user hits the submit button
560
   If IsNull(parVCSTag) OR parVCSTag = "" Then
561
      If IsNull(parBSName) OR parBSName = "" Then
562
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id
563
      Else
564
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&bs_name=" & parBSName
565
      End If
566
   Else
567
      If IsNull(parBSName) OR parBSName = "" Then
568
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag
569
      Else
570
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag & "&bs_name=" & parBSName
571
      End If
572
   End If
573
End Sub
574
'----------------------------------------------------------------------------------------------------------------------
575
' This subroutine sets up the on_submit_validation string to be used in the form tag to validate certain fields
576
' in client-side javascript when a user tries to submit the form
577
Sub Determine_On_Submit_Validation
578
   on_submit_validation = ""
1372 dpurdie 579
   Dim args
129 ghuddy 580
 
581
   If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then
582
      ' Do clearcase path + label validation
1372 dpurdie 583
      args = "'FRlabel','Label','RisCCLabel','FRpath','Source Path','RisCCPath'"
129 ghuddy 584
   ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then
585
      ' Do subversion tag validation
1372 dpurdie 586
      args = "'FRpath','Source Path','RisSVNPath'"
587
      args = args & ",'FRlabel','Subversion Tag','RisSVNTag'"
588
      If (objFormCollector.Item("build_type") = "M" ) Then
589
          args = args & ",'FRlabel','Subversion Tag','RisSVNPegTag'"
590
      End If
129 ghuddy 591
   End If
1372 dpurdie 592
   on_submit_validation = "onSubmit=""MM_validateForm(" & args & "); return document.MM_returnValue"""
129 ghuddy 593
 
594
End Sub
595
'----------------------------------------------------------------------------------------------------------------------
596
' This function obtains a BM_ID (build machine ID) from a buidl machine name by querrying the database
597
Function Get_BM_ID_for_BM_Name(nBm_Name)
598
   Dim rsTemp, Query_String
599
 
600
   Get_BM_ID_for_BM_Name = ""
601
 
602
   Query_String = "SELECT bm_id FROM build_machines bm WHERE bm.bm_name = '" & nBm_Name & "'"
603
 
604
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
605
 
606
   Get_BM_ID_for_BM_Name = ""
607
 
608
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
609
      Get_BM_ID_for_BM_Name = rsTemp("bm_id")
610
   End If
611
 
612
End Function
613
'----------------------------------------------------------------------------------------------------------------------
119 ghuddy 614
Function GetRowColor( sRowColor )
129 ghuddy 615
   If sRowColor = "#FFFFFF" Then
616
      GetRowColor = "#F5F5F5"
617
   Else
618
      GetRowColor = "#FFFFFF"
619
   End If
119 ghuddy 620
End Function
129 ghuddy 621
'----------------------------------------------------------------------------------------------------------------------
119 ghuddy 622
%>
623
<%
624
'------------------------------- RUN BEFORE PAGE RENDER ----------------------------
129 ghuddy 625
 
626
Call LoadFieldRules ( "'FRlabel','FRpath','pv_description','pv_overview','be_id_list'", objForm )      ' Load Validation Rules
119 ghuddy 627
Call Get_Form_Details( parPv_id, objFormCollector )
628
 
629
 
630
 
129 ghuddy 631
'--- From Validation Rule Changes ----
119 ghuddy 632
 
1339 dpurdie 633
' Dont need the label if the package version is uncontrolled
634
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
129 ghuddy 635
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
636
End If
119 ghuddy 637
 
129 ghuddy 638
' Dont need the path if the package version is uncontrolled
639
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
640
   objForm.UpdateRules ("id='FRpath' IsRequired='N'")
119 ghuddy 641
End If
642
 
129 ghuddy 643
' Dont need the build environment if the is_build_env_required is "N"
644
If objFormCollector.Item("is_build_env_required") = "N" Then
645
   objForm.UpdateRules ("id='be_id_list' IsRequired='N'")
119 ghuddy 646
End If
647
 
648
 
129 ghuddy 649
 
119 ghuddy 650
'--- Access Control Setup ------------
651
pageIsEditable = Is_Page_Editable ( objFormCollector.Item ("dlocked") )
652
criticalSectionIsEditable = Is_Critical_Section_Editable ( objFormCollector.Item("dlocked") )
191 brianf 653
isWIP = PackageExists(parRtag_id,parPv_id,"work_in_progress")
119 ghuddy 654
 
655
If criticalSectionIsEditable then
129 ghuddy 656
   disableCriticalSectionEdit = ""
119 ghuddy 657
Else
129 ghuddy 658
   disableCriticalSectionEdit = "disabled"
119 ghuddy 659
End If
660
 
129 ghuddy 661
' Disable "Required" warnings for fields that cannot be edited by the current user at this time
662
If NOT criticalSectionIsEditable Then
663
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
664
   objForm.UpdateRules ("id='FRpath' IsRequired='N'")
665
   objForm.UpdateRules ("id='be_id_list' IsRequired='N'")
666
End If
119 ghuddy 667
 
129 ghuddy 668
 
119 ghuddy 669
'--- Process Submission ---------------
670
 
129 ghuddy 671
If objForm.IsPostBack Then
672
   ' use of the drop down lists or the submit button gets us in here
119 ghuddy 673
 
129 ghuddy 674
   If objForm.IsValidOnPostBack Then
675
      ' only get here if the form is valid
119 ghuddy 676
 
129 ghuddy 677
      ' has the user pressed the submit button?
678
      If Request("btn") = "Submit" Then
119 ghuddy 679
 
129 ghuddy 680
         If objFormCollector.Item("build_type") = "A" AND UCase(objFormCollector.Item("bs_name")) = "NONE" Then
119 ghuddy 681
 
129 ghuddy 682
            Call MessageBox_Need_A_BuildStandard()
119 ghuddy 683
 
129 ghuddy 684
         Else
119 ghuddy 685
 
129 ghuddy 686
            Dim aBuildEnvList, nBuildEnv, display
687
            display = false
688
 
689
            If UCase(objFormCollector.Item("bs_name")) <> "NONE" Then
690
               ' Check for mutual exclusivity rules on the build standard addendum items
691
               aBuildEnvList = Split( Replace( Request("be_id_list"), " ", "" ) , ",")
692
 
693
               ' If >1 build machine items have been selected....
694
               If UBound(aBuildEnvList) > 0 Then
695
                  Dim bm_id_generic
696
                  bm_id_generic = Get_BM_ID_for_BM_Name("Generic")
697
 
698
                  ' If one of the selected build mnachines is "Generic" then we have a mutual exclusivity violation
699
                  For Each nBuildEnv In aBuildEnvList
700
                     If nBuildEnv = bm_id_generic Then
701
                        display = true
702
                     End If
703
                  Next
704
               End If
705
            End If
706
 
707
            If display then
708
               Call MessageBox_BM_Exclusivity()
709
            Else
710
               Call Update_Pkg_Info ( parPv_id, QStrPar("FRdeployable"), QStrPar("FRlabel"), QStrPar("FRpath"), QStrPar("pv_description"), QStrPar("pv_overview") )
711
               Call OpenInParentWindow ( "fixed_issues.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&hidenv=true" )
712
               Call CloseWindow
713
            End If
714
 
715
         End If
716
 
717
 
718
      Else
719
         ' We come through here when a user modifies the VCS or Build Standard drop down list settings
720
         ' We must stay in the form. There is nothing to do yet. The user may not have finished making their edits yet.
721
      End If
722
   Else
723
      ' The form is still invalid but we only want to issue the warning message if the user pressed the submit button
724
      If Request("btn") = "Submit" Then
725
         Call MessageBox_RequiredFieldsEmpty()
726
      End If
727
   End If
119 ghuddy 728
End If
129 ghuddy 729
 
730
' Determine the URL to use when and if this form is refreshed using F5, or when a user changes the
731
' values in one of the drop down lists and the form is reloaded with additional or changed parameters
732
' The html form will use the result of this in its action tag.
733
Call Determine_submit_action_url()
734
 
735
Call Determine_On_Submit_Validation()
736
 
119 ghuddy 737
'--------------------------------------------------------------------------------------------
738
%>
739
<html>
740
<head>
741
<title>Release Manager</title>
742
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
743
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
744
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
745
<link rel="stylesheet" href="images/navigation.css" type="text/css">
746
<script language="JavaScript" src="images/common.js"></script>
747
<!-- TIPS -->
748
<script language="JavaScript" src="images/tipster.js"></script>
749
<script language="JavaScript" src="images/_help_tips.js"></script>
750
<script language="JavaScript" type="text/javascript">
751
<!--
752
 
129 ghuddy 753
// This function is the onchange event handler for the Version Control System drop down list box.
754
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
755
// and submit the form using the updated URL.
756
function vcs_changed() {
757
   var f = document.getElementById('pkginfo');
758
   if (f == null) {
759
      alert('Javascript Error : Failed to get pkginfo');
760
   }
761
   else {
119 ghuddy 762
 
129 ghuddy 763
      var nc = document.getElementById('vcs_name_combo');
764
      if (nc == null) {
765
         alert('Javascript Error : Failed to get vcs_name_combo');
766
      }
767
      else {
768
         var tc = document.getElementById('vcs_tag_combo');
769
         if (tc == null) {
770
            alert('Javascript Error : Failed to get vcs_tag_combo');
771
         }
772
         else {
773
            // Form the new URL with the updated VCS tag passed as a parameter
139 ghuddy 774
            var tc2 = document.getElementById('vcs_name_combo');
775
            if (tc2.options[nc.selectedIndex].value == 'Concurrent Versions System')
776
            {
777
               alert('The Concurrent Versions System (CVS) is not fully supported by ERG.\n' +
778
                     'This means you will have to manually build this package.\n' +
151 ghuddy 779
                     'Please ensure you assign the version number manually, if that is not already so.\n');
139 ghuddy 780
            }
129 ghuddy 781
            <%If IsNull(parBSName) OR parBSName = "" Then%>
782
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
783
            <%Else%>
784
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=<%=parBSName%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
785
            <%End If%>
786
 
787
            f.submit();
788
         }
789
      }
790
   }
119 ghuddy 791
}
129 ghuddy 792
 
793
// This function is the onchange event handler for the Build Standard drop down list box.
794
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
795
// and submit the form using the updated URL.
796
function bld_std_changed() {
797
   var f = document.getElementById('pkginfo');
798
   if (f == null) {
799
      alert('Javascript Error : Failed to get pkginfo');
800
   }
801
   else {
802
      var nc = document.getElementById('bld_std_combo');
803
      if (nc == null) {
804
         alert('Javascript Error : Failed to get bld_std_combo');
805
      }
806
      else {
807
         // Form the new URL with the updated build standard name passed as a parameter
808
         <%If IsNull(parVCSTag) OR parVCSTag = "" Then%>
809
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=" + nc.options[nc.selectedIndex].value;
810
         <%Else%>
811
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=<%=parVCSTag%>&bs_name=" + nc.options[nc.selectedIndex].value;
812
         <%End If%>
813
 
814
         f.submit();
815
      }
816
   }
817
}
818
 
819
// This function will replace back slashes with forward slashes and can be used with an onchange event on fields
820
// where back slashes may be entered
821
function replace_back_slashes(e) {
1339 dpurdie 822
   strip_whitespace(e);
129 ghuddy 823
   var str = e.value;
824
   e.value = str.replace(/\\/g,"/");
825
}
826
 
1339 dpurdie 827
function strip_whitespace(e) {
828
   var str = e.value;
829
   str = str.replace(/^\s+/,"");
830
   e.value =  str.replace(/\s+$/,"");
831
}
832
 
119 ghuddy 833
//-->
834
</script>
835
</head>
836
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
837
<!-- TIPS LAYERS -------------------------------------->
838
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
839
<!----------------------------------------------------->
129 ghuddy 840
<form id="pkginfo" name="pkginfo" method="post" <%=on_submit_validation%> action="<%=submit_action_url%>">
841
   <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
842
      <tr>
843
         <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>
844
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Package Information </td>
845
         <td background="images/lbox_bg_blue.gif" align="right" width="50%">
846
            <input type="submit" name="btn" value="Submit" <%If pageIsEditable Then%>class="form_btn_comp"<%Else%>disabled class="form_btn_comp_disabled"<%End If%>>
847
            <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
848
         </td>
849
         <td background="images/lbox_bg_blue.gif" align="right" width="1%" nowrap>
850
         <img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
851
      </tr>
119 ghuddy 852
 
129 ghuddy 853
      <tr>
854
         <td height="100%" width="1%">&nbsp;</td>
855
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
856
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
857
               <tr>
858
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
859
                  <td width="1%" nowrap class="form_group" valign="bottom"></td>
860
                  <td nowrap width="1%">&nbsp; </td>
861
                  <td nowrap width="100%">&nbsp;</td>
862
               </tr>
863
               <tr>
864
                  <td>&nbsp;</td>
865
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
866
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objFormCollector.Item("pkg_name") &" "& objFormCollector.Item("pkg_version")%></td>
867
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
868
               </tr>
869
               <tr>
870
                  <td>&nbsp;</td>
871
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Deployable?<%=Quick_Help ( "deployable" )%></td>
872
                  <%
873
                  FRdeployableYES = ""
874
                  FRdeployableNO = ""
119 ghuddy 875
 
129 ghuddy 876
                  If objForm.IsPostBack Then
877
                     If Request("FRdeployable") = "1" Then
878
                        FRdeployableYES = "checked"
879
                     Else
880
                        FRdeployableNO = "checked"
881
                     End If
119 ghuddy 882
 
129 ghuddy 883
                  Else
884
                     If objFormCollector.Item("is_deployable") = enumDB_YES Then
885
                        FRdeployableYES = "checked"
886
                     Else
887
                        FRdeployableNO = "checked"
888
                     End If
119 ghuddy 889
 
129 ghuddy 890
                  End If
891
                  %>
892
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">Yes<input name="FRdeployable" type="radio" value="1" <%=FRdeployableYES%>>
893
                  &nbsp;&nbsp;No<input name="FRdeployable" type="radio" value="0" <%=FRdeployableNO%>></td>
894
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
895
               </tr>
896
               <tr>
897
                  <td>&nbsp;</td>
898
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Version Control System</td>
899
                  <td nowrap background="images/bg_form_lightbluedark.gif">
900
                     <% Call RenderVCSCombo(objFormCollector.Item("vcs_tag"))%>
901
                  </td>
902
               </tr>
119 ghuddy 903
 
3882 dpurdie 904
               <!--- Source Path ---------------------------------------------->
129 ghuddy 905
               <%If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then%>
1339 dpurdie 906
 
129 ghuddy 907
                  <tr>
908
                     <td>&nbsp;</td>
1339 dpurdie 909
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
910
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
911
                        <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">
912
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs <br>
913
                     </td>
914
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
915
                  </tr>
916
 
917
                  <tr>
918
                     <td>&nbsp;</td>
129 ghuddy 919
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
920
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
921
                        <%
922
                        sLabelReadOnly = ""
923
                        sDefaultLabel = Default_Label(parPv_id, objFormCollector.Item("build_type"), objFormCollector.Item("pkg_name"), objFormCollector.Item("pkg_version"), objFormCollector.Item("v_ext"))
119 ghuddy 924
 
129 ghuddy 925
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
926
                           sLabelReadOnly = "readonly"
927
                        End If
119 ghuddy 928
 
129 ghuddy 929
                        If objForm.IsPostBack Then
930
                           sLabel = Request("FRlabel")
119 ghuddy 931
 
129 ghuddy 932
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
933
                           ' 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.
934
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
935
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
936
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
937
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
938
                           If IsNull(sLabel) OR sLabel = "" Then
939
                              sLabel = sDefaultLabel
940
                              objForm.SetValueForced "FRlabel", sLabel
941
                           End If
942
                        Else
943
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
944
                              sLabel = "N/A"
945
                           Else
946
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
947
                                 sLabel = sDefaultLabel
948
                              Else
949
                                 sLabel = objFormCollector.Item("pkg_label")
950
                              End If
951
                              objForm.SetValue "FRlabel", sLabel
952
                           End If
953
                        End If
954
                        %>
1339 dpurdie 955
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
956
                        <br>&nbsp;Example: core_cs_1.0.0000.cr<br>
129 ghuddy 957
                     </td>
958
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
959
                  </tr>
1339 dpurdie 960
 
129 ghuddy 961
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then%>
962
                  <tr>
963
                     <td>&nbsp;</td>
1339 dpurdie 964
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "svn_source_path" )%></td>
129 ghuddy 965
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
966
                        <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">
1339 dpurdie 967
                        <br>&nbsp;Example: AUPERASVN01/RepoName/myPackage/trunk<br>
129 ghuddy 968
                     </td>
969
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
970
                  </tr>
191 brianf 971
                  <tr>
972
                     <td>&nbsp;</td>
1339 dpurdie 973
                     <td nowrap valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Tag<%=Quick_Help ( "svn_tag" )%></td>
191 brianf 974
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
975
                        <%
976
                        sLabelReadOnly = ""
977
                        sDefaultLabel = Default_Label(parPv_id, objFormCollector.Item("build_type"), objFormCollector.Item("pkg_name"), objFormCollector.Item("pkg_version"), objFormCollector.Item("v_ext"))
978
 
979
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
980
                           sLabelReadOnly = "readonly"
981
                        End If
982
 
983
                        If objForm.IsPostBack Then
984
                           sLabel = Request("FRlabel")
985
 
986
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
987
                           ' 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.
988
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
989
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
990
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
991
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
992
                           If IsNull(sLabel) OR sLabel = "" Then
993
                              sLabel = sDefaultLabel
994
                              objForm.SetValueForced "FRlabel", sLabel
995
                           End If
996
                        Else
997
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
998
                              sLabel = "N/A"
999
                           Else
1000
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
1001
                                 sLabel = sDefaultLabel
1002
                              Else
1003
                                 sLabel = objFormCollector.Item("pkg_label")
1004
                              End If
1005
                              objForm.SetValue "FRlabel", sLabel
1006
                           End If
1007
                        End If
1008
                        %>
1339 dpurdie 1009
 
1010
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
1372 dpurdie 1011
                        <%
1012
                        If objFormCollector.Item("build_type") = "M" Then
1013
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>@1234<br> <%
1014
                        Else
1015
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>[@1234]<br> <%
1016
                        End If
1017
                        %>
191 brianf 1018
                     </td>
1019
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
1020
                  </tr>
1339 dpurdie 1021
 
139 ghuddy 1022
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then%>
1023
                  <tr>
1024
                     <td>&nbsp;</td>
1339 dpurdie 1025
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
139 ghuddy 1026
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1339 dpurdie 1027
                        <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">
1028
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs<br>
139 ghuddy 1029
                     </td>
1339 dpurdie 1030
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
139 ghuddy 1031
                  </tr>
1339 dpurdie 1032
 
139 ghuddy 1033
                  <tr>
1034
                     <td>&nbsp;</td>
1339 dpurdie 1035
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
139 ghuddy 1036
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1339 dpurdie 1037
                        <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 1038
                     </td>
1339 dpurdie 1039
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
139 ghuddy 1040
                  </tr>
1339 dpurdie 1041
 
129 ghuddy 1042
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then%>
1339 dpurdie 1043
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
129 ghuddy 1044
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1045
               <%Else%>
1046
                  <tr>
1047
                     <td>&nbsp;</td>
1048
                     <td colspan=3 background="images/bg_form_lightbluedark.gif" class="sublbox_txt">
1049
                        <span class='err_alert'><b>WARNING:</b> Release Manager Website does not currently support the selected Version Control System</span>
1050
                     </td>
1051
                  </tr>
1339 dpurdie 1052
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
129 ghuddy 1053
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1054
               <%End If%>
119 ghuddy 1055
 
129 ghuddy 1056
               <tr>
1057
                  <td>&nbsp;</td>
1058
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Short Package Description<%=Quick_Help ( "pkg_info_short_desc" )%></td>
1059
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1060
                     <textarea name="pv_description" cols="57" rows="5" class="form_item" id="pv_description"><%=objForm.GetValue( "pv_description", objFormCollector.Item("pv_description") )%></textarea>
1061
                  </td>
1062
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_description")%></td>
1063
               </tr>
1064
               <tr>
1065
                  <td>&nbsp;</td>
1066
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Package Overview<%=Quick_Help ( "pkg_info_overview" )%></td>
1067
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1068
                     <textarea name="pv_overview" cols="57" rows="10" class="form_item" id="pv_overview"><%=objForm.GetValue( "pv_overview", objFormCollector.Item("pv_overview") )%></textarea>
1069
                  </td>
1070
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_overview")%></td>
1071
               </tr>
119 ghuddy 1072
 
129 ghuddy 1073
               <tr>
1074
                  <td>&nbsp;</td>
1075
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Standard</td>
1076
                  <td nowrap background="images/bg_form_lightbluedark.gif">
1077
                     <% Call RenderBldStdCombo(objFormCollector.Item("bs_name"))%>
1078
                  </td>
1079
               </tr>
119 ghuddy 1080
 
129 ghuddy 1081
               <tr>
1082
                  <td>&nbsp;</td>
1083
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Environment<%=Quick_Help ( "build_environment" )%></td>
1084
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1085
                     <%If objFormCollector.Item("is_build_env_required") = "N" Then%>
1086
                        &nbsp;Build Environment not applicable
1087
                     <%End If%>
119 ghuddy 1088
 
129 ghuddy 1089
                     <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%>">
1090
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
1091
                           <tr>
1092
                              <td bgcolor="#FFFFFF">
1093
                                 <table width="100%" border="0" cellspacing="0" cellpadding="3">
1094
                                    <%
1095
                                    OraDatabase.Parameters.Add "PV_ID",    parPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 1096
 
129 ghuddy 1097
                                    query = _
1098
                                    " SELECT DECODE ( pkgbinfo.BM_ID,"&_
1099
                                    "                    bm.BM_ID, 'checked',"&_
1100
                                    "            NULL ) AS checked,"&_
1101
                                    "      bm.BM_ID,"&_
1102
                                    "      bm.BM_NAME, "&_
1103
                                    "      pkgbinfo.BSA_ID"&_
1104
                                    "  FROM BUILD_MACHINES bm,"&_
1105
                                    "        PACKAGE_BUILD_INFO pkgbinfo"&_
1106
                                    " WHERE pkgbinfo.BM_ID (+)= bm.BM_ID"&_
1107
                                    "   AND pkgbinfo.PV_ID (+)= :PV_ID"&_
1108
                                    " ORDER BY UPPER(bm.bm_name) "
119 ghuddy 1109
 
1110
 
129 ghuddy 1111
                                    Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
1112
                                    Dim rowColor
119 ghuddy 1113
 
129 ghuddy 1114
                                    rowColor = "#F5F5F5"
119 ghuddy 1115
 
129 ghuddy 1116
                                    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
1117
                                       checked = ""
1118
                                       If objForm.IsTicked( "be_id_list", rsQry("bm_id"), rsQry("checked") ) Then
1119
                                          checked = "checked"
1120
                                          objForm.SetValue "be_id_list", checked
1121
                                       End If
119 ghuddy 1122
 
129 ghuddy 1123
                                       rowColor = GetRowColor( rowColor )
1124
                                       %>
1125
                                       <tr>
1126
                                          <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>
1127
                                          <td nowrap class="form_txt" bgcolor="<%=rowColor%>"><%=rsQry("bm_name")%></td>
1128
                                          <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>
1129
                                          <%If checked = "checked" AND rsQry("bsa_id") = 0 Then%>
1130
                                             <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>
1131
                                          <%End If%>
1132
                                       </tr>
1133
                                       <%rsQry.MoveNext
1134
                                    WEnd
119 ghuddy 1135
 
129 ghuddy 1136
                                    rsQry.Close
1137
                                    Set rsQry = Nothing
1138
 
1139
                                    OraDatabase.Parameters.Remove "PV_ID"
1140
                                    %>
1141
                                    <tr>
1142
                                       <td width="1"></td>
1143
                                       <td width="1"></td>
1144
                                       <td width="100%"></td>
1145
                                    </tr>
1146
                                 </table>
1147
                              </td>
1148
                           </tr>
1149
                        </table>
1150
                     </div>
1151
                  </td>
1152
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate("be_id_list")%></td>
1153
               </tr>
1154
               <tr>
1155
                  <td>&nbsp;</td>
1156
                  <td nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
1157
                  <td nowrap> <p>&nbsp;</p></td>
1158
                  <td nowrap>&nbsp;</td>
1159
               </tr>
1160
            </table>
1161
         </td>
1162
      </tr>
1163
      <tr>
1164
         <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
1165
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
1166
      </tr>
1167
   </table>
1168
   <input type="hidden" name="pv_id"   id="pv_id"   value="<%=parPv_id%>">
1169
   <input type="hidden" name="rtag_id" id="rtag_id" value="<%=parRtag_id%>">
1170
   <input type="hidden" name="vcs_tag" id="vcs_tag" value="<%=parVCSTag%>">
1171
   <input type="hidden" name="bs_name" id="bs_name" value="<%=parBSName%>">
119 ghuddy 1172
</form>
1173
</body>
1174
</html>
1175
<%
1176
'------------- RUN AFTER PAGE RENDER ---------------
1177
Set objFormCollector = Nothing
1178
'---------------------------------------------------
1179
%>
1180
 
1181
<!-- DESTRUCTOR ------->
1182
<!--#include file="common/destructor.asp"-->