<% '=============================================================== ' Version Browser '=============================================================== %> <% '------------ Variable Definition ------------- Dim parFLpkg_version, parFLuser_name Dim imgLock, fieldRelease_Date, fieldReleased_By, fieldDownloadFullReleaseNotes Dim rsVB Dim rowColor, imgPointer Dim URLstring Dim anchorName Dim filterInUse Dim DestroyPackage Dim CanDestroyPackage '------------ Constants Declaration ----------- Const IMGBG_ROW_HI = "background='images/bg_row_hi.gif'" Const IMGBG_ROW = "bgcolor='#FFFFFF'" Const IMG_PONTER = "" Const IMG_OFFICIAL = "Package is official" Const IMG_NOT_OFFICIAL = "" Const IMG_DOWNLOAD = "Download full release notes." '------------ Variable Init ------------------- If Request("filter_reset") <> "" Then parFLpkg_version = "*" parFLuser_name = "*" filterInUse = FALSE Else parFLpkg_version = Request( "FLpkg_version" ) parFLuser_name = Request( "FLuser_name" ) filterInUse = Is_Filter_In_Use ( "FLpkg_version, FLuser_name" ) End If '---------------------------------------------- %> <% '----------------------------------------------------------------------------------------------------------------------------------- Function Get_All_Versions ( nPkg_id ) Get_All_Versions = _ " SELECT PV.PV_ID, PV.PKG_VERSION, PV.DLOCKED, PV.MODIFIED_STAMP, USR.FULL_NAME, usr.user_name, USR.USER_EMAIL, PV.COMMENTS, PV.PKG_LABEL, PV.IS_PATCH, PV.RELEASE_NOTES_INFO "&_ " FROM PACKAGE_VERSIONS PV, USERS USR "&_ " WHERE PV.MODIFIER_ID = USR.USER_ID "&_ " AND PV.PKG_ID = :PKG_ID"&_ " /*-- Manual Filer --*/"&_ " "& Construct_Filter ( parFLpkg_version, "pv.pkg_version" ) &_ " "& Construct_Filter ( parFLuser_name, "usr.user_name" ) &_ " /*------------------*/" Get_All_Versions = Replace( Get_All_Versions, ":PKG_ID", nPkg_id) End Function '----------------------------------------------------------------------------------------------------------------------------------- Function Construct_Filter ( sPar_val, sCol_name ) Select Case sPar_val Case Empty Construct_Filter = "AND "& sCol_name &" IS NULL" Case "*" Construct_Filter = "" Case Else If InStr( sPar_val, "*") > 0 Then ' Asterisk found in string. Use LIKE Construct_Filter = "AND "& sCol_name &" LIKE '"& Replace( sPar_val, "*", "%" ) &"'" Else ' No asterisk. Use = Construct_Filter = "AND "& sCol_name &" = '"& sPar_val &"'" End If End Select End Function '----------------------------------------------------------------------------------------------------------------------------------- Function Is_Filter_In_Use ( sFilters ) Dim filters, filterName Is_Filter_In_Use = FALSE filters = Split( Replace( sFilters, " ", "" ), "," ) For Each filterName In filters If Request( filterName ) <> "*" Then Is_Filter_In_Use = TRUE Exit For End If Next End Function '----------------------------------------------------------------------------------------------------------------------------------- %>
<% If Request("rtag_id") = "" OR _ Request("pv_id") = "" OR _ bIsPatch OR _ (NOT objAccessControl.UserLogedIn) OR _ ( NOT objAccessControl.IsDataVisible ("PROJECTS", DB_PROJ_ID, "EditProjects") ) OR _ (ReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE) OR _ (ReleaseMode = enumDB_RELEASE_IN_CCB_MODE) _ Then 'Response.write "HERE"& Request("rtag_id") Response.write "" Else If pkgInfoHash.Item("can_edit_in_project") = "1" OR _ objAccessControl.IsVisible("EditPackageInExternalProjects") _ Then Response.write "Use this version in project release." End If End If Response.write "" If filterInUse Then Response.write "" Else Response.write "" End If Response.write "Remove filter" %> Open In Parent Window. Close this window.
<%=sPkg_Name%>
<% Dim aVersions, lastRow, i, objSortHelper Set rsVB = OraDatabase.DbCreateDynaset( Get_All_Versions ( parPkg_id ), cint(0)) ' Descending order If rsVB.RecordCount > 0 Then aVersions = rsVB.GetRows() lastRow = UBound( aVersions, 2 ) Set objSortHelper = New SortHelper ' Sort versions Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsVB.FieldIndex("pkg_version") ) DestroyPackage = "" CanDestroyPackage = objAccessControl.IsVisible ( "DestroyPackage" ) ' Descending order For i = lastRow To 0 Step -1 %> <% ' Highlight row case rowColor = IMGBG_ROW imgPointer = "" If CStr( aVersions( rsVB.FieldIndex("pv_id"), i ) ) = parPv_id Then rowColor = IMGBG_ROW_HI imgPointer = IMG_PONTER End If ' Official/Unofficial case imgLock = IMG_NOT_OFFICIAL 'fieldRelease_Date = "" 'fieldReleased_By = "" If (aVersions( rsVB.FieldIndex("dlocked"), i ) = "Y") OR (aVersions( rsVB.FieldIndex("dlocked"), i ) = "A") Then imgLock = IMG_OFFICIAL End If fieldRelease_Date = EuroDateTime ( aVersions( rsVB.FieldIndex("modified_stamp"), i ) ) fieldReleased_By = ""& aVersions( rsVB.FieldIndex("full_name"), i ) &" <"& aVersions( rsVB.FieldIndex("user_email"), i ) &">"& aVersions( rsVB.FieldIndex("user_name"), i ) &"" ' Full Release Notes availability fieldDownloadFullReleaseNotes = "" If NOT IsNull( aVersions( rsVB.FieldIndex("release_notes_info"), i ) ) OR ( InStr( aVersions( rsVB.FieldIndex("release_notes_info"), i ), "MGS:") < 1) Then fieldDownloadFullReleaseNotes = "Download full release notes." End If anchorName = "ANC_"& aVersions( rsVB.FieldIndex("pv_id"), i ) If aVersions( rsVB.FieldIndex("is_patch"), i ) = "Y" Then URLstring = "_wform_versions_history_release_notes.asp?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName Else URLstring = scriptName &"?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName End If ' Set destroy package action If CanDestroyPackage Then DestroyPackage = "" End If %> > <% Next End If %>
  Version  
Last Mod. Date   Reason for this version Last Modified  
<%=imgPointer%> ><%=imgLock%> ><%=aVersions( rsVB.FieldIndex("pkg_version"), i )%> class="form_item"><%=fieldRelease_Date%> class="form_item"><%=NewLine_To_BR ( To_HTML( aVersions( rsVB.FieldIndex("comments"), i ) ) )%> class="form_item"><%=fieldReleased_By%> ><%=fieldDownloadFullReleaseNotes%> ><%=DestroyPackage%>