Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
Option explicit
4
Response.Expires = 0   ' always load the page, dont store
5
%>
6
<%
7
'=====================================================
8
'               Package Information
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
36
Dim Query_String
37
Dim parVCSTag
38
Dim parBSName
39
Dim submit_action_url
40
Dim on_submit_validation
41
Dim sDefaultLabel, sLabel, sLabelReadOnly
42
Dim isWIP
43
'------------ Constants Declaration -----------
44
'------------ Variable Init -------------------
45
Set objFormCollector = CreateObject("Scripting.Dictionary")
46
parPv_id = QStrPar("pv_id")
47
parVCSTag = QStrPar("vcs_tag")
48
parBSName = QStrPar("bs_name")
49
'----------------------------------------------
50
%>
51
<%
52
Sub MessageBox_BM_Exclusivity()
53
%><script language="Javascript">
54
alert("You cannot select Generic with other BUILD MACHINE options!")
55
history.reload()
56
 
57
</script>
58
<%
59
End Sub
60
 
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
 
66
</script>
67
<%
68
End Sub
69
 
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()
74
 
75
</script>
76
<%
77
End Sub
78
 
79
 
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
84
 
85
   bs_name_from_bs_id = "NONE"
86
 
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
99
 
100
   bs_id_from_bs_name = 0
101
 
102
   Query_String = " SELECT * FROM build_standards WHERE bs_name = '"& nBs_Name &"'"
103
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
104
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
105
      bs_id_from_bs_name = rsTemp("bs_id")
106
   End If
107
End Function
108
'----------------------------------------------------------------------------------------------------------------------
109
' Function to get the Version Control System type ID for ClearCase, based on the assumption that the TAG used for
110
' ClearCase is 'CC'
111
'Function get_clearcase_vcs_type_id()
112
'   Dim rsTemp, Query_String
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()
131
   Dim rsTemp, Query_String
132
 
133
   Query_String = _
134
   " SELECT * FROM VCS_TYPE WHERE tag = 'SVN'"
135
 
136
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
137
   If (NOT rsTemp.BOF ) AND (NOT rsTemp.EOF) Then
138
      get_subversion_vcs_type_id = rsTemp("vcs_type_id")
139
   Else
140
      Call RaiseMsg(enum_MSG_ERROR, "Database is missing a VCS setting for Name: Subversion, Tag: SVN")
141
   End If
142
   rsTemp.Close
143
   Set rsTemp = nothing
144
End Function
145
 
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
151
 
152
   Query_String = _
153
   " SELECT * FROM VCS_TYPE WHERE tag = 'UC'"
154
 
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
159
      Call RaiseMsg(enum_MSG_ERROR, "Database is missing a VCS setting for Name: Uncontrolled, Tag: UC")
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
167
 
168
'   Dim CC_vcs_type_id
169
   Dim SVN_vcs_type_id
170
   Dim UC_vcs_type_id
171
 
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.
174
'   CC_vcs_type_id = get_clearcase_vcs_type_id()
175
   SVN_vcs_type_id = get_subversion_vcs_type_id
176
   UC_vcs_type_id = get_uncontrolled_vcs_type_id()
177
 
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.change_type, pv.bs_id, pv.dlocked,"&_
182
   "        (CASE WHEN pkg_label = 'N/A' AND pv.vcs_type_id IS NULL THEN "& UC_vcs_type_id &_
183
   "              WHEN pv.vcs_type_id IS NULL THEN " & SVN_vcs_type_id &_
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
188
 
189
 
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("change_type")           = rsTemp("change_type")
203
      objDetails.Item("bs_id")                 = rsTemp("bs_id")
204
      objDetails.Item("dlocked")               = rsTemp("dlocked")
205
      objDetails.Item("vcs_type_id")           = rsTemp("vcs_type_id")
206
 
207
      rsTemp.Close
208
 
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
218
 
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
225
 
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
234
 
235
   End If
236
 
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
245
 
246
   Query_String = _
