Subversion Repositories DevTools

Rev

Rev 6579 | Rev 7286 | 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
7002 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
%>
550
<%
551
'------------------------------- RUN BEFORE PAGE RENDER ----------------------------
552
 
553
Call Get_Form_Details( parPv_id, objFormCollector )
554
 
555
'--- Access Control Setup ------------
556
pageIsEditable = Is_Page_Editable ( objFormCollector.Item ("dlocked") )
557
criticalSectionIsEditable = Is_Critical_Section_Editable ( objFormCollector.Item("dlocked") )
558
isWIP = PackageExists(parRtag_id,parPv_id,"work_in_progress")
559
 
560
If criticalSectionIsEditable then
561
   disableCriticalSectionEdit = ""
562
Else
563
   disableCriticalSectionEdit = "disabled"
564
End If
565
 
566
'--- Process Submission ---------------
567
If objForm.IsPostBack Then
568
      ' has the user pressed the submit button?
5596 dpurdie 569
    If Request("btn") = "Submit" Then
570
        Call Update_Pkg_Info ( parPv_id, QStrPar("FRdeployable"), QStrPar("FRlabel"), QStrPar("FRpath"), QStrPar("pv_description"), QStrPar("pv_overview") )
571
        Call OpenInParentWindow ( "fixed_issues.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&hidenv=true" )
572
        Call CloseWindow
5957 dpurdie 573
        Call Destroy_All_Objects
5596 dpurdie 574
        Response.End
5357 dpurdie 575
   End If
576
End If
577
 
578
' Determine the URL to use when and if this form is refreshed using F5, or when a user changes the
579
' values in one of the drop down lists and the form is reloaded with additional or changed parameters
580
' The html form will use the result of this in its action tag.
581
Call Determine_submit_action_url()
582
 
583
'--------------------------------------------------------------------------------------------
584
%>
585
<html>
586
<head>
587
<title>Release Manager</title>
588
<link rel="shortcut icon" href="<%=FavIcon%>"/>
589
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
590
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6579 dpurdie 591
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
592
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
593
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 594
<!-- TIPS -->
6579 dpurdie 595
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
596
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
5357 dpurdie 597
<script language="JavaScript" type="text/javascript">
598
<!--
5596 dpurdie 599
//  Validate tags on window load
600
window.onload = function(e)
601
{
602
<%If (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) AND criticalSectionIsEditable Then%>
603
    validateSvnPath();
604
    validateSvnTag();
605
<%End If%>
5357 dpurdie 606
 
5596 dpurdie 607
<%If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) AND criticalSectionIsEditable Then%>
608
    validateCCPath();
609
    validateCCLabel();
610
<%End If%>
611
 
612
    validateDesc();
613
    validateOverview();
614
}
615
 
5357 dpurdie 616
// This function is the onchange event handler for the Version Control System drop down list box.
617
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
618
// and submit the form using the updated URL.
619
function vcs_changed() {
620
   var f = document.getElementById('pkginfo');
621
   if (f == null) {
622
      alert('Javascript Error : Failed to get pkginfo');
623
   }
624
   else {
625
 
626
      var nc = document.getElementById('vcs_name_combo');
627
      if (nc == null) {
628
         alert('Javascript Error : Failed to get vcs_name_combo');
629
      }
630
      else {
631
         var tc = document.getElementById('vcs_tag_combo');
632
         if (tc == null) {
633
            alert('Javascript Error : Failed to get vcs_tag_combo');
634
         }
635
         else {
636
            // Form the new URL with the updated VCS tag passed as a parameter
637
            <%If IsNull(parBSName) OR parBSName = "" Then%>
638
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
639
            <%Else%>
640
               f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=<%=parBSName%>&vcs_tag=" + tc.options[nc.selectedIndex].value;
641
            <%End If%>
642
 
643
            f.submit();
644
         }
645
      }
646
   }
647
}
648
 
