Subversion Repositories DevTools

Rev

Rev 5506 | Rev 5596 | Go to most recent revision | Details | Compare with Previous | 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
5590 dpurdie 518
   Response.Write "<div id='div_vcs_tag_combo' name='div_vcs_tag_combo' style='visibility:hidden'   >"
5357 dpurdie 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>"
5590 dpurdie 526
   Response.Write "</div>"
5357 dpurdie 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
   rsTemp.Close()
554
   Set rsTemp = nothing
555
End Sub
556
'----------------------------------------------------------------------------------------------------------------------
557
' Figures out what the url should be for when the form is submitted, ensuring that all of the paramters are present if
558
' need be. Note that the VCS and BSName parameters are optional. They will only be present if the user has made modifications
559
' to the respective drop down list boxes before submitting the form.
560
Sub Determine_submit_action_url ()
561
   ' Work out what the reload url should be for when the user hits the submit button
562
   If IsNull(parVCSTag) OR parVCSTag = "" Then
563
      If IsNull(parBSName) OR parBSName = "" Then
564
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id
565
      Else
566
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&bs_name=" & parBSName
567
      End If
568
   Else
569
      If IsNull(parBSName) OR parBSName = "" Then
570
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag
571
      Else
572
         submit_action_url = scriptName & "?pv_id=" & parPv_id & "&rtag_id=" & parRtag_id & "&vcs_tag=" & parVCSTag & "&bs_name=" & parBSName
573
      End If
574
   End If
575
End Sub
576
'----------------------------------------------------------------------------------------------------------------------
577
' This subroutine sets up the on_submit_validation string to be used in the form tag to validate certain fields
578
' in client-side javascript when a user tries to submit the form
579
Sub Determine_On_Submit_Validation
580
   on_submit_validation = ""
581
   Dim args
582
 
583
   If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then
584
      ' Do clearcase path + label validation
585
      args = "'FRlabel','Label','RisCCLabel','FRpath','Source Path','RisCCPath'"
586
   ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then
587
      ' Do subversion tag validation
588
      args = "'FRpath','Source Path','RisSVNPath'"
589
      args = args & ",'FRlabel','Subversion Tag','RisSVNTag'"
590
      If (objFormCollector.Item("build_type") = "M" ) Then
591
          args = args & ",'FRlabel','Subversion Tag','RisSVNPegTag'"
592
      End If
593
   End If
594
   args = args & ",'pv_description','Package Description','RminLength:11'"
595
   args = args & ",'pv_overview','Package Overview','RminLength:11'"
596
   on_submit_validation = "onSubmit=""MM_validateForm(" & args & "); return document.MM_returnValue"""
597
 
5590 dpurdie 598
   on_submit_validation = ""
5357 dpurdie 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
'----------------------------------------------------------------------------------------------------------------------
619
Function GetRowColor( sRowColor )
620
   If sRowColor = "#FFFFFF" Then
621
      GetRowColor = "#F5F5F5"
622
   Else
623
      GetRowColor = "#FFFFFF"
624
   End If
625
End Function
626
'----------------------------------------------------------------------------------------------------------------------
627
%>
628
<%
629
'------------------------------- RUN BEFORE PAGE RENDER ----------------------------
630
 
631
Call LoadFieldRules ( "'FRlabel','FRpath','pv_description','pv_overview','be_id_list'", objForm )      ' Load Validation Rules
632
Call Get_Form_Details( parPv_id, objFormCollector )
633
 
634
 
635
 
636
'--- From Validation Rule Changes ----
637
 