247
   " SELECT bs_id, is_build_env_required"&_
248
   " FROM package_versions"&_
249
   " WHERE pv_id = "& nPv_id
250
 
251
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
252
 
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
264
 
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 )
273
 
274
   On Error Resume Next
275
   objEH.TryORA ( OraSession )
276
 
277
   OraDatabase.ExecuteSQL _
278
   "DELETE  FROM PACKAGE_BUILD_INFO WHERE PV_ID ="& nPv_id
279
 
280
   objEH.CatchORA ( OraSession )
281
 
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
290
 
291
   Query_String = _
292
   " SELECT vcs_type_id"&_
293
   " FROM package_versions"&_
294
   " WHERE pv_id = "& nPv_id
295
 
296
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
297
 
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
300
 
301
      'update fields
302
      rsTemp.Edit
303
      rsTemp.Fields("vcs_type_id").Value = nVcs_type_id
304
      rsTemp.Update
305
 
306
      Call Log_Action ( nPv_id, "vcs_type_id_update", "VCS Type ID Update: " & nVcs_name )
307
   End If
308
 
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
319
 
320
   ' get the new bs_id from the bs_name parameter
321
   new_bs_id = bs_id_from_bs_name(nBs_name)
322
 
323
   Query_String = _
324
   " SELECT bs_id, is_build_env_required"&_
325
   " FROM package_versions"&_
326
   " WHERE pv_id = "& nPv_id
327
 
328
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
329
 
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
332
 
333
      'update fields
334
      rsTemp.Edit
335
      rsTemp.Fields("bs_id").Value = new_bs_id
336
 
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
343
 
344
      ' Clear out the build info table of entries for this PV_ID.
345
      Call DeletePackageBuildInfo(nPv_id)
346
 
347
      Call Log_Action ( nPv_id, "build_standard_update", "Build Standard Update: " & nBs_name )
348
   End If
349
 
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
361
 
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 )
366
 
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
370
 
371
   Set OraParameter = OraDatabase.Parameters
372
 
373
   aBuildEnvList = Split( Replace( Request("be_id_list"), " ", "" ) , ",")
374
 
375
   On Error Resume Next
376
   objEH.TryORA ( OraSession )
377
 
378
   For Each nBuildMachine In aBuildEnvList
379
 
380
      OraParameter("BM_ID").Value = nBuildMachine
381
      OraParameter("BSA_ID").Value = Request("build_type_comb_"& nBuildMachine)
382
 
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
388
 
389
   objEH.CatchORA ( OraSession )
390
 
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
401
 
402
   On Error Resume Next
403
 
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
408
 
409
   If SSdesc = "" Then SSdesc = NULL
410
   Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
411
 
412
   rsTemp.Edit
413
 
414
   ' Only update build critical sections (label, source path) if allowed
415
   If criticalSectionIsEditable Then
416
      rsTemp.Fields("pkg_label").Value = SSLabel
417
      rsTemp.Fields("src_path").Value = SSPath
418
   End If
419
 
420
   ' Update non-build critical sections
421
   rsTemp.Fields("pv_description").Value = SSdesc
422
   rsTemp.Fields("pv_overview").Value = SSoverview
423
 
424
   If NNdeployable = "1" Then
425
      rsTemp.Fields("is_deployable").Value = "Y"
426
   Else
427
      rsTemp.Fields("is_deployable").Value = NULL
428
   End If
429
 
430
   rsTemp.Update
431
 
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
451
'----------------------------------------------------------------------------------------------------------------------
452
Function ShowHideBuildType( sBuildEnvChecked )
453
 
454
   ShowHideBuildType = "style='display:none;'"
455
 
456
   If (sBuildEnvChecked <> "") Then
457
      ShowHideBuildType = "style='display:block;'"
458
   End If
459
 
460
End Function
461
'----------------------------------------------------------------------------------------------------------------------
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.
463
Sub RenderBuildTypeCombo( nBuildAddendum, nBuildMachine, nBuildStandard )
464
 