649
// This function is the onchange event handler for the Build Standard drop down list box.
650
// It will re-format the web page URL to pass the vcs_tag paramter reflecting the users choice in the drop down list,
651
// and submit the form using the updated URL.
652
function bld_std_changed() {
653
   var f = document.getElementById('pkginfo');
654
   if (f == null) {
655
      alert('Javascript Error : Failed to get pkginfo');
656
   }
657
   else {
658
      var nc = document.getElementById('bld_std_combo');
659
      if (nc == null) {
660
         alert('Javascript Error : Failed to get bld_std_combo');
661
      }
662
      else {
663
         // Form the new URL with the updated build standard name passed as a parameter
664
         <%If IsNull(parVCSTag) OR parVCSTag = "" Then%>
665
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&bs_name=" + nc.options[nc.selectedIndex].value;
666
         <%Else%>
667
            f.action = "_wform_pkg_info.asp?pv_id=<%=parPv_id%>&rtag_id=<%=parRtag_id%>&vcs_tag=<%=parVCSTag%>&bs_name=" + nc.options[nc.selectedIndex].value;
668
         <%End If%>
669
 
670
         f.submit();
671
      }
672
   }
673
}
5596 dpurdie 674
//
675
//  Update the Build Enviroment Display
676
//  Generic is not allowed to be checked if any of the others are checked
677
//  If Generic is ticked - then untick all others and hide associated combobox
678
//  If Generic is not ticked - the untick Generic and hide associated combobox
679
function UpdateBeDisplay(me, targetId)
680
{
681
    // Toggle related target id
682
    ToggleDisplay(targetId);
5357 dpurdie 683
 
5596 dpurdie 684
    if (me.checked) {
685
        // Handle Generic changes
686
        isGeneric = me.getAttribute("data-generic");
687
        items = document.getElementsByName("be_id_list");
688
        if (isGeneric){
689
            // Generic item has been checked
690
            for(idx = 0;idx < items.length; idx++){
691
                item = items[idx];
692
                if ( item != me ) {
693
                    item.checked = false;
694
                    target = item.getAttribute("data-target-id");
695
                    el = document.getElementById(target);
696
                    el.style.display = 'none';  
697
                }
698
            }
699
        } else {
700
            for(idx = 0;idx < items.length; idx++){
701
                item = items[idx];
702
                itemGeneric = item.getAttribute("data-generic");
703
                if(itemGeneric) {
704
                    item.checked = false;
705
                    target = item.getAttribute("data-target-id");
706
                    el = document.getElementById(target);
707
                    el.style.display = 'none';   
708
                }
709
            }
710
        }
711
    }
712
}
713
 
714
var bPathOk = true;
715
var bLabelOk = true;
716
var bDescOk = true;
717
var bOverview = true;
718
 
719
function validateDesc()
720
{
721
    document.MM_returnValue = true;
722
    document.MM_error = "";
723
 
724
    e = MM_findObj('pv_description');
725
    if ( e.value.length )
726
        MM_validateForm('--Silent','--NoPrefix','pv_description','Package Description','minLength:10');
727
 
728
    bDescOk = document.MM_returnValue;
729
    setIdText('descErr',document.MM_error);
730
    parent.resizeIframe(); 
731
}
732
 
733
function validateOverview()
734
{
735
    document.MM_returnValue = true;
736
    document.MM_error = "";
737
 
738
    e = MM_findObj('pv_overview');
739
    if ( e.value.length )
740
        MM_validateForm('--Silent','--NoPrefix','pv_overview','Package Overview','minLength:20');
741
 
742
    bOverview = document.MM_returnValue;
743
    setIdText('viewErr',document.MM_error);
744
    parent.resizeIframe(); 
745
}
746
 
747
//  Validate the SVN Path
748
//
749
function validateSvnPath()
750
{
751
    document.MM_returnValue = true;
752
    document.MM_error = "";
753
 
754
    e = MM_findObj('FRpath');
6300 dpurdie 755
    if ( e.value.length ) {
5596 dpurdie 756
        MM_validateForm('--Silent','--NoPrefix','FRpath','Source Path','RisSVNPath');
6300 dpurdie 757
        if ( !document.MM_error ) {
758
            if ( e.value.indexOf('AUPERASVN0X/') != -1 ||   e.value.indexOf('/RepoName/') != -1 ) {
759
                document.MM_error = "Example path cannot be used";
760
                document.MM_returnValue = false;
761
            }
762
        }
763
    }
5596 dpurdie 764
 
765
    bPathOk = document.MM_returnValue;
766
    setIdText('svnPathErr',document.MM_error);
767
    parent.resizeIframe(); 
768
}
769
 