638
' Dont need the label if the package version is uncontrolled
639
If (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then
640
   objForm.UpdateRules ("id='FRlabel' IsRequired='N'")
641
End If
642
 
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'")
646
End If
647
 
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'")
651
End If
652
 
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'")
658
 
659
 
660
 
661
'--- Access Control Setup ------------
662
pageIsEditable = Is_Page_Editable ( objFormCollector.Item ("dlocked") )
663
criticalSectionIsEditable = Is_Critical_Section_Editable ( objFormCollector.Item("dlocked") )
664
isWIP = PackageExists(parRtag_id,parPv_id,"work_in_progress")
665
 
666
If criticalSectionIsEditable then
667
   disableCriticalSectionEdit = ""
668
Else
669
   disableCriticalSectionEdit = "disabled"
670
End If
671
 
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
678
 
679
 
680
'--- Process Submission ---------------
681
 
682
If objForm.IsPostBack Then
683
   ' use of the drop down lists or the submit button gets us in here
684
 
685
   If objForm.IsValidOnPostBack Then
686
      ' only get here if the form is valid
687
 
688
      ' has the user pressed the submit button?
689
      If Request("btn") = "Submit" Then
690
 
691
         If objFormCollector.Item("build_type") = "A" AND UCase(objFormCollector.Item("bs_name")) = "NONE" Then
692
 
693
            Call MessageBox_Need_A_BuildStandard()
694
 
695
         Else
696
 
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
739
End If
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
 
748
'--------------------------------------------------------------------------------------------
749
%>
750
<html>
751
<head>
752
<title>Release Manager</title>
753
<link rel="shortcut icon" href="<%=FavIcon%>"/>
754
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
755
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
756
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
757
<link rel="stylesheet" href="images/navigation.css" type="text/css">
758
<script language="JavaScript" src="images/common.js"></script>
759
<!-- TIPS -->
760
<script language="JavaScript" src="images/tipster.js"></script>
761
<script language="JavaScript" src="images/_help_tips.js"></script>
762
<script language="JavaScript" type="text/javascript">
763
<!--
764
 
765
// This function is the onchange event handler for the Version Control System drop down list box.
766
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
767
// and submit the form using the updated URL.
768
function vcs_changed() {
769
   var f = document.getElementById('pkginfo');
770
   if (f == null) {
771
      alert('Javascript Error : Failed to get pkginfo');
772
   }
773
   else {
774
 
775
      var nc = document.getElementById('vcs_name_combo');
776
      if (nc == null) {
777
         alert('Javascript Error : Failed to get vcs_name_combo');
778
      }
779
      else {
780
         var tc = document.getElementById('vcs_tag_combo');
781
         if (tc == null) {
782
            alert('Javascript Error : Failed to get vcs_tag_combo');
783
         }
784
         else {
785
            // Form the new URL with the updated VCS tag passed as a parameter
786
            var tc2 = document.getElementById('vcs_name_combo');
787
            if (tc2.options[nc.selectedIndex].value == 'Concurrent Versions System')
788
            {
789
               alert('The Concurrent Versions System (CVS) is not fully supported by ERG.\n' +
790
                     'This means you will have to manually build this package.\n' +
791
                     'Please ensure you assign the version number manually, if that is not already so.\n');
792
            }
793
            <%If IsNull(parBSName) OR parBSName = "" Then%>
794
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
795
            <%Else%>
796
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=<%=parBSName%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
797
            <%End If%>
798
 
799
            f.submit();
800
         }
801
      }
802
   }
803
}
804
 
805
// This function is the onchange event handler for the Build Standard drop down list box.
806
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
807
// and submit the form using the updated URL.
808
function bld_std_changed() {
809
   var f = document.getElementById('pkginfo');
810
   if (f == null) {
811
      alert('Javascript Error : Failed to get pkginfo');
812
   }
813
   else {
814
      var nc = document.getElementById('bld_std_combo');
815
      if (nc == null) {
816
         alert('Javascript Error : Failed to get bld_std_combo');
817
      }
818
      else {
819
         // Form the new URL with the updated build standard name passed as a parameter
820
         <%If IsNull(parVCSTag) OR parVCSTag = "" Then%>
821
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=" + nc.options[nc.selectedIndex].value;
822
         <%Else%>
823
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=<%=parVCSTag%>&bs_name=" + nc.options[nc.selectedIndex].value;
824
         <%End If%>
825
 
826
         f.submit();
827
      }
828
   }
829
}
830
 
831
// This function will replace back slashes with forward slashes and can be used with an onchange event on fields
832
// where back slashes may be entered
833
function replace_back_slashes(e) {
834
   strip_whitespace(e);
835
   var str = e.value;
836
   e.value = str.replace(/\\/g,"/");
837
}
838
 
839
function strip_whitespace(e) {
840
   var str = e.value;
841
   str = str.replace(/^\s+/,"");
842
   e.value =  str.replace(/\s+$/,"");
843
}
844
 
845
//-->
846
</script>
847
</head>
848
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
849
<!-- TIPS LAYERS -------------------------------------->
850
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
851
<!----------------------------------------------------->
5590 dpurdie 852
<form id="pkginfo" name="pkginfo" method="post" <%=on_submit_validation%> action="<%=submit_action_url%>" class="form_tight">
853
   <table border="0" cellspacing="0" cellpadding="2">
5357 dpurdie 854
      <tr>
5590 dpurdie 855
         <td valign="top" nowrap class="wform_ttl" background="images/bg_form_lightgray.gif">
5357 dpurdie 856
            <table width="100%" border="0" cellspacing="1" cellpadding="2">
857
               <tr>
858
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
859
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objFormCollector.Item("pkg_name") &" "& objFormCollector.Item("pkg_version")%></td>
860
               </tr>
861
               <tr>
862
                  <td nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Deployable?<%=Quick_Help ( "deployable" )%></td>
863
                  <%
864
                  FRdeployableYES = ""
865
                  FRdeployableNO = ""
866
 
867
                  If objForm.IsPostBack Then
868
                     If Request("FRdeployable") = "1" Then
869
                        FRdeployableYES = "checked"
870
                     Else
871
                        FRdeployableNO = "checked"
872
                     End If
873
 
874
                  Else
875
                     If objFormCollector.Item("is_deployable") = enumDB_YES Then
876
                        FRdeployableYES = "checked"
877
                     Else
878
                        FRdeployableNO = "checked"
879
                     End If
880
 
881
                  End If
882
                  %>
883
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">Yes<input name="FRdeployable" type="radio" value="1" <%=FRdeployableYES%>>
884
                  &nbsp;&nbsp;No<input name="FRdeployable" type="radio" value="0" <%=FRdeployableNO%>></td>
885
               </tr>
886
               <tr>
887
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Version Control System</td>
888
                  <td nowrap background="images/bg_form_lightbluedark.gif">
889
                     <% Call RenderVCSCombo(objFormCollector.Item("vcs_tag"))%>
890
                  </td>
891
               </tr>
892
 
893
               <!--- Source Path ---------------------------------------------->
894
               <%If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then%>
895
 
896
                  <tr>
897
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
898
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
899
                        <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">
900
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs <br>
901
                     </td>
902
                  </tr>
903
 
904
                  <tr>
905
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
906
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
907
                        <%
908
                        sLabelReadOnly = ""
909
                        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"))
910
 
911
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
912
                           sLabelReadOnly = "readonly"
913
                        End If
914
 
915
                        If objForm.IsPostBack Then
916
                           sLabel = Request("FRlabel")
917
 
918
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
919
                           ' 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.
920
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
921
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
922
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
923
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
924
                           If IsNull(sLabel) OR sLabel = "" Then
925
                              sLabel = sDefaultLabel
926
                              objForm.SetValueForced "FRlabel", sLabel
927
                           End If
928
                        Else
929
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
930
                              sLabel = "N/A"
931
                           Else
932
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
933
                                 sLabel = sDefaultLabel
934
                              Else
935
                                 sLabel = objFormCollector.Item("pkg_label")
936
                              End If
937
                              objForm.SetValue "FRlabel", sLabel
938
                           End If
939
                        End If
940
                        %>
941
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
942
                        <br>&nbsp;Example: core_cs_1.0.0000.cr<br>
5590 dpurdie 943
                        <%=objForm.Validate ("FRlabel")%>
5357 dpurdie 944
                     </td>
945
                  </tr>
946
 
947
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then%>
948
                  <tr>
949
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "svn_source_path" )%></td>
950
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
951
                        <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">
