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