770
//  Validate the SVN Tag
771
//
772
function validateSvnTag()
773
{
774
    document.MM_returnValue = true;
775
    document.MM_error = "";
776
 
777
    e = MM_findObj('FRlabel');
778
    if ( e.value.length )
779
        MM_validateForm('--Silent','--NoPrefix','FRlabel','Subversion Tag','RisSVNTag');
780
 
781
    bLabelOk = document.MM_returnValue;
782
    setIdText('svnTagErr',document.MM_error);
783
<%If (objFormCollector.Item("build_type") = "M" ) Then%>
784
    if(bLabelOk){
785
        MM_validateForm('--Silent','FRlabel','Subversion Tag','RisSVNPegTag');
786
        bLabelOk = document.MM_returnValue;
787
        setIdText('svnTagErr',document.MM_error);
788
    }
789
<%End If%>
790
    parent.resizeIframe(); 
791
}
792
 
793
//  Validate the CC Path
794
//
795
function validateCCPath()
796
{
797
    document.MM_returnValue = true;
798
    document.MM_error = "";
799
 
800
    e = MM_findObj('FRpath');
801
    if ( e.value.length)
802
        MM_validateForm('--Silent','--NoPrefix','FRpath','Source Path','RisCCPath');
803
    bPathOk = document.MM_returnValue;
804
    setIdText('ccPathErr',document.MM_error);
805
    parent.resizeIframe(); 
806
}
807
 
808
//  Validate the CC Label
809
//
810
function validateCCLabel()
811
{
812
    document.MM_returnValue = true;
813
    document.MM_error = "";
814
 
815
    e = MM_findObj('FRlabel');
816
    if ( e.value.length)
817
        MM_validateForm('--Silent','--NoPrefix','FRlabel','Label','RisCCLabel');
818
 
819
    bLabelOk = document.MM_returnValue;
820
    setIdText('ccLabelErr',document.MM_error);
821
    parent.resizeIframe();
822
}
823
 
824
//  Show/Hide error message in specified element
825
function setIdText(id, text) {
826
    var element = document.getElementById(id);
827
    if ( element ) {
828
    while (element.firstChild!==null)
829
        element.removeChild(element.firstChild); // remove all existing content
830
        if(text){
831
            element.appendChild(document.createTextNode(text));
832
            element.style.display = 'block';
833
        }
834
        else {
835
            element.style.display = 'none';
836
        }
837
    }
838
    updateSubmit(); 
839
}
840
 
841
// Enable/disable the submit button
842
// Based on the state of bPathOk and bLabelOk
843
function updateSubmit(){
844
    var element = document.getElementById('btn_submit');
845
    if ( element ) {
846
        element.disabled = !(bPathOk && bLabelOk && bOverview && bDescOk);
847
        if (element.disabled) {
848
            removeClass(element, 'form_btn_comp');
849
            addClass(element, 'form_btn_comp_disabled');
850
        } else {
851
            removeClass(element, 'form_btn_comp_disabled') ;
852
            addClass(element, 'form_btn_comp');
853
        }
854
    }
855
}
856
 
857
 
5357 dpurdie 858
// This function will replace back slashes with forward slashes and can be used with an onchange event on fields
859
// where back slashes may be entered
860
function replace_back_slashes(e) {
861
   strip_whitespace(e);
862
   var str = e.value;
863
   e.value = str.replace(/\\/g,"/");
864
}
865
 
866
function strip_whitespace(e) {
867
   var str = e.value;
868
   str = str.replace(/^\s+/,"");
869
   e.value =  str.replace(/\s+$/,"");
870
}
871
 
872
//-->
873
</script>
874
</head>
875
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
5596 dpurdie 876
<form id="pkginfo" name="pkginfo" method="post" onSubmit="return document.MM_returnValue;" action="<%=submit_action_url%>" class="form_tight">
5590 dpurdie 877
   <table border="0" cellspacing="0" cellpadding="2">