952
                        <br>&nbsp;Example: AUPERASVN01/RepoName/myPackage/trunk<br>
953
                     </td>
954
                  </tr>
955
                  <tr>
956
                     <td nowrap valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Tag<%=Quick_Help ( "svn_tag" )%></td>
957
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
958
                        <%
959
                        sLabelReadOnly = ""
960
                        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"))
961
 
962
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
963
                           sLabelReadOnly = "readonly"
964
                        End If
965
 
966
                        If objForm.IsPostBack Then
967
                           sLabel = Request("FRlabel")
968
 
969
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
970
                           ' 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.
971
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
972
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
973
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
974
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
975
                           If IsNull(sLabel) OR sLabel = "" Then
976
                              sLabel = sDefaultLabel
977
                              objForm.SetValueForced "FRlabel", sLabel
978
                           End If
979
                        Else
980
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
981
                              sLabel = "N/A"
982
                           Else
983
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
984
                                 sLabel = sDefaultLabel
985
                              Else
986
                                 sLabel = objFormCollector.Item("pkg_label")
987
                              End If
988
                              objForm.SetValue "FRlabel", sLabel
989
                           End If
990
                        End If
991
                        %>
992
 
993
                        <input type="text" name="FRlabel" id="FRlabel" maxlength="50" size="60" class="form_item" <%=disableCriticalSectionEdit%> onchange="strip_whitespace(this);" value="<%=sLabel%>" <%=sLabelReadOnly%>>
