Subversion Repositories DevTools

Rev

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

Rev 3616 Rev 3959
Line 41... Line 41...
41
'
41
'
42
' Notes: This only returns as a string the <option> bits of the select box - the rest of the html has to be done elsewhere
42
' Notes: This only returns as a string the <option> bits of the select box - the rest of the html has to be done elsewhere
43
Function getExtensionSelectText (defaultExtension, isNewVersion)
43
Function getExtensionSelectText (defaultExtension, isNewVersion)
44
	Dim selectedString
44
	Dim selectedString
45
	Dim selectedFound
45
	Dim selectedFound
46
	Dim extArray
-
 
47
	Dim ext
46
	Dim cmt
48
	Dim dot_ext
47
	Dim dot_ext
49
 
48
    Dim rsQry
50
	' Define the standard set of extensions that we wish everyone to use. This is the one and only place where these should be
-
 
51
	' defined. Try to keep this in alphabetical order.
49
    Dim attrCots
52
  extArray = array("bei", "bes" , "bkk" , "coct", "cots", "cr"  , "dev" , "ebr", "eng", "isr", "lvs", "mas", "mbu", "mlc",_
-
 
53
                   "ncc", "ndl" , "nzs" , "osl" , "oslo", "oso" , "pmb", "rm" , "rom", "sea", "sf" , "sfo",_
-
 
54
                   "sg" , "sls" , "ssts", "ssw" , "syd" , "tool", "uk" , "uta", "vps", "vss", "vtk", "wdc")
50
    Dim isCots
55
 
51
 
56
	getExtensionSelectText = ""
52
	getExtensionSelectText = ""
57
	selectedFound = false
53
	selectedFound = false
58
    If defaultExtension = "" Then
54
    If defaultExtension = "" Then
59
        defaultExtension = ".cr"
55
        defaultExtension = ".cr"
60
    End If
56
    End If
61
 
57
 
62
	' Form the <option> bits of the select box, drawing upon the extArray() content one element at a time
-
 
63
	For each ext in extArray
-
 
64
 
58
 
-
 
59
	Set rsQry = OraDatabase.DbCreateDynaset( "SELECT EXT_NAME,UCOMMENT,IS_COTS FROM PROJECT_EXTENTIONS pe WHERE pe.IS_VISIBLE='Y' ORDER BY pe.EXT_NAME", ORADYN_DEFAULT )
-
 
60
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
-
 
61
 
-
 
62
	' Form the <option> bits of the select box, drawing upon the PROJECT_EXTENTIONS contents one element at a time
65
		dot_ext = "." & ext
63
        dot_ext =  rsQry("EXT_NAME")
66
 
64
 
-
 
65
        ' Append comment with a nice separator
-
 
66
        cmt =  rsQry("UCOMMENT")
-
 
67
        if cmt <> "" Then
-
 
68
            cmt = " - " & cmt
-
 
69
        end if
-
 
70
        
67
		selectedString = ""
71
		selectedString = ""
68
		If dot_ext = defaultExtension Then
72
		If dot_ext = defaultExtension Then
69
			selectedString = "selected"
73
			selectedString = "selected"
70
			selectedFound = true
74
			selectedFound = true
71
		End If
75
		End If
72
 
76
 
-
 
77
        ' Store IsCots information in a custom attribute
-
 
78
        attrCots = ""
-
 
79
        isCots =  rsQry("IS_COTS")
-
 
80
        if isCots = "Y" Then
-
 
81
            attrCots = " isCOTS=""Y"""
-
 
82
        end if
-
 
83
 
73
		getExtensionSelectText = getExtensionSelectText & "<option value=""" & dot_ext & """ " & selectedString & ">" & dot_ext & "</option>"
84
		getExtensionSelectText = getExtensionSelectText & "<option value=""" & dot_ext & """ " & selectedString & attrCots & ">" & dot_ext & cmt & "</option>"
-
 
85
	    rsQry.MoveNext()
74
	Next
86
	Wend
-
 
87
	rsQry.Close()
-
 
88
	Set rsQry = nothing
75
 
89
 
76
	' If we are reversioning a package version (isNewVersion = false), and we did not find an extension in the standard list
90
	' If we are reversioning a package version (isNewVersion = false), and we did not find an extension in the standard list
77
	' that matched the existing version's extension, add the existing package version extension to the list (if it is not
91
	' that matched the existing version's extension, add the existing package version extension to the list (if it is not
78
	' null or empty) and select it.
92
	' null or empty) and select it.
79
	If isNewVersion = false AND selectedFound = false AND NOT IsNull(defaultExtension) AND defaultExtension <> "" Then
93
	If isNewVersion = false AND selectedFound = false AND NOT IsNull(defaultExtension) AND defaultExtension <> "" Then