5357 dpurdie 878
      <tr>
7002 dpurdie 879
         <td nowrap class="wform_ttl">
880
            <table width="100%" border="0" cellspacing="1" cellpadding="2" class=lhsGrey>
5357 dpurdie 881
               <tr>
7002 dpurdie 882
                  <td nowrap>Package</td>
883
                  <td nowrap><%=objFormCollector.Item("pkg_name") &" "& objFormCollector.Item("pkg_version")%></td>
5357 dpurdie 884
               </tr>
885
               <tr>
7002 dpurdie 886
                  <td nowrap>Deployable?<%=Quick_Help ( "deployable" )%></td>
5357 dpurdie 887
                  <%
888
                  FRdeployableYES = ""
889
                  FRdeployableNO = ""
890
 
891
                  If objForm.IsPostBack Then
892
                     If Request("FRdeployable") = "1" Then
893
                        FRdeployableYES = "checked"
894
                     Else
895
                        FRdeployableNO = "checked"
896
                     End If
897
 
898
                  Else
899
                     If objFormCollector.Item("is_deployable") = enumDB_YES Then
900
                        FRdeployableYES = "checked"
901
                     Else
902
                        FRdeployableNO = "checked"
903
                     End If
904
 
905
                  End If
906
                  %>
7002 dpurdie 907
                  <td nowrap>Yes<input name="FRdeployable" type="radio" value="1" <%=FRdeployableYES%>>
5357 dpurdie 908
                  &nbsp;&nbsp;No<input name="FRdeployable" type="radio" value="0" <%=FRdeployableNO%>></td>
909
               </tr>
910
               <tr>
7002 dpurdie 911
                  <td nowrap>Version Control System</td>
912
                  <td nowrap>
5357 dpurdie 913
                     <% Call RenderVCSCombo(objFormCollector.Item("vcs_tag"))%>
5596 dpurdie 914
                     <%If (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then%>
915
                        <span class='err_alert'>[Not fully Supported]</span>
916
                     <%End If%>
5357 dpurdie 917
                  </td>
918
               </tr>
919
 
920
               <!--- Source Path ---------------------------------------------->
921
               <%If (objFormCollector.Item("vcs_tag") = enum_VCS_CLEARCASE_TAG) Then%>
922
 
923
                  <tr>
7002 dpurdie 924
                     <td nowrap>Source Path<%=Quick_Help ( "src_path" )%></td>
925
                     <td nowrap>
5596 dpurdie 926
                        <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 927
                        <br>&nbsp;Example: /MASS_Dev_Infra/<%=objFormCollector.Item("pkg_name")%> <br>
5596 dpurdie 928
                        <span class='val_err' id=ccPathErr style='display:none'></span>
5357 dpurdie 929
                     </td>
930
                  </tr>
931
 
932
                  <tr>
7002 dpurdie 933
                     <td nowrap>Label<%=Quick_Help ( "pkg_label" )%></td>
934
                     <td nowrap>
5357 dpurdie 935
                        <%
936
                        sLabelReadOnly = ""
937
                        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"))
938
 
939
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
940
                           sLabelReadOnly = "readonly"
941
                        End If
942
 
943
                        If objForm.IsPostBack Then
944
                           sLabel = Request("FRlabel")
945
 
946
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
947
                           ' 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.
948
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
949
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
950
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
951
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
952
                           If IsNull(sLabel) OR sLabel = "" Then
953
                              sLabel = sDefaultLabel
954
                              objForm.SetValueForced "FRlabel", sLabel
955
                           End If
956
                        Else
957
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
958
                              sLabel = "N/A"
959
                           Else
960
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
961
                                 sLabel = sDefaultLabel
962
                              Else
963
                                 sLabel = objFormCollector.Item("pkg_label")
964
                              End If
965
                              objForm.SetValue "FRlabel", sLabel
966
                           End If
967
                        End If
968
                        %>
5596 dpurdie 969
                        <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 970
                        <br>&nbsp;Example: <%=objFormCollector.Item("pkg_name")%>_1.0.0000.cr.WIP<br>
5596 dpurdie 971
                        <span class='val_err' id=ccLabelErr style='display:none'></span>
5357 dpurdie 972
                     </td>
973
                  </tr>
974
 
975
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_SUBVERSION_TAG) Then%>
976
                  <tr>
