Subversion Repositories DevTools

Rev

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