Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

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