7002 dpurdie 977
                     <td nowrap>Source Path<%=Quick_Help ( "svn_source_path" )%></td>
978
                     <td nowrap>
5596 dpurdie 979
                        <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 980
                        <table>
6300 dpurdie 981
                            <tr>
982
                            <td>Example:</td>
983
                            <td>AUPERASVN0X/RepoName/<%=objFormCollector.Item("pkg_name")%>/trunk</td>
984
                            </tr>
985
                        </table>
5596 dpurdie 986
                        <span class='val_err' id=svnPathErr style='display:none'></span>
5357 dpurdie 987
                     </td>
988
                  </tr>
989
                  <tr>
7002 dpurdie 990
                     <td nowrap  nowrap>Tag<%=Quick_Help ( "svn_tag" )%></td>
991
                     <td nowrap>
5357 dpurdie 992
                        <%
993
                        sLabelReadOnly = ""
994
                        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"))
995
 
996
                        If objFormCollector.Item("build_type") = "A" AND NOT criticalSectionIsEditable Then
997
                           sLabelReadOnly = "readonly"
998
                        End If
999
 
1000
                        If objForm.IsPostBack Then
1001
                           sLabel = Request("FRlabel")
1002
 
1003
                           ' If a user has switched the form back and forth between different VCS settings, and the previous one did not utilise a label
1004
                           ' 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.
1005
                           ' Also, we use the SetValueForced() function to force the value of sLabel into the object that does some of our validation for us.
1006
                           ' That function (as opposed to the plain SetValue() function) cares nothing about the setting of the IsPostBack flag in the
1007
                           ' object. If we didnt do this, the field on the visible form would be highlighted with "Required" because SetValue() just does
1008
                           ' a Request() in IsPostBack situations, and so our sLabel value will not be acquired by the object for validation.
1009
                           If IsNull(sLabel) OR sLabel = "" Then
1010
                              sLabel = sDefaultLabel
1011
                              objForm.SetValueForced "FRlabel", sLabel
1012
                           End If
1013
                        Else
1014
                           If (objFormCollector.Item("pkg_label") = "N/A") Then
1015
                              sLabel = "N/A"
1016
                           Else
1017
                              If objFormCollector.Item("pkg_label") = "" OR IsNull(objFormCollector.Item("pkg_label"))  Then
1018
                                 sLabel = sDefaultLabel
1019
                              Else
1020
                                 sLabel = objFormCollector.Item("pkg_label")
1021
                              End If
1022
                              objForm.SetValue "FRlabel", sLabel
1023
                           End If
1024
                        End If
1025
                        %>
1026
 
5623 dpurdie 1027
                        <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 1028
                        <%
1029
                        If objFormCollector.Item("build_type") = "M" Then
6300 dpurdie 1030
                            sDefaultLabel = sDefaultLabel & "@1234"
5357 dpurdie 1031
                        Else
6300 dpurdie 1032
                            sDefaultLabel = sDefaultLabel & "[@1234]"
5357 dpurdie 1033
                        End If
1034
                        %>
7002 dpurdie 1035
                        <table>
6300 dpurdie 1036
                            <tr>
1037
                            <td>Example:</td>
1038
                            <td><%=sDefaultLabel%></td>
1039
                            </tr>
1040
                        </table>
5596 dpurdie 1041
                        <span class='val_err' id=svnTagErr style='display:none'></span>
5357 dpurdie 1042
                     </td>
1043
                  </tr>
1044
 
1045
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_CVS_TAG) Then%>
1046
                  <tr>
7002 dpurdie 1047
                     <td nowrap>Source Path<%=Quick_Help ( "src_path" )%></td>
1048
                     <td nowrap>
5357 dpurdie 1049
                        <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 1050
                        <br>&nbsp;Example: /MASS_Dev_Infra/<%=objFormCollector.Item("pkg_name")%><br>
