Subversion Repositories DevTools

Rev

Rev 133 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 133 Rev 3959
Line 15... Line 15...
15
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
<!--#include file="_drawExtensionSelectBox.asp"-->
20
<!--#include file="class/classSortHelper.asp"-->
21
<%
21
<%
22
 
22
 
23
'------------ ACCESS CONTROL ------------------
23
'------------ ACCESS CONTROL ------------------
24
%>
24
%>
25
<!--#include file="_access_control_login.asp"-->
25
<!--#include file="_access_control_login.asp"-->
Line 38... Line 38...
38
Dim parBase_view_id
38
Dim parBase_view_id
39
Dim rsPkgs
39
Dim rsPkgs
40
Dim HTML_pkg_list
40
Dim HTML_pkg_list
41
Dim parPv_id
41
Dim parPv_id
42
Dim parPkgfind
42
Dim parPkgfind
43
Dim parIsNewPackage
-
 
44
'------------ Constants Declaration -----------
43
'------------ Constants Declaration -----------
45
'------------ Variable Init -------------------
44
'------------ Variable Init -------------------
46
parAdd_type = Request("add_type")
45
parAdd_type = Request("add_type")
47
parPkg_list = Request("pkg_list")
46
parPkg_list = Request("pkg_list")
48
parBase_view_id = Request("base_view_id")
47
parBase_view_id = Request("base_view_id")
49
parPv_id = Request("pv_id")
48
parPv_id = Request("pv_id")
50
parPkgfind = Request("pkgfind")
49
parPkgfind = Request("pkgfind")
51
parIsNewPackage = Request("isNewPackage")
-
 
52
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
50
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
53
'----------------------------------------------
51
'----------------------------------------------
54
%>
52
%>
55
<%
53
<%
56
' ---- Action requirements ----
54
' ---- Action requirements ----
Line 61... Line 59...
61
                                            "&errmsg=true" )
59
                                            "&errmsg=true" )
62
%>
60
%>
63
<%
61
<%
64
Function Page_Title ( NNadd_type )
62
Function Page_Title ( NNadd_type )
65
   If NNadd_type = Cstr(enum_ADD_PACKAGES) Then
63
   If NNadd_type = Cstr(enum_ADD_PACKAGES) Then
66
      Page_Title = "ADD package"
64
      Page_Title = "ADD Package"
67
 
65
 
68
   ElseIf NNadd_type = Cstr(enum_ADD_DEPENDENCIES) Then
66
   ElseIf NNadd_type = Cstr(enum_ADD_DEPENDENCIES) Then
69
      Page_Title = "ADD dependency"
67
      Page_Title = "ADD Dependency"
70
 
68
 
71
   ElseIf NNadd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then
69
   ElseIf NNadd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then
72
      Page_Title = "ADD Runtime Dependency"
70
      Page_Title = "ADD Runtime Dependency"
73
 
71
 
74
   Else
72
   Else
Line 210... Line 208...
210
   Set rsTemp = nothing
208
   Set rsTemp = nothing
211
End Sub
209
End Sub
212
 
210
 
213
 
211
 
214
' This function is used when adding packages to a release. The function processes a list of package ID's
212
' This function is used when adding packages to a release. The function processes a list of package ID's
215
' and forms the HTML to display for each item, the name, base version, extension, and full version,
213
' and forms the HTML to display for each item, the name, all available full versions in a list box
216
' where the base version is an input text box, and the extension is a drop down list box.
-
 
217
Sub Generate_Package_List ( NNpkg_list, SShtml_pkg_list, NNrtag_id, NNadd_type )
214
Sub Generate_Package_List ( NNpkg_list, SShtml_pkg_list, NNrtag_id, NNadd_type )
218
 
215
 
219
   Dim rsPkgs, hidePatches, finalArg, currRsPkg, qparPkg_list
216
   Dim rsPkgs, hidePatches, currRsPkg, qparPkg_list
220
   Dim checkBoxId, spanPkgNameId, tdCheckBoxId
-
 
221
   Dim fullVersion
-
 
222
   Dim baseVersion
217
   Dim spanPkgNameId
223
   Dim extension
-
 
224
   Dim commonHTML
