<% '=============================================================== ' Version Browser '=============================================================== %> <% '------------ Variable Definition ------------- Dim parFLpkg_version, parFLuser_name Dim imgLock, fieldRelease_Date, fieldReleased_By, fieldDownloadFullReleaseNotes Dim rsVB Dim imgPointer Dim URLstring Dim pvidName Dim idxName Dim filterInUse Dim hideRipple Dim rippleFilter Dim DestroyPackage Dim CanDestroyProjectPackage Dim CanDestroyPackage '------------ Constants Declaration ----------- Const IMG_PONTER = "" Const IMG_OFFICIAL = "" Const IMG_PENDING = "" Const IMG_NOT_OFFICIAL = "" Const IMG_NOT_BUILDABLE = "" Const IMG_DOWNLOAD = "Download full release notes." '------------ Variable Init ------------------- If Request("filter_reset") <> "" Then parFLpkg_version = "*" parFLuser_name = "*" filterInUse = FALSE Else parFLpkg_version = RequestDefault( "FLpkg_version", "*" ) parFLuser_name = RequestDefault( "FLuser_name","*" ) filterInUse = Is_Filter_In_Use ( "FLpkg_version, FLuser_name" ) End If If Request("hideRipple") = "True" Then hideRipple = True rippleFilter = "AND PV.BUILD_TYPE != 'Y'" Else hideRipple = False rippleFilter = "" End If '---------------------------------------------- %> <% '----------------------------------------------------------------------------------------------------------------------------------- Function Get_All_Versions ( nPkg_id ) Get_All_Versions = _ " SELECT DISTINCT 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," &_ " PV.BUILD_TYPE," &_ " pv.CREATOR_ID," &_ " pv.OWNER_ID," &_ " pv.BUILD_TYPE," &_ " NVL2(rc.rtag_id,1,0) as inuse," &_ " trunc(SYSDATE - pv.CREATED_STAMP + 0.5) as age" &_ " FROM PACKAGE_VERSIONS PV," &_ " USERS USR,"&_ " RELEASE_CONTENT rc" &_ " WHERE PV.MODIFIER_ID = USR.USER_ID(+) " &_ " AND PV.PKG_ID = :PKG_ID" &_ " AND pv.pv_id = rc.pv_id(+)" &_ " /*-- Manual Filter --*/" &_ " "& Construct_Filter ( parFLpkg_version, "pv.pkg_version" ) &_ " "& Construct_Filter ( parFLuser_name, "usr.user_name" ) &_ " "& rippleFilter &_ " /*------------------*/" 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 '----------------------------------------------------------------------------------------------------------------------------------- %>
<% Dim bEnableUse : bEnableUse = FALSE If Request("rtag_id") = "" OR _ Request("pv_id") = "" OR _ parOLDpv_id = ParPv_id OR _ bIsPatch OR _ (NOT bCanInsertPkg) OR _ (NOT objAccessControl.UserLogedIn) OR _ (NOT releaseIsWritable(ReleaseMode)) _ Then bEnableUse = FALSE Else bEnableUse = TRUE End If If bEnableUse Then %> <% Response.write "" Else Response.write "" End If Response.write "" If filterInUse Then Response.write "" Else Response.write "" End If Response.write "" Response.write "" Response.write "" If hideRipple Then Response.write "" Else Response.write "" End If Response.write "" %> Open In Parent Window. Close this window.
<%=sPkg_Name%>
<% Dim aVersions, lastRow, i, objSortHelper, idx, rowClass 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") ) CanDestroyProjectPackage = canShowControlInProject ( "DestroyPackage" ) ' Descending order idx = 0 For i = lastRow To 0 Step -1 idx = idx + 1 %> <% ' Highlight row case imgPointer = "" rowClass = "pointer selectVersion " If CStr( aVersions( rsVB.FieldIndex("pv_id"), i ) ) = parPv_id Then rowClass = rowClass & " highlightRow" imgPointer = IMG_PONTER End If ' Official/Unofficial case imgLock = IMG_NOT_OFFICIAL 'fieldRelease_Date = "" 'fieldReleased_By = "" If (aVersions( rsVB.FieldIndex("build_type"), i ) = "U") Then imgLock = IMG_NOT_BUILDABLE ElseIf (aVersions( rsVB.FieldIndex("dlocked"), i ) = "Y") Then imgLock = IMG_OFFICIAL ElseIf (aVersions( rsVB.FieldIndex("dlocked"), i ) = "A") Then imgLock = IMG_PENDING End If fieldRelease_Date = DisplayShortDateTime ( aVersions( rsVB.FieldIndex("modified_stamp"), i ) ) fieldReleased_By = emailField(enum_imgUser & aVersions( rsVB.FieldIndex("full_name"), i ), aVersions( rsVB.FieldIndex("user_email"), 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 = "" End If pvidName = "PVID_"& aVersions( rsVB.FieldIndex("pv_id"), i ) idxName = "IDX_" & idx If aVersions( rsVB.FieldIndex("is_patch"), i ) = "Y" Then rowClass = rowClass & " isaPatch" End If ' User can try to delete package iff ' Have suffiecient access (unusual) ' They created it or own it ' The version is not in use by any release (allow to be in pending or WIP) ' [Not at the moment] The package was created less than xxxx days ago ' Is not locked or [Not at the moment] Approved for Autobuild CanDestroyPackage = CanDestroyProjectPackage If NOT CanDestroyPackage Then If (objAccessControl.UserId = aVersions( rsVB.FieldIndex("CREATOR_ID"), i )) OR (objAccessControl.UserId = aVersions( rsVB.FieldIndex("OWNER_ID"), i ))Then If aVersions( rsVB.FieldIndex("inuse"), i ) = 0 Then 'If aVersions( rsVB.FieldIndex("age") , i ) < 1000 Then If aVersions( rsVB.FieldIndex("dlocked"), i ) <> "Y" Then 'If aVersions( rsVB.FieldIndex("dlocked"), i ) <> "A" Then CanDestroyPackage = true 'End If End If 'End If End If End If End If ' Set destroy package action If CanDestroyPackage Then DestroyPackage = " "&_ " " Else DestroyPackage = "" End If %> <% Next End If %>
  Version  
Last Mod. Date   Reason for this version Last Modified  
<%=imgPointer%> <%=imgLock%> <%=aVersions( rsVB.FieldIndex("pkg_version"), i )%> <%=fieldRelease_Date%> <%=NewLine_To_BR ( To_HTML( aVersions( rsVB.FieldIndex("comments"), i ) ) )%> <%=fieldReleased_By%> <%=fieldDownloadFullReleaseNotes%> <%=DestroyPackage%>