5357 dpurdie 1051
                     </td>
1052
                  </tr>
1053
 
1054
                  <tr>
7002 dpurdie 1055
                     <td nowrap>Label<%=Quick_Help ( "pkg_label" )%></td>
1056
                     <td nowrap>
1057
                        <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 1058
                     </td>
1059
                  </tr>
1060
 
1061
               <%ElseIf (objFormCollector.Item("vcs_tag") = enum_VCS_UNCONTROLLED_TAG) Then%>
1062
                  <input name="FRpath"  type="hidden" id="FRpath"  value="<%=objForm.GetValue( "FRpath", objFormCollector.Item("src_path") )%>">
1063
                  <input name="FRlabel" type="hidden" id="FRlabel" value="<%=sLabel%>">
1064
               <%Else%>
1065
                  <tr>
7002 dpurdie 1066
                     <td colspan=3  class="sublbox_txt">
5357 dpurdie 1067
                        <span class='err_alert'><b>WARNING:</b> Release Manager Website does not currently support the selected Version Control System</span>
1068
                     </td>
1069
                  </tr>
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
               <%End If%>
1073
 
1074
               <tr>
7002 dpurdie 1075
                  <td>Short Package Description<%=Quick_Help ( "pkg_info_short_desc" )%></td>
1076
                  <td nowrap>
5596 dpurdie 1077
                     <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>
1078
                     <span class='val_err' id=descErr style='display:none'></span>
5357 dpurdie 1079
                  </td>
1080
               </tr>
1081
               <tr>
7002 dpurdie 1082
                  <td>Package Overview<%=Quick_Help ( "pkg_info_overview" )%></td>
1083
                  <td nowrap>
5596 dpurdie 1084
                     <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>
1085
                     <span class='val_err' id=viewErr style='display:none'></span>
5357 dpurdie 1086
                  </td>
1087
               </tr>
1088
 
1089
               <tr>
7002 dpurdie 1090
                  <td nowrap>Build Standard</td>
1091
                  <td nowrap>
1092
                     <% Call RenderBldStdCombo(objFormCollector.Item("bs_name"))
1093
                     If objFormCollector.Item("bs_name") = "ANT" Then
1094
                         %><span class='err_alert'> - Not recomended for new packages.</span><%
1095
                     End If
1096
                     %>
5357 dpurdie 1097
                  </td>
1098
               </tr>
1099
 
1100
               <tr>
7002 dpurdie 1101
                  <td nowrap>Build Environment<%=Quick_Help ( "build_environment" )%></td>
1102
                  <td nowrap>
5357 dpurdie 1103
                     <%If objFormCollector.Item("is_build_env_required") = "N" Then%>
1104
                        &nbsp;Build Environment not applicable
1105
                     <%Else%>
1106
                     <%End If%>
5590 dpurdie 1107
                     <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 1108
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
1109
                           <tr>
1110
                              <td bgcolor="#FFFFFF">
7002 dpurdie 1111
                                 <table width="100%" border="0" cellspacing="0" cellpadding="3" class=stdGrey>
5357 dpurdie 1112
                                    <%
1113
                                    OraDatabase.Parameters.Add "PV_ID",    parPv_id,   ORAPARM_INPUT, ORATYPE_NUMBER
1114
 
1115
                                    query = _
5596 dpurdie 1116
                                    " SELECT DECODE ( pkgbinfo.BM_ID, bm.BM_ID, 'checked', NULL ) AS checked,"&_
5357 dpurdie 1117
                                    "      bm.BM_ID,"&_
1118
                                    "      bm.BM_NAME, "&_
5596 dpurdie 1119
                                    "      pkgbinfo.BSA_ID, "&_
1120
                                    "      DECODE (UPPER(bm.BM_NAME) , UPPER('Generic'), 1, NULL ) AS isGeneric" &_
5357 dpurdie 1121
                                    "  FROM BUILD_MACHINES bm,"&_
1122
                                    "        PACKAGE_BUILD_INFO pkgbinfo"&_
1123
                                    " WHERE pkgbinfo.BM_ID (+)= bm.BM_ID"&_