218
   Dim commonHTML
225
   hidePatches = "hidepatches=true&"
219
   hidePatches = "hidepatches=true&"
226
 
220
 
227
   If pkgInfoHash.Item ("is_patch") = "Y" Then hidePatches = ""
221
   If pkgInfoHash.Item ("is_patch") = "Y" Then hidePatches = ""
228
 
222
 
229
   Set rsPkgs = OraDatabase.DbCreateDynaset( Get_Pkg_Names( NNpkg_list, NNadd_type ), cint(0))
223
   Set rsPkgs = OraDatabase.DbCreateDynaset( Get_Pkg_Names( NNpkg_list, NNadd_type ), cint(0))
230
   While ((NOT rsPkgs.BOF) AND (NOT rsPkgs.EOF))
224
   While ((NOT rsPkgs.BOF) AND (NOT rsPkgs.EOF))
-
 
225
 
231
      currRsPkg = chr(34) & rsPkgs("pkg_id") & chr(34)
226
      currRsPkg = chr(34) & rsPkgs("pkg_id") & chr(34)
232
      qparPkg_list = chr(34) & parPkg_list & chr(34)
227
      qparPkg_list = chr(34) & parPkg_list & chr(34)
233
 
228
 
234
      ' Begin table row
229
      ' Begin table row
235
      SShtml_pkg_list = SShtml_pkg_list &"<tr> "
230
      SShtml_pkg_list = SShtml_pkg_list &"<tr> "
236
 
231
 
237
      spanPkgNameId = "spanPkgName" & rsPkgs("pkg_id")
232
      spanPkgNameId = "spanPkgName" & rsPkgs("pkg_id")
238
 
233
 
239
      fullVersion = ""
-
 
240
      baseVersion = ""
-
 
241
      extension = ""
-
 
242
 
-
 
243
      ' Form package name
234
      ' Form package name
244
      SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>" _
235
      SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>" _
245
                                        & "<span id='" & spanPkgNameId & "'>"& rsPkgs("pkg_name") &"</span></td>"
236
                                        & "<span id='" & spanPkgNameId & "'>"& rsPkgs("pkg_name") &"</span></td>"
246
 
237
 
247
      ' setup some common html so that we can make the (full) Version field on the right-most column of the
238
      ' setup some common html so that we can make the (full) Version field on the right-most column of the
248
      ' table row update on certain events taking place in the version base input box, and version extension
239
      ' table row update on certain events taking place in the version base input box, and version extension
249
      ' drop down list box
240
      ' drop down list box
250
      commonHTML = rsPkgs("pkg_id") & "' onmouseout='updateVersion(" & currRsPkg & "," & qparPkg_list _
241
      commonHTML = rsPkgs("pkg_id") & "'  onblur='updateVersion(" & currRsPkg & ");'" &_
251
                                    & ");' onblur='updateVersion(" & currRsPkg & "," & qparPkg_list _
-
 
252
                                    & ");' onclick='updateVersion(" & currRsPkg & "," & qparPkg_list _
-
 
253
                                    & ");' onmouseup='updateVersion(" & currRsPkg & "," & qparPkg_list _
-
 
254
                                    & ");' onchange='updateVersion(" & currRsPkg & "," & qparPkg_list _
242
                                        " onchange='updateVersion(" & currRsPkg & ");'"
255
                                    & ");' onkeyup='updateVersion(" & currRsPkg & "," & qparPkg_list & ");'"
-
 
256
 
-
 
257
      ' Form the HTML for the version base input field
-
 
258
      SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif'>"_
-
 
259
                                        &"<input type='text' style='visibility: visible' id='inputVersionBase"_
-
 
260
                                        & commonHTML & " class='form_item' size='12' value='"& baseVersion &"'"
-
 
261
 
-
 
262
      SShtml_pkg_list = SShtml_pkg_list & "> </td>"
-
 
263
 
-
 
264
 
-
 
265
      ' Form the HTML for the version Extension drop down list
-
 
266
      SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif'> "_
-
 
267
                                        & "<select style='visibility: visible' id='selectVersionExtension"_
-
 
268
                                        & commonHTML & " id='selectExtension'"