994
                        <%
995
                        If objFormCollector.Item("build_type") = "M" Then
996
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>@1234<br> <%
997
                        Else
998
                            %> <br>&nbsp;Example: <%=sDefaultLabel%>[@1234]<br> <%
999
                        End If
1000
                        %>
5590 dpurdie 1001
                        <%=objForm.Validate ("FRlabel")%>
5357 dpurdie 1002
                     </td>
1003
                  </tr>
1004
 
1005
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then%>
1006
                  <tr>
1007
                     <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Source Path<%=Quick_Help ( "src_path" )%></td>
1008
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1009
                        <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">
1010
                        <br>&nbsp;Example: /MASS_Dev_Infra/core_cs<br>
1011
                     </td>
1012
                  </tr>
1013
 
1014
                  <tr>
1015
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Label<%=Quick_Help ( "pkg_label" )%></td>
1016
                     <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1017
                        <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") )%>" >
1018
                     </td>
5590 dpurdie 1019
                     <%=objForm.Validate ("FRlabel")%>
5357 dpurdie 1020
                  </tr>
1021
 
1022
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then%>
1023
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
1024
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1025
               <%Else%>
1026
                  <tr>
1027
                     <td colspan=3 background="images/bg_form_lightbluedark.gif" class="sublbox_txt">
1028
                        <span class='err_alert'><b>WARNING:</b> Release Manager Website does not currently support the selected Version Control System</span>
1029
                     </td>
1030
                  </tr>
1031
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
1032
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1033
               <%End If%>
1034
 
1035
               <tr>
1036
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Short Package Description<%=Quick_Help ( "pkg_info_short_desc" )%></td>
1037
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1038
                     <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>
5590 dpurdie 1039
                  <%=objForm.Validate ("pv_description")%>
5357 dpurdie 1040
                  </td>
1041
               </tr>
1042
               <tr>
1043
                  <td valign="top" background="images/bg_form_lightbluedark.gif" class="form_field">Package Overview<%=Quick_Help ( "pkg_info_overview" )%></td>
1044
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1045
                     <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>
5590 dpurdie 1046
                  <%=objForm.Validate ("pv_overview")%>
5357 dpurdie 1047
                  </td>
1048
               </tr>
1049
 
1050
               <tr>
1051
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Standard</td>
1052
                  <td nowrap background="images/bg_form_lightbluedark.gif">
1053
                     <% Call RenderBldStdCombo(objFormCollector.Item("bs_name"))%>
1054
                  </td>
1055
               </tr>
1056
 
1057
               <tr>
1058
                  <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Build Environment<%=Quick_Help ( "build_environment" )%></td>
1059
                  <td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1060
                     <%If objFormCollector.Item("is_build_env_required") = "N" Then%>
1061
                        &nbsp;Build Environment not applicable
1062
                     <%Else%>
1063
                     <%End If%>
5590 dpurdie 1064
                     <div id="divBuildEnv" name="divBuildEnv" style="overflow: auto; <%If (objFormCollector.Item("is_build_env_required") = "N") Then%>display:none;<%Else%>display:block;<%End If%>">
5357 dpurdie 1065
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
1066
                           <tr>
1067
                              <td bgcolor="#FFFFFF">
1068
                                 <table width="100%" border="0" cellspacing="0" cellpadding="3">