1124
                                    "   AND pkgbinfo.PV_ID (+)= :PV_ID"&_
1125
                                    " ORDER BY UPPER(bm.bm_name) "
1126
 
1127
                                    Set rsQry = OraDatabase.DbCreateDynaset( query, cint(0))
7002 dpurdie 1128
                                    Dim rowClass : rowClass = "even"
5357 dpurdie 1129
 
1130
                                    While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
1131
                                       checked = ""
1132
                                       If objForm.IsTicked( "be_id_list", rsQry("bm_id"), rsQry("checked") ) Then
1133
                                          checked = "checked"
1134
                                          objForm.SetValue "be_id_list", checked
1135
                                       End If
1136
 
7002 dpurdie 1137
                                       rowClass = IIF( rowClass = "odd" , "even", "odd" )
5357 dpurdie 1138
                                       %>
7002 dpurdie 1139
                                       <tr class='nowrap tight <%=rowClass%>'>
1140
                                          <td width='1%' >
5596 dpurdie 1141
                                            <input type="checkbox" 
1142
                                                   name="be_id_list" 
1143
                                                   onClick="UpdateBeDisplay(this, 'build_type_<%=rsQry("bm_id")%>');" 
1144
                                                   <%=disableCriticalSectionEdit%>
5597 dpurdie 1145
                                                   <%=IIf(rsQry("ISGENERIC"), " data-generic='1'","")%> 
5596 dpurdie 1146
                                                   data-target-id='build_type_<%=rsQry("bm_id")%>'
1147
                                                   value="<%=rsQry("bm_id")%>" <%=checked%>>
1148
                                          </td>
7002 dpurdie 1149
                                          <td width='1%' ><%=rsQry("bm_name")%></td>
1150
                                          <td width='98%' >
5357 dpurdie 1151
                                                <div id="build_type_<%=rsQry("bm_id")%>" <%=ShowHideBuildType( checked )%>>
1152
                                                    <% Call RenderBuildTypeCombo( rsQry("bsa_id"), rsQry("bm_id"), objFormCollector.Item("bs_id") )%>
7002 dpurdie 1153
                                                </div>  
5357 dpurdie 1154
                                          </td>
1155
                                          <%If checked = "checked" AND rsQry("bsa_id") = 0 Then%>
7002 dpurdie 1156
                                             <td>
5357 dpurdie 1157
                                             <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 1158
                                             <td class='val_err'>Required</td>
5357 dpurdie 1159
                                          <%End If%>
1160
                                       </tr>
1161
                                       <%rsQry.MoveNext
1162
                                    WEnd
1163
 
1164
                                    rsQry.Close
1165
                                    Set rsQry = Nothing
1166
 
1167
                                    OraDatabase.Parameters.Remove "PV_ID"
1168
                                    %>
1169
                                 </table>
1170
                              </td>
1171
                           </tr>
1172
                        </table>
1173
                     </div>
1174
                  </td>
1175
               </tr>
1176
            </table>
1177
         </td>
1178
      </tr>
1179
      <tr>
7002 dpurdie 1180
		 <td align="right">
5596 dpurdie 1181
			<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 1182
			<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();">
1183
		 </td>
5357 dpurdie 1184
      </tr>
1185
   </table>
1186
   <input type="hidden" name="pv_id"   id="pv_id"   value="<%=parPv_id%>">
1187
   <input type="hidden" name="rtag_id" id="rtag_id" value="<%=parRtag_id%>">
1188
   <input type="hidden" name="vcs_tag" id="vcs_tag" value="<%=parVCSTag%>">
1189
   <input type="hidden" name="bs_name" id="bs_name" value="<%=parBSName%>">
5596 dpurdie 1190
   <%objForm.AddPostBack()%>
5357 dpurdie 1191
</form>
1192
</body>
1193
</html>
1194
<%
1195
'------------- RUN AFTER PAGE RENDER ---------------
1196
Set objFormCollector = Nothing
1197
'---------------------------------------------------
1198
%>
1199
<!-- DESTRUCTOR ------->
1200
<!--#include file="common/destructor.asp"-->