-
 
269
 
-
 
270
      SShtml_pkg_list = SShtml_pkg_list & "> "
-
 
271
 
243
 
-
 
244
      SShtml_pkg_list = SShtml_pkg_list & "<td><select class='form_item' id='pkgn" & commonHTML & "name='pkgn" & rsPkgs("pkg_id") & "'>"
272
      ' populate drop down with valid list of extensions
245
      SShtml_pkg_list = SShtml_pkg_list & populateVersionList( rsPkgs("pkg_id") )
273
      SShtml_pkg_list = SShtml_pkg_list & getExtensionSelectText(extension, false) ' getExtensionSelectText() is defined in _drawExtensionSelectBox.asp
246
      SShtml_pkg_list = SShtml_pkg_list & "</select></td>"
274
 
247
 
275
      SShtml_pkg_list = SShtml_pkg_list &"</select>"
-
 
276
 
-
 
277
      If NNadd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then ' Runtime depencencies do not have constraints on pkg version
-
 
278
         finalArg = "'R'"
-
 
279
      Else ' Build dependencies have some format to follow
-
 
280
         finalArg = "'RisVersionStr'"
-
 
281
      End If
-
 
282
 
-
 
283
      SShtml_pkg_list = SShtml_pkg_list  &"</td>"
-
 
284
 
-
 
285
      ' Form the Use Existing Version checkbox
-
 
286
      checkBoxId = "checkBoxExistingVersion" & rsPkgs("pkg_id")
-
 
287
      tdCheckBoxId = "tdCheckBox" & rsPkgs("pkg_id")
-
 
288
 
-
 
289
      SShtml_pkg_list = SShtml_pkg_list  &"<td id='"&tdCheckBoxID&"' background='images/bg_form_lightgray.gif'>"
-
 
290
      SShtml_pkg_list = SShtml_pkg_list  &"<input type='checkBox' id='"&checkBoxId&"' onclick=""checkBoxChanged('" _
-
 
291
                                       & rsPkgs("pkg_id") & "','" & rsPkgs("pkg_name") & "');"">"
-
 
292
      SShtml_pkg_list = SShtml_pkg_list  &"</td>"
248
      SShtml_pkg_list = SShtml_pkg_list  &"</td>"
293
 
249
 
294
      ' Form the (full) Version display field
-
 
295
      SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif'>"
-
 
296
 
-
 
297
      SShtml_pkg_list = SShtml_pkg_list &"<span nowrap class='form_item' name='spanFullVersion" & rsPkgs("pkg_id") _
-
 
298
                                        & "' id='spanFullVersion" & rsPkgs("pkg_id") & "'> unset </span>"
-
 
299
 
-
 
300
      SShtml_pkg_list = SShtml_pkg_list & "<input type='hidden'  id='pkgn" & rsPkgs("pkg_id") _
-
 
301
                                        & "' name='pkgn" & rsPkgs("pkg_id") & "' ' class='form_item' size='12' value='" & fullVersion & "'> "
-
 
302
 
-
 
303
      ' End table row
250
      ' End table row
304
      SShtml_pkg_list = SShtml_pkg_list  &"</tr>"
251
      SShtml_pkg_list = SShtml_pkg_list  &"</tr>"
305
 
252
 
306
      rsPkgs.MoveNext
253
      rsPkgs.MoveNext
307
   WEnd
254
   WEnd
308
End Sub
255
End Sub
309
 
256
 
310
' This function deals with a PV_ID list, not a PKG_ID list. Hence, it is used for the ADD Dependencies user operation.
257
' This function deals with a PV_ID list, not a PKG_ID list. Hence, it is used for the ADD Dependencies user operation.
311
' The function was initially based on the Generate_Package_List() function, and then stripped back and reworked to use
258
' The function was initially based on the Generate_Package_List() function, and then stripped back and reworked to use
312
' the result of the Get_Versions_From_Release() function, which now processes PV_ID lists also.
259
' the result of the Get_Versions_From_Release() function, which now processes PV_ID lists also.
313
' It does not display the base version or an extension drop down list box, like the Generate_Package_List() function,
-
 