465
   If nBuildStandard <> "" Then
466
       Query_String = "SELECT * FROM build_standards_addendum WHERE bs_id ="& nBuildStandard & " ORDER BY bsa_id DESC"
467
 
468
       'Response.Write Query_String
469
       Response.Write "<select name='build_type_comb_"& nBuildMachine &"' class='form_item'"& disableCriticalSectionEdit &">"
470
 
471
       Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
472
       While (NOT rsTemp.BOF) AND (NOT rsTemp.EOF)
473
 
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
485
   End If
486
End Sub
487
'----------------------------------------------------------------------------------------------------------------------
488
' Renders the HTML for the Version Control Settings drop down list box
489
Sub RenderVCSCombo(nTag)
490
 
491
   If IsNull(nTag) OR nTag = "" Then
492
    nTag = enum_VCS_SUBVERSION_TAG
493
   End If
494
 
495
   Query_String = "SELECT * FROM vcs_type ORDER BY name"
496
 
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
530
End Sub
531
'----------------------------------------------------------------------------------------------------------------------
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 = ""
583
   Dim args
584
 
585
   If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then
586
      ' Do clearcase path + label validation
587
      args = "'FRlabel','Label','RisCCLabel','FRpath','Source Path','RisCCPath'"
588
   ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then
589
      ' Do subversion tag validation
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
595
   End If
596
   args = args & ",'pv_description','Package Description','RminLength:11'"
597
   args = args & ",'pv_overview','Package Overview','RminLength:11'"
598
   on_submit_validation = "onSubmit=""MM_validateForm(" & args & "); return document.MM_returnValue"""
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
'----------------------------------------------------------------------------------------------------------------------
620
Function GetRowColor( sRowColor )
621
   If sRowColor = "#FFFFFF" Then
622
      GetRowColor = "#F5F5F5"
623
   Else
624
      GetRowColor = "#FFFFFF"
625
   End If
626
End Function
627
'----------------------------------------------------------------------------------------------------------------------
628
%>
629
<%
630
'------------------------------- RUN BEFORE PAGE RENDER ----------------------------
631
 
632
Call LoadFieldRules ( "'FRlabel','FRpath','pv_description','pv_overview','be_id_list'", objForm )      ' Load Validation Rules
633
Call Get_Form_Details( parPv_id, objFormCollector )
634
 
635
 
636
 
637
'--- From Validation Rule Changes ----
638
 
639
' Dont need the label if the package version is uncontrolled
640
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
641
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
642
End If
643
 
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'")
647
End If
648
 
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'")
652
End If
653
 
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'")
659
 
660
 
661
 
662
'--- Access Control Setup ------------
663
pageIsEditable = Is_Page_Editable ( objFormCollector.Item ("dlocked") )
664
criticalSectionIsEditable = Is_Critical_Section_Editable ( objFormCollector.Item("dlocked") )
665
isWIP = PackageExists(parRtag_id,parPv_id,"work_in_progress")
666
 
667
If criticalSectionIsEditable then
668
   disableCriticalSectionEdit = ""
669
Else
670
   disableCriticalSectionEdit = "disabled"
671
End If
672
 
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
679
 
680
 
681
'--- Process Submission ---------------
682
 
683
If objForm.IsPostBack Then
684
   ' use of the drop down lists or the submit button gets us in here
685
 
686
   If objForm.IsValidOnPostBack Then
687
      ' only get here if the form is valid
688
 
689
      ' has the user pressed the submit button?
690
      If Request("btn") = "Submit" Then
691
 
692
         If objFormCollector.Item("build_type") = "A" AND UCase(objFormCollector.Item("bs_name")) = "NONE" Then
693
 
694
            Call MessageBox_Need_A_BuildStandard()
695
 
696
         Else
697
 
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
740
End If
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
 
