Subversion Repositories DevTools

Rev

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