314
' because it is not needed. Adding a dependency means taking the latest version in the release, there is no choice about
260
' Adding a dependency means taking the latest version in the release, there is no choice about  it.
315
' it.
-
 
316
Sub Generate_Version_List ( NNpv_id_list, SShtml_pkg_list, NNrtag_id, NNadd_type )
261
Sub Generate_Version_List ( NNpv_id_list, SShtml_pkg_list, NNrtag_id, NNadd_type )
317
 
262
 
318
   Dim finalArg
-
 
319
   Dim spanPkgNameId
263
   Dim spanPkgNameId
320
   Dim fullVersion
264
   Dim fullVersion
321
   Dim i
265
   Dim i
322
 
266
 
323
   ' dictionaries and arrays
267
   ' dictionaries and arrays
Line 356... Line 300...
356
      ' Form package name
300
      ' Form package name
357
      SShtml_pkg_list = SShtml_pkg_list & " <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>" _
301
      SShtml_pkg_list = SShtml_pkg_list & " <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>" _
358
                                        & " <span id='" & spanPkgNameId & "'>"& pkg_names(i) &"</span></td>"
302
                                        & " <span id='" & spanPkgNameId & "'>"& pkg_names(i) &"</span></td>"
359
 
303
 
360
 
304
 
361
      If NNadd_type = Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then ' Runtime depencencies do not have constraints on pkg version
-
 
362
         finalArg = "'R'"
-
 
363
      Else ' Build dependencies have some format to follow
-
 
364
         finalArg = "'RisVersionStr'"
-
 
365
      End If
-
 
366
 
-
 
367
      ' Form the (full) Version display field
305
      ' Form the (full) Version display field
368
      SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif'>"
306
      SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif'>"
369
 
307
 
370
      If fullVersion = "" Then
308
      If fullVersion = "" Then
371
         SShtml_pkg_list = SShtml_pkg_list &"<span nowrap class='form_item' name='spanFullVersion" & pkg_ids(i) _
309
         SShtml_pkg_list = SShtml_pkg_list &"<span nowrap class='form_item' name='spanFullVersion" & pkg_ids(i) _
Line 381... Line 319...
381
      ' End table row
319
      ' End table row
382
      SShtml_pkg_list = SShtml_pkg_list  &"</tr>"
320
      SShtml_pkg_list = SShtml_pkg_list  &"</tr>"
383
   Next
321
   Next
384
End Sub
322
End Sub
385
 
323
 
-
 
324
// Create HTML to populate a form selection with versions numbers for a specified
-
 
325
// package. This could be done via AJAX but is currently done when the page is
-
 
326
// rendered.
-
 
327
Function populateVersionList(NNpkg_id)
-
 
328
    Dim rsFind
-
 
329
    Dim Query_String
-
 
330
    Dim aVersions
-
 
331
    Dim objSortHelper
-
 
332
    Dim lastRow, i
-
 
333
    
-
 
334
 
-
 
335
    // First one - Use as a prompt
-
 
336
    populateVersionList = "<option>-- Select Version --</option>"
-
 
337
 
-
 
338
    Query_String = _
-
 
339
	" SELECT DISTINCT pv.pkg_version, pv.dlocked "&_
-
 
340
	"    FROM PACKAGES pkg, package_versions pv"&_
-
 
341
	"   WHERE pkg.pkg_id = pv.pkg_id  AND  pkg.pkg_id = " & NNpkg_id
-
 
342
 
-
 
343
    Set rsFind = OraDatabase.DbCreateDynaset( Query_String, cint(0))
-
 
344
	If rsFind.RecordCount > 0 Then
-
 
345
 
-
 
346
		aVersions = rsFind.GetRows()
-
 
347
		lastRow = UBound( aVersions, 2 )
-
 
348
 
-
 
349
		Set objSortHelper = New SortHelper
-
 
350
 
-
 
351
		' Sort versions
-
 
352
		Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsFind.FieldIndex("pkg_version") )
-
 
353
 
-
 
354
		' Descending order
-
 
355
		For i = lastRow To 0 Step -1
-
 
356
            Dim prefix
-
 
357
            Dim text
-
 
358
 
-
 