749
'--------------------------------------------------------------------------------------------
750
%>
751
<html>
752
<head>
753
<title>Release Manager</title>
754
<link rel="shortcut icon" href="<%=FavIcon%>"/>
755
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
756
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
757
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
758
<link rel="stylesheet" href="images/navigation.css" type="text/css">
759
<script language="JavaScript" src="images/common.js"></script>
760
<!-- TIPS -->
761
<script language="JavaScript" src="images/tipster.js"></script>
762
<script language="JavaScript" src="images/_help_tips.js"></script>
763
<script language="JavaScript" type="text/javascript">
764
<!--
765
 
766
// This function is the onchange event handler for the Version Control System drop down list box.
767
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
768
// and submit the form using the updated URL.
769
function vcs_changed() {
770
   var f = document.getElementById('pkginfo');
771
   if (f == null) {
772
      alert('Javascript Error : Failed to get pkginfo');
773
   }
774
   else {
775
 
776
      var nc = document.getElementById('vcs_name_combo');
777
      if (nc == null) {
778
         alert('Javascript Error : Failed to get vcs_name_combo');
779
      }
780
      else {
781
         var tc = document.getElementById('vcs_tag_combo');
782
         if (tc == null) {
783
            alert('Javascript Error : Failed to get vcs_tag_combo');
784
         }
785
         else {
786
            // Form the new URL with the updated VCS tag passed as a parameter
787
            var tc2 = document.getElementById('vcs_name_combo');
788
            if (tc2.options[nc.selectedIndex].value == 'Concurrent Versions System')
789
            {
790
               alert('The Concurrent Versions System (CVS) is not fully supported by ERG.\n' +
791
                     'This means you will have to manually build this package.\n' +
792
                     'Please ensure you assign the version number manually, if that is not already so.\n');
793
            }
794
            <%If IsNull(parBSName) OR parBSName = "" Then%>
795
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
796
            <%Else%>
797
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=<%=parBSName%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
798
            <%End If%>
799
 
800
            f.submit();
801
         }
802
      }
803
   }
804
}
805
 
806
// This function is the onchange event handler for the Build Standard drop down list box.
807
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
808
// and submit the form using the updated URL.
809
function bld_std_changed() {
810
   var f = document.getElementById('pkginfo');
811
   if (f == null) {
812
      alert('Javascript Error : Failed to get pkginfo');
813
   }
814
   else {
815
      var nc = document.getElementById('bld_std_combo');
816
      if (nc == null) {
817
         alert('Javascript Error : Failed to get bld_std_combo');
818
      }
819
      else {
820
         // Form the new URL with the updated build standard name passed as a parameter
821
         <%If IsNull(parVCSTag) OR parVCSTag = "" Then%>
822
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=" + nc.options[nc.selectedIndex].value;
823
         <%Else%>
824
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=<%=parVCSTag%>&bs_name=" + nc.options[nc.selectedIndex].value;
825
         <%End If%>
826
 
827
         f.submit();
828
      }
829
   }
830
}
831
 
832
// This function will replace back slashes with forward slashes and can be used with an onchange event on fields
833
// where back slashes may be entered
834
function replace_back_slashes(e) {
835
   strip_whitespace(e);
836
   var str = e.value;
837
   e.value = str.replace(/\\/g,"/");
838
}
839
 
840
function strip_whitespace(e) {
841
   var str = e.value;
842
   str = str.replace(/^\s+/,"");
843
   e.value =  str.replace(/\s+$/,"");
844
}
845
 
846
//-->
847
</script>
848
</head>
849
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
850
<!-- TIPS LAYERS -------------------------------------->
851
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
852
<!----------------------------------------------------->
853
<form id="pkginfo" name="pkginfo" method="post" <%=on_submit_validation%> action="<%=submit_action_url%>">
854
   <table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
855
      <tr>
856
         <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>
857
         <td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl">&nbsp;Package Information </td>
858
         <td background="images/lbox_bg_blue.gif" align="right" width="50%">
859
            <input type="submit" name="btn" value="Submit" <%If pageIsEditable Then%>class="form_btn_comp"<%Else%>disabled class="form_btn_comp_disabled"<%End If%>>
