Rev 3865 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%'=====================================================' File description'=====================================================' _drawExtensionSelectBox.asp'' Last edited by Haydon Knight June 2008'' This file contains a utility subroutine 'drawExtensionSelectBox()' that is' called by _form_new_version_page.asp and _wform_rename_version.asp' to help draw a select box of possible extensions.''=====================================================' Subroutines and functions'=====================================================''-----------------------------------------------------------------------------------------------------------------------------' Subroutine: drawExtensionSelectBox()'' Purpose: Writes out html options for a select box of possible package extensioms'' Arguments: defaultExtension - default extension to have selected (usually objPkgInfo.Item("v_ext"))' isNewVersion - true if a new version is being created, else false'' Returns: none'' Notes: This only writes out the <option> bits of the select box - the rest of the html has to be done elsewhereSub drawExtensionSelectBox (defaultExtension, isNewVersion)Dim optionTextoptionText = getExtensionSelectText( defaultExtension, isNewVersion )Response.write( optionText )End Sub'-----------------------------------------------------------------------------------------------------------------------------' Function: getExtensionSelectText()'' Purpose: Returns <option> text for a select box of possible package extensioms'' Arguments: defaultExtension - default extension to have selected (usually objPkgInfo.Item("v_ext"))' isNewVersion - true if a new version is being created, else false' Returns: text'' Notes: This only returns as a string the <option> bits of the select box - the rest of the html has to be done elsewhereFunction getExtensionSelectText (defaultExtension, isNewVersion)Dim selectedStringDim selectedFoundDim cmtDim dot_extDim rsQryDim attrCotsDim isCotsgetExtensionSelectText = ""selectedFound = falseIf defaultExtension = "" ThendefaultExtension = ".cr"End IfSet 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 )While (NOT rsQry.BOF) AND (NOT rsQry.EOF)' Form the <option> bits of the select box, drawing upon the PROJECT_EXTENTIONS contents one element at a timedot_ext = rsQry("EXT_NAME")' Append comment with a nice separatorcmt = rsQry("UCOMMENT")if cmt <> "" Thencmt = " - " & cmtend ifselectedString = ""If dot_ext = defaultExtension ThenselectedString = "selected"selectedFound = trueEnd If' Store IsCots information in a custom attributeattrCots = ""isCots = rsQry("IS_COTS")if isCots = "Y" ThenattrCots = " isCOTS=""Y"""end ifgetExtensionSelectText = getExtensionSelectText & "<option value=""" & dot_ext & """ " & selectedString & attrCots & ">" & dot_ext & cmt & "</option>"rsQry.MoveNext()WendrsQry.Close()Set rsQry = nothing' If we are reversioning a package version (isNewVersion = false), and we did not find an extension in the standard list' that matched the existing version's extension, add the existing package version extension to the list (if it is not' null or empty) and select it.If isNewVersion = false AND selectedFound = false AND NOT IsNull(defaultExtension) AND defaultExtension <> "" ThengetExtensionSelectText = getExtensionSelectText & "<option value=""" & defaultExtension & """ " & "selected" & ">" & defaultExtension & "</option>"End IfEnd Function%>