359
            text = aVersions( rsFind.FieldIndex("pkg_version"), i )
-
 
360
 
-
 
361
            If aVersions( rsFind.FieldIndex("dlocked"), i ) = "Y" Then
-
 
362
                prefix = "R&nbsp;"
-
 
363
            Else
-
 
364
                prefix = "&nbsp;&nbsp;&nbsp;&nbsp;"
-
 
365
            End If
-
 
366
            
-
 
367
            populateVersionList = populateVersionList &_
-
 
368
                "<option value='"& text &"'>" & prefix & text & "</option>"
-
 
369
 
-
 
370
		Next
-
 
371
		Set objSortHelper = nothing
-
 
372
	End If
-
 
373
 
-
 
374
	rsFind.Close
-
 
375
	Set rsFind = nothing
-
 
376
End Function
386
 
377
 
387
%>
378
%>
388
<%
379
<%
389
If parPv_id <> "" Then
380
If parPv_id <> "" Then
390
   Call Get_Pkg_Info ( parPv_id, NULL )
381
   Call Get_Pkg_Info ( parPv_id, NULL )
Line 398... Line 389...
398
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
389
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
399
<link rel="stylesheet" href="images/navigation.css" type="text/css">
390
<link rel="stylesheet" href="images/navigation.css" type="text/css">
400
<script language="JavaScript" src="images/common.js"></script>
391
<script language="JavaScript" src="images/common.js"></script>
401
<script language="JavaScript" type="text/JavaScript">
392
<script language="JavaScript" type="text/JavaScript">
402
<!--
393
<!--
403
window.onload = function()
-
 
404
{
-
 
405
   if( !isNewPackage() )
-
 
406
      return;
-
 
407
 
-
 
408
   var packageIds = new Array();
-
 
409
   {
-
 
410
      <%
-
 
411
      Dim rsPkgsTmp
-
 
412
      Set rsPkgsTmp = OraDatabase.DbCreateDynaset( Get_Pkg_Names( parPkg_list, parAdd_type ), cint(0))
-
 
413
      While ((NOT rsPkgsTmp.BOF) AND (NOT rsPkgsTmp.EOF))
-
 
414
      %>
-
 
415
         packageIds.push( "<%=rsPkgsTmp("pkg_id")%>" );
-
 
416
         updateVersion("<%=rsPkgsTmp("pkg_id")%>", "<%=rsPkgsTmp("pkg_id")%>");
-
 
417
      <%
-
 
418
         rsPkgsTmp.MoveNext
-
 
419
      Wend
-
 
420
      rsPkgsTmp.Close()
-
 
421
      %>
-
 
422
   }
-
 
423
 
-
 
424
   document.getElementById('tdUseExistingVersion').style.display = 'none';
-
 
425
   document.getElementById('tdCheckBox' + packageIds[0]).style.display = 'none';
-
 
426
}
-
 
427
 
394
 
428
function isNewPackage()
395
window.onload = function()
429
{
-
 
430
   if( "<%=parIsNewPackage%>" == "1" )
-
 
431
      return true;
-
 
432
   return false;
-
 
433
}
-
 
434
 
-
 
435
// checkBoxChanged is only called when adding packages to a release. It is not called when this form is
-
 
436
// being used to add dependencies to a package version in a release.
-
 
437
function checkBoxChanged( pkg_id, pkg_name )
-
 
438
{
396
{
439
   var checkBoxId = "checkBoxExistingVersion" + pkg_id;
397
  checkSeletion(document.getElementById("base_view_id"));
440
 
-
 
441
   var popupURL = "_wform_get_version.asp";
398
   var versionObjectIds = getVersionObjectIds();
442
 
-
 
443
   if( document.getElementById(checkBoxId).checked )
399
   for( var iobj in versionObjectIds )
444
   {
-
 
445
      MM_openBrWindow( popupURL + "?pkg_id=" + pkg_id + "&pkg_name=" + pkg_name,"GetVersion","resizable=yes,width=400,height=400");
-
 
446
 
-
 
447
      document.getElementById('inputVersionBase'       + pkg_id).style.visibility = "hidden";
-
 
448
      document.getElementById('selectVersionExtension' + pkg_id).style.visibility = "hidden";
-
 
449
   }
-
 
450
   else
-
 
451
   {
400
   {
452
      document.getElementById('inputVersionBase'       + pkg_id).style.visibility = "visible";
-
 
453
      document.getElementById('selectVersionExtension' + pkg_id).style.visibility = "visible";
401
      updateVersion(versionObjectIds[iobj]);
454
   }
402
   }
455
 
-
 
456
}
403
}
457
 