860
            <input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
861
         </td>
862
         <td background="images/lbox_bg_blue.gif" align="right" width="1%" nowrap>
863
         <img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
864
      </tr>
865
 
866
      <tr>
867
         <td height="100%" width="1%">&nbsp;</td>
868
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
869
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
870
               <tr>
871
                  <td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
872
                  <td width="1%" nowrap class="form_group" valign="bottom"></td>
873
                  <td nowrap width="1%">&nbsp; </td>
874
                  <td nowrap width="100%">&nbsp;</td>
875
               </tr>
876
               <tr>
877
                  <td>&nbsp;</td>
878
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
879
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objFormCollector.Item("pkg_name") &" "& objFormCollector.Item("pkg_version")%></td>
880
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
881
               </tr>
882
               <tr>
883
                  <td>&nbsp;</td>
884
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Deployable?<%=Quick_Help ( "deployable" )%></td>
885
                  <%
886
                  FRdeployableYES = ""
887
                  FRdeployableNO = ""
888
 
889
                  If objForm.IsPostBack Then
890
                     If Request("FRdeployable") = "1" Then
891
                        FRdeployableYES = "checked"
892
                     Else
893
                        FRdeployableNO = "checked"
894
                     End If
895
 
896
                  Else
897
                     If objFormCollector.Item("is_deployable") = enumDB_YES Then
898
                        FRdeployableYES = "checked"
899
                     Else
900
                        FRdeployableNO = "checked"
901
                     End If
902
 
903
                  End If
904
                  %>
905
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">Yes<input name="FRdeployable" type="radio" value="1" <%=FRdeployableYES%>>
906
                  &nbsp;&nbsp;No<input name="FRdeployable" type="radio" value="0" <%=FRdeployableNO%>></td>
907
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">&nbsp;</td>
908
               </tr>
909
               <tr>
910
                  <td>&nbsp;</td>
911
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Version Control System</td>
912
                  <td nowrap background="images/bg_form_lightbluedark.gif">
913
                     <% Call RenderVCSCombo(objFormCollector.Item("vcs_tag"))%>
914
                  </td>
915
               </tr>
916
 
917
               <!--- Source Path ---------------------------------------------->
918
               <%If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then%>
919
 
920
                  <tr>
921
                     <td>&nbsp;</td>
922
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
923
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
924
                        <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">
925
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs <br>
926
                     </td>
927
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
928
                  </tr>
929
 
930
                  <tr>
931
                     <td>&nbsp;</td>
932
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
933
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
934
                        <%
935
                        sLabelReadOnly = ""
936
                        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"))
937
 
938
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
939
                           sLabelReadOnly = "readonly"
940
                        End If
941
 
942
                        If objForm.IsPostBack Then
943
                           sLabel = Request("FRlabel")
944
 
945
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
946
                           ' 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.
947
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
948
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
949
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
950
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
951
                           If IsNull(sLabel) OR sLabel = "" Then
952
                              sLabel = sDefaultLabel
953
                              objForm.SetValueForced "FRlabel", sLabel
954
                           End If
955
                        Else
956
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
957
                              sLabel = "N/A"
958
                           Else
959
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
960
                                 sLabel = sDefaultLabel
961
                              Else
962
                                 sLabel = objFormCollector.Item("pkg_label")
963
                              End If
964
                              objForm.SetValue "FRlabel", sLabel
965
                           End If
966
                        End If
967
                        %>
968
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
969
                        <br>&nbsp;Example: core_cs_1.0.0000.cr<br>
970
                     </td>
971
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
972
                  </tr>
973
 
974
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then%>
975
                  <tr>
976
                     <td>&nbsp;</td>
977
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "svn_source_path" )%></td>
978
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
979
                        <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">
980
                        <br>&nbsp;Example: AUPERASVN01/RepoName/myPackage/trunk<br>
981
                     </td>
982
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
983
                  </tr>
984
                  <tr>
985
                     <td>&nbsp;</td>