1069
                                    <%
1070
                                    OraDatabase.Parameters.Add "PV_ID",    parPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER
1071
 
1072
                                    query = _
1073
                                    " SELECT DECODE ( pkgbinfo.BM_ID,"&_
1074
                                    "                    bm.BM_ID, 'checked',"&_
1075
                                    "            NULL ) AS checked,"&_
1076
                                    "      bm.BM_ID,"&_
1077
                                    "      bm.BM_NAME, "&_
1078
                                    "      pkgbinfo.BSA_ID"&_
1079
                                    "  FROM BUILD_MACHINES bm,"&_
1080
                                    "        PACKAGE_BUILD_INFO pkgbinfo"&_
1081
                                    " WHERE pkgbinfo.BM_ID (+)= bm.BM_ID"&_
1082
                                    "   AND pkgbinfo.PV_ID (+)= :PV_ID"&_
1083
                                    " ORDER BY UPPER(bm.bm_name) "
1084
 
1085
 
1086
                                    Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
1087
                                    Dim rowColor
1088
 
1089
                                    rowColor = "#F5F5F5"
1090
 
1091
                                    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
1092
                                       checked = ""
1093
                                       If objForm.IsTicked( "be_id_list", rsQry("bm_id"), rsQry("checked") ) Then
1094
                                          checked = "checked"
1095
                                          objForm.SetValue "be_id_list", checked
1096
                                       End If
1097
 
1098
                                       rowColor = GetRowColor( rowColor )
1099
                                       %>
1100
                                       <tr>
1101
                                          <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>
1102
                                          <td width='1%' nowrap class="form_txt" bgcolor="<%=rowColor%>"><%=rsQry("bm_name")%></td>
1103
                                          <td width='98%' nowrap class="form_txt" bgcolor="<%=rowColor%>">
1104
                                                <div id="build_type_<%=rsQry("bm_id")%>" <%=ShowHideBuildType( checked )%>>
1105
                                                    <% Call RenderBuildTypeCombo( rsQry("bsa_id"), rsQry("bm_id"), objFormCollector.Item("bs_id") )%>
1106
                                                </div>
1107
                                          </td>
1108
                                          <%If checked = "checked" AND rsQry("bsa_id") = 0 Then%>
1109
                                             <td valign="top" nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
1110
                                             <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>
1111
                                             <td class='val_err'>Required</td></td>
1112
                                          <%End If%>
1113
                                       </tr>
1114
                                       <%rsQry.MoveNext
1115
                                    WEnd
1116
 
1117
                                    rsQry.Close
1118
                                    Set rsQry = Nothing
1119
 
1120
                                    OraDatabase.Parameters.Remove "PV_ID"
1121
                                    %>
1122
                                 </table>
1123
                              </td>
1124
                           </tr>
1125
                        </table>
1126
                     </div>
1127
                  </td>
5590 dpurdie 1128
                  <%=objForm.Validate("be_id_list")%>
5357 dpurdie 1129
               </tr>
1130
            </table>
1131
         </td>
1132
      </tr>
1133
      <tr>
5590 dpurdie 1134
		 <td align="right" >
1135
			<input type="submit" name="btn" value="Submit" <%If pageIsEditable Then%>class="form_btn_comp"<%Else%>disabled class="form_btn_comp_disabled"<%End If%>>
1136
			<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();">
1137
		 </td>
5357 dpurdie 1138
      </tr>
1139
   </table>
1140
   <input type="hidden" name="pv_id"   id="pv_id"   value="<%=parPv_id%>">
1141
   <input type="hidden" name="rtag_id" id="rtag_id" value="<%=parRtag_id%>">
1142
   <input type="hidden" name="vcs_tag" id="vcs_tag" value="<%=parVCSTag%>">
1143
   <input type="hidden" name="bs_name" id="bs_name" value="<%=parBSName%>">
1144
</form>
1145
</body>
1146
</html>
1147
<%
1148
'------------- RUN AFTER PAGE RENDER ---------------
1149
Set objFormCollector = Nothing
1150
'---------------------------------------------------
1151
%>
1152
 
1153
<!-- DESTRUCTOR ------->
1154
<!--#include file="common/destructor.asp"-->