404
 
458
// getVersionObjectIds is only called when adding packages to a release. It is not called when this form is
405
// getVersionObjectIds is only called when adding packages to a release.
459
// being used to add dependencies to a package version in a release.
-
 
460
function getVersionObjectIds ()
406
function getVersionObjectIds ()
461
{
407
{
462
   var versionObjectIds = new Array(); // Memory leak?
408
   var versionObjectIds = new Array(); // Memory leak?
463
 
409
 
464
   <%
410
   <%
465
   Dim rsPkgs3, versionObjectId
411
   Dim rsPkgs3, versionObjectId
466
   Set rsPkgs3 = OraDatabase.DbCreateDynaset( Get_Pkg_Names( parPkg_list, parAdd_type ), cint(0))
412
   Set rsPkgs3 = OraDatabase.DbCreateDynaset( Get_Pkg_Names( parPkg_list, parAdd_type ), cint(0))
467
 
413
 
468
   While ((NOT rsPkgs3.BOF) AND (NOT rsPkgs3.EOF))
414
   While ((NOT rsPkgs3.BOF) AND (NOT rsPkgs3.EOF))
469
      versionObjectId = "pkgn" & rsPkgs3("pkg_id")
415
      versionObjectId = rsPkgs3("pkg_id")
470
      %>
416
      %>
471
      versionObjectIds.push( "<%=versionObjectId%>" );
417
      versionObjectIds.push( "<%=versionObjectId%>" );
472
      <%
418
      <%
473
      rsPkgs3.MoveNext
419
      rsPkgs3.MoveNext
474
   Wend
420
   Wend
Line 476... Line 422...
476
   %>
422
   %>
477
 
423
 
478
   return versionObjectIds;
424
   return versionObjectIds;
479
}
425
}
480
 
426
 
481
// CheckVersion is only called when adding packages to a release. It is not called when this form is
427
// CheckVersion is only called when adding packages to a release.
-
 