986
                     <td nowrap valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Tag<%=Quick_Help ( "svn_tag" )%></td>
987
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
988
                        <%
989
                        sLabelReadOnly = ""
990
                        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"))
991
 
992
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
993
                           sLabelReadOnly = "readonly"
994
                        End If
995
 
996
                        If objForm.IsPostBack Then
997
                           sLabel = Request("FRlabel")
998
 
999
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
1000
                           ' 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.
1001
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
1002
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
1003
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
1004
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
1005
                           If IsNull(sLabel) OR sLabel = "" Then
1006
                              sLabel = sDefaultLabel
1007
                              objForm.SetValueForced "FRlabel", sLabel
1008
                           End If
1009
                        Else
1010
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
1011
                              sLabel = "N/A"
1012
                           Else
1013
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
1014
                                 sLabel = sDefaultLabel
1015
                              Else
1016
                                 sLabel = objFormCollector.Item("pkg_label")
1017
                              End If
1018
                              objForm.SetValue "FRlabel", sLabel
1019
                           End If
1020
                        End If
1021
                        %>
1022
 
1023
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
1024
                        <%
1025
                        If objFormCollector.Item("build_type") = "M" Then
1026
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>@1234<br> <%
1027
                        Else
1028
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>[@1234]<br> <%
1029
                        End If
1030
                        %>
1031
                     </td>
1032
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
1033
                  </tr>
1034
 
1035
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then%>
1036
                  <tr>
1037
                     <td>&nbsp;</td>
1038
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
1039
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1040
                        <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">
1041
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs<br>
1042
                     </td>
1043
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRpath")%></td>
1044
                  </tr>
1045
 
1046
                  <tr>
1047
                     <td>&nbsp;</td>
1048
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
1049
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1050
                        <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") )%>" >
1051
                     </td>
1052
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("FRlabel")%></td>
1053
                  </tr>
1054
 
1055
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then%>
1056
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
1057
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1058
               <%Else%>
1059
                  <tr>
1060
                     <td>&nbsp;</td>
1061
                     <td colspan=3 background="images/bg_form_lightbluedark.gif" class="sublbox_txt">
1062
                        <span class='err_alert'><b>WARNING:</b> Release Manager Website does not currently support the selected Version Control System</span>
1063
                     </td>
1064
                  </tr>
1065
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
1066
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1067
               <%End If%>
1068
 
1069
               <tr>
1070
                  <td>&nbsp;</td>
1071
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Short Package Description<%=Quick_Help ( "pkg_info_short_desc" )%></td>
1072
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1073
                     <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>
1074
                  </td>
1075
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_description")%></td>
1076
               </tr>
1077
               <tr>
1078
                  <td>&nbsp;</td>
1079
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Package Overview<%=Quick_Help ( "pkg_info_overview" )%></td>
1080
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1081
                     <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>
1082
                  </td>
1083
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate ("pv_overview")%></td>
1084
               </tr>
1085
 
1086
               <tr>
1087
                  <td>&nbsp;</td>
1088
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Standard</td>
1089
                  <td nowrap background="images/bg_form_lightbluedark.gif">
1090
                     <% Call RenderBldStdCombo(objFormCollector.Item("bs_name"))%>
1091
                  </td>
1092
               </tr>
1093
 
1094
               <tr>
1095
                  <td>&nbsp;</td>
1096
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Environment<%=Quick_Help ( "build_environment" )%></td>
1097
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1098
                     <%If objFormCollector.Item("is_build_env_required") = "N" Then%>
1099
                        &nbsp;Build Environment not applicable
1100
                     <%Else%>
1101
                     <%End If%>
1102
                     <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%>">
1103
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
1104
                           <tr>
1105
                              <td bgcolor="#FFFFFF">
1106
                                 <table width="100%" border="0" cellspacing="0" cellpadding="3">
1107
                                    <%
1108
                                    OraDatabase.Parameters.Add "PV_ID",    parPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER
1109
 