428
// Called before the form is submitted. Can validate the form
482
// being used to add dependencies to a package version in a release.
429
// Simply tests that all required fields have been entered
483
function checkVersion ()
430
function checkVersion ()
484
{
431
{
485
   var versionObjectIds = new Array();
432
   var isValid = checkSeletion(document.getElementById("base_view_id"));
486
   versionObjectIds = getVersionObjectIds();
433
   var versionObjectIds = getVersionObjectIds();
487
 
-
 
488
   for( var iobj in versionObjectIds )
434
   for( var iobj in versionObjectIds )
489
   {
435
   {
490
      var checkBoxId = versionObjectIds[iobj].replace( /pkgn/, "checkBoxExistingVersion");
-
 
491
      var spanPkgNameId = versionObjectIds[iobj].replace( /pkgn/, "spanPkgName");
436
      if (updateVersion(versionObjectIds[iobj]))
492
 
-
 
493
      var pkgName = document.getElementById(spanPkgNameId).innerHTML;
437
        continue;
494
 
438
 
495
      var fullVersion = document.getElementById(versionObjectIds[iobj]).value;
-
 
496
      var versionBase = fullVersion.replace( /(.*)(\..*)/, "$1");
-
 
497
      var versionExt =  fullVersion.replace( /(.*)(\..*)/, "$2");
-
 
498
 
-
 
499
      var isAutobuild = document.getElementById(checkBoxId).checked;
-
 
500
 
-
 
501
      var isValid = MM_ValidateVersion(pkgName, versionBase, versionExt, isAutobuild, false);
-
 
502
      if (isValid)
439
      isValid = false;
503
      {
-
 
504
         continue;
-
 
505
      }
440
      break;
506
 
-
 
507
      // failed - exit function, returning false for the form.
-
 
508
      document.MM_returnValue = false;
-
 
509
      document.getElementById("ProgressBar").style.visibility = "hidden";
-
 
510
      return false;
-
 
511
   }
441
   }
512
   return true;
-
 
513
}
-
 
514
 
-
 
515
 
-
 
516
//-----------------------------------------------------------------------------------------------------------------------------
-
 
517
// Javascript Function: updateFields
-
 
518
//
-
 
519
// Purpose: This is a function that is called by external javascript to updates fields in form
-
 
520
//
-
 
521
// Arguments: myPkgId (integer) - Package number
-
 
522
// myPv_id (integer) - package version number (not used in form_add_pkg_versions.asp implementation of this function)
-
 
523
// newVersion (string) - output value of the external javascript.  This is the new version
-
 
524
// cancelled (boolean) - true if user cancelled popup, else false
-
 
525
//
-
 
526
// Returns: nothing
-
 
527
//
-
 
528
// Notes: this is called by the popup window coded in _wform_get_version.asp when the user clicks 'submit' in that popup window.  An equivalent function also
-
 
529
// exists in form_edit_deps.asp for when it activates the code in _wform_get_version.asp.
-
 
530
function updateFields( myPv_id, myPkgId, newVersion, cancelled )
-
 
531
{
-
 
532
   // if user is cancelling the popup, or if the version we have got from the popup is empty...
-
 
533
   if (cancelled || newVersion == "")
-
 
534
   {
-
 
535
      // uncheck the "Use Existing Version" checkbox, and re-enable the version number and extension inputs
-
 
536
      var checkBoxId = "checkBoxExistingVersion" + myPkgId;
-
 
537
 
442
 
538
      document.getElementById(checkBoxId).checked = false;
443
   if (isValid) {
539
 
-
 
540
      document.getElementById('inputVersionBase'       + myPkgId).style.visibility = "visible";
-
 
541
      document.getElementById('selectVersionExtension' + myPkgId).style.visibility = "visible";
444
    MM_showProgressBar();
542
   }
445
   }
543
   else
446
   else
544
   {
447
   {
545
      // Note here we use myPkgId as the spanFullVersion span is associated with a pkg_id rather than a pv_id
448
      // failed - exit function, returning false for the form.
546
      document.getElementById('spanFullVersion' + myPkgId).innerHTML = newVersion;
449
      document.MM_returnValue = false;
547
 
-
 
548
       var fullVersion = document.getElementById('spanFullVersion' + myPkgId).innerHTML;
-
 
549
      var versionBase = fullVersion.replace( /(.*)\..*/, "$1");
450
      MM_hideProgressBar();
550
      var versionExt = fullVersion.replace( /(.*)\./, ".");
451
      alert ("Complete all selections");
551
 
-
 
552
      document.getElementById('inputVersionBase' + myPkgId).value = versionBase;
-
 
553
      document.getElementById('selectVersionExtension' + myPkgId).value = versionExt;
-
 
554
      document.getElementById('pkgn' + myPkgId).value = fullVersion;
452
      return false;
555
   }
453
   }
-
 
454
   return true;
556
}
455
}
557
 
456
 
558
// updateVersion is only called when adding packages to a release. It is not called when this form is
457
// updateVersion is only called when adding packages to a release.
559
// being used to add dependencies to a package version in a release.
-
 
560
function updateVersion( myPkgId, myParPkg_list )
458
function updateVersion( myPkgId, myParPkg_list )
561
{
459
{
562
   document.getElementById("spanFullVersion" + myPkgId).innerHTML =
-
 
563
   document.getElementById("inputVersionBase"       + myPkgId).value +
-
 
564
   document.getElementById("selectVersionExtension" + myPkgId).value;
-
 
565
 
-
 
566
   document.getElementById("pkgn"                   + myPkgId).value =
460
    return checkSeletion(document.getElementById("pkgn" + myPkgId));
567
   document.getElementById("inputVersionBase"       + myPkgId).value +
-
 
568
   document.getElementById("selectVersionExtension" + myPkgId).value;
-
 
569
}
461
}
570
 
462
 
571
//-->
463
//-->
572
</script>
464
</script>
573
<!-- DROPDOWN MENUS -->
465
<!-- DROPDOWN MENUS -->
Line 647... Line 539...
647
                                 <tr>
539
                                 <tr>
648
                                    <td colspan="2" width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">To Base View</td>
540
                                    <td colspan="2" width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">To Base View</td>
649
                                 </tr>
541
                                 </tr>
650
                                 <tr>
542
                                 <tr>
651
                                    <td colspan="2" width="1%" nowrap background="images/bg_form_lightgray.gif">
543
                                    <td colspan="2" width="1%" nowrap background="images/bg_form_lightgray.gif">
652
                                       <select name="base_view_id" id="base_view_id" class="form_item">
544
                                       <select name="base_view_id" id="base_view_id" class="form_item" onblur="checkSeletion(this);" onchange="checkSeletion(this);">
653
                                          <option></option>
545
                                          <option></option>
654
                                          <%Call Get_All_Base_Views( parBase_view_id, parPkg_list )%>
546
                                          <%Call Get_All_Base_Views( parBase_view_id, parPkg_list )%>
655
                                       </select>
547
                                       </select>
656
 
548
 
657
                                       <br>
549
                                       <br>
Line 699... Line 591...
699
                                    <table width="100%" border="0" cellspacing="1" cellpadding="2">
591
                                    <table width="100%" border="0" cellspacing="1" cellpadding="2">
700
                                       <tr>
592
                                       <tr>
701
                                          <td background="images/bg_form_lightbluedark.gif" nowrap width="10%" class="form_field">Package Name
593
                                          <td background="images/bg_form_lightbluedark.gif" nowrap width="10%" class="form_field">Package Name
702
                                             <img src="images/h_trsp_dot.gif" width="1" height="20" align="absmiddle">
594
                                             <img src="images/h_trsp_dot.gif" width="1" height="20" align="absmiddle">
703
                                          </td>
595
                                          </td>
704
                                          <% 'Do not display the VersionBase, VersionExtension, and Use Existing Version columns if we are adding dependencies
596
                                          <td background="images/bg_form_lightbluedark.gif" nowrap width="40%" class="form_field">Version
705
                                          If parAdd_type <> Cstr(enum_ADD_DEPENDENCIES) AND parAdd_type <> Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then%>
597
                                          <%If parAdd_type <> Cstr(enum_ADD_DEPENDENCIES) AND parAdd_type <> Cstr(enum_ADD_RUNTIME_DEPENDENCIES) Then%>
706
                                             <td background="images/bg_form_lightbluedark.gif" nowrap width="10%" class="form_field">Version Base</td>
-
 
707
                                             <td background="images/bg_form_lightbluedark.gif" nowrap width="10%" class="form_field">Version Extension</td>
-
 
708
                                             <td id='tdUseExistingVersion' background="images/bg_form_lightbluedark.gif" nowrap class="form_field" width="30%">
-
 
709
                                                Use Existing Version
-
 
710
                                                <a onmouseout="formTips.hide()" onmouseover="formTips.show('existingVersion')" href="javascript:;">
598
                                            <a onmouseout="formTips.hide()" onmouseover="formTips.show('existingVersion')" href="javascript:;">
711
                                                   <img width="12" hspace="2" height="12" border="0" align="absmiddle" src="images/i_help.gif" />
599
                                               <img width="12" hspace="2" height="12" border="0" align="absmiddle" src="images/i_help.gif" />
712
                                                </a>
-
 
713
                                             </td>
600
                                            </a>
714
                                          <%End If%>
601
                                          <%End If%>
715
 
-
 
716
                                          <td background="images/bg_form_lightbluedark.gif" nowrap width="40%" class="form_field">Version</td>
602
                                          </td>
717
                                       </tr>
603
                                       </tr>
718
                                       <%=HTML_pkg_list%>
604
                                       <%=HTML_pkg_list%>
719
                                       <tr>
605
                                       <tr>
720
                                          <td nowrap><img src="images/h_trsp_dot.gif" width="120" height="1"></td>
606
                                          <td nowrap><img src="images/h_trsp_dot.gif" width="120" height="1"></td>
721
                                          <td></td>
607
                                          <td></td>