1110
                                    query = _
1111
                                    " SELECT DECODE ( pkgbinfo.BM_ID,"&_
1112
                                    "                    bm.BM_ID, 'checked',"&_
1113
                                    "            NULL ) AS checked,"&_
1114
                                    "      bm.BM_ID,"&_
1115
                                    "      bm.BM_NAME, "&_
1116
                                    "      pkgbinfo.BSA_ID"&_
1117
                                    "  FROM BUILD_MACHINES bm,"&_
1118
                                    "        PACKAGE_BUILD_INFO pkgbinfo"&_
1119
                                    " WHERE pkgbinfo.BM_ID (+)= bm.BM_ID"&_
1120
                                    "   AND pkgbinfo.PV_ID (+)= :PV_ID"&_
1121
                                    " ORDER BY UPPER(bm.bm_name) "
1122
 
1123
 
1124
                                    Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
1125
                                    Dim rowColor
1126
 
1127
                                    rowColor = "#F5F5F5"
1128
 
1129
                                    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
1130
                                       checked = ""
1131
                                       If objForm.IsTicked( "be_id_list", rsQry("bm_id"), rsQry("checked") ) Then
1132
                                          checked = "checked"
1133
                                          objForm.SetValue "be_id_list", checked
1134
                                       End If
1135
 
1136
                                       rowColor = GetRowColor( rowColor )
1137
                                       %>
1138
                                       <tr>
1139
                                          <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>
1140
                                          <td width='1%' nowrap class="form_txt" bgcolor="<%=rowColor%>"><%=rsQry("bm_name")%></td>
1141
                                          <td width='98%' nowrap class="form_txt" bgcolor="<%=rowColor%>">
1142
                                                <div id="build_type_<%=rsQry("bm_id")%>" <%=ShowHideBuildType( checked )%>>
1143
                                                    <% Call RenderBuildTypeCombo( rsQry("bsa_id"), rsQry("bm_id"), objFormCollector.Item("bs_id") )%>
1144
                                                </div>
1145
                                          </td>
1146
                                          <%If checked = "checked" AND rsQry("bsa_id") = 0 Then%>
1147
                                             <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1148
                                             <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>
1149
                                             <td class='val_err'>Required</td></td>
1150
                                          <%End If%>
1151
                                       </tr>
1152
                                       <%rsQry.MoveNext
1153
                                    WEnd
1154
 
1155
                                    rsQry.Close
1156
                                    Set rsQry = Nothing
1157
 
1158
                                    OraDatabase.Parameters.Remove "PV_ID"
1159
                                    %>
1160
                                 </table>
1161
                              </td>
1162
                           </tr>
1163
                        </table>
1164
                     </div>
1165
                  </td>
1166
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objForm.Validate("be_id_list")%></td>
1167
               </tr>
1168
               <tr>
1169
                  <td>&nbsp;</td>
1170
                  <td nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
1171
                  <td nowrap> <p>&nbsp;</p></td>
1172
                  <td nowrap>&nbsp;</td>
1173
               </tr>
1174
            </table>
1175
         </td>
1176
      </tr>
1177
      <tr>
1178
         <td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
1179
         <td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
1180
      </tr>
1181
   </table>
1182
   <input type="hidden" name="pv_id"   id="pv_id"   value="<%=parPv_id%>">
1183
   <input type="hidden" name="rtag_id" id="rtag_id" value="<%=parRtag_id%>">
1184
   <input type="hidden" name="vcs_tag" id="vcs_tag" value="<%=parVCSTag%>">
1185
   <input type="hidden" name="bs_name" id="bs_name" value="<%=parBSName%>">
1186
</form>
1187
</body>
1188
</html>
1189
<%
1190
'------------- RUN AFTER PAGE RENDER ---------------
1191
Set objFormCollector = Nothing
1192
'---------------------------------------------------
1193
%>
1194
 
1195
<!-- DESTRUCTOR ------->
1196
<!--#include file="common/destructor.asp"-->