| 119 |
ghuddy |
1 |
<%
|
|
|
2 |
'===============================================================
|
|
|
3 |
' Version Browser
|
|
|
4 |
'===============================================================
|
|
|
5 |
%>
|
|
|
6 |
<!--#include file="class/classSortHelper.asp"-->
|
|
|
7 |
<%
|
|
|
8 |
'------------ Variable Definition -------------
|
|
|
9 |
Dim parFLpkg_version, parFLuser_name
|
|
|
10 |
Dim imgLock, fieldRelease_Date, fieldReleased_By, fieldDownloadFullReleaseNotes
|
|
|
11 |
Dim rsVB
|
|
|
12 |
Dim rowColor, imgPointer
|
|
|
13 |
Dim URLstring
|
|
|
14 |
Dim anchorName
|
|
|
15 |
Dim filterInUse
|
|
|
16 |
Dim DestroyPackage
|
|
|
17 |
Dim CanDestroyPackage
|
|
|
18 |
'------------ Constants Declaration -----------
|
|
|
19 |
Const IMGBG_ROW_HI = "background='images/bg_row_hi.gif'"
|
|
|
20 |
Const IMGBG_ROW = "bgcolor='#FFFFFF'"
|
|
|
21 |
Const IMG_PONTER = "<img src='images/i_pointer.gif' width='6' height='11' hspace='3'>"
|
|
|
22 |
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
|
|
|
23 |
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2'>"
|
|
|
24 |
Const IMG_DOWNLOAD = "<img src='images/i_download_small.gif' alt='Download full release notes.' width='16' height='16' hspace='2' border='0'>"
|
|
|
25 |
'------------ Variable Init -------------------
|
|
|
26 |
If Request("filter_reset") <> "" Then
|
|
|
27 |
parFLpkg_version = "*"
|
|
|
28 |
parFLuser_name = "*"
|
|
|
29 |
filterInUse = FALSE
|
|
|
30 |
Else
|
|
|
31 |
parFLpkg_version = Request( "FLpkg_version" )
|
|
|
32 |
parFLuser_name = Request( "FLuser_name" )
|
|
|
33 |
filterInUse = Is_Filter_In_Use ( "FLpkg_version, FLuser_name" )
|
|
|
34 |
End If
|
|
|
35 |
'----------------------------------------------
|
|
|
36 |
%>
|
|
|
37 |
<%
|
|
|
38 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
39 |
Function Get_All_Versions ( nPkg_id )
|
|
|
40 |
Get_All_Versions = _
|
|
|
41 |
" 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 "&_
|
|
|
42 |
" FROM PACKAGE_VERSIONS PV, USERS USR "&_
|
|
|
43 |
" WHERE PV.MODIFIER_ID = USR.USER_ID "&_
|
|
|
44 |
" AND PV.PKG_ID = :PKG_ID"&_
|
|
|
45 |
" /*-- Manual Filer --*/"&_
|
|
|
46 |
" "& Construct_Filter ( parFLpkg_version, "pv.pkg_version" ) &_
|
|
|
47 |
" "& Construct_Filter ( parFLuser_name, "usr.user_name" ) &_
|
|
|
48 |
" /*------------------*/"
|
|
|
49 |
|
|
|
50 |
Get_All_Versions = Replace( Get_All_Versions, ":PKG_ID", nPkg_id)
|
|
|
51 |
End Function
|
|
|
52 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
53 |
Function Construct_Filter ( sPar_val, sCol_name )
|
|
|
54 |
Select Case sPar_val
|
|
|
55 |
Case Empty
|
|
|
56 |
Construct_Filter = "AND "& sCol_name &" IS NULL"
|
|
|
57 |
|
|
|
58 |
Case "*"
|
|
|
59 |
Construct_Filter = ""
|
|
|
60 |
|
|
|
61 |
Case Else
|
|
|
62 |
If InStr( sPar_val, "*") > 0 Then
|
|
|
63 |
' Asterisk found in string. Use LIKE
|
|
|
64 |
Construct_Filter = "AND "& sCol_name &" LIKE '"& Replace( sPar_val, "*", "%" ) &"'"
|
|
|
65 |
Else
|
|
|
66 |
' No asterisk. Use =
|
|
|
67 |
Construct_Filter = "AND "& sCol_name &" = '"& sPar_val &"'"
|
|
|
68 |
End If
|
|
|
69 |
|
|
|
70 |
End Select
|
|
|
71 |
|
|
|
72 |
End Function
|
|
|
73 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
74 |
Function Is_Filter_In_Use ( sFilters )
|
|
|
75 |
Dim filters, filterName
|
|
|
76 |
Is_Filter_In_Use = FALSE
|
|
|
77 |
|
|
|
78 |
filters = Split( Replace( sFilters, " ", "" ), "," )
|
|
|
79 |
|
|
|
80 |
For Each filterName In filters
|
|
|
81 |
If Request( filterName ) <> "*" Then
|
|
|
82 |
Is_Filter_In_Use = TRUE
|
|
|
83 |
Exit For
|
|
|
84 |
End If
|
|
|
85 |
Next
|
|
|
86 |
|
|
|
87 |
End Function
|
|
|
88 |
'-----------------------------------------------------------------------------------------------------------------------------------
|
|
|
89 |
%>
|
|
|
90 |
<!--------------- ACTION BUTTONS -------------------------->
|
|
|
91 |
<form name="filter" method="get" action="<%=scriptName%>">
|
|
|
92 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
93 |
<tr>
|
|
|
94 |
<td width="1" valign="middle" background="images/bg_action_norm.gif"><img src="images/spacer.gif" width="5" height="35"></td>
|
|
|
95 |
<td width="100%" valign="middle" background="images/bg_action_norm.gif"><%
|
|
|
96 |
If Request("rtag_id") = "" OR _
|
|
|
97 |
Request("pv_id") = "" OR _
|
|
|
98 |
bIsPatch OR _
|
|
|
99 |
(NOT objAccessControl.UserLogedIn) OR _
|
|
|
100 |
( NOT objAccessControl.IsDataVisible ("PROJECTS", DB_PROJ_ID, "EditProjects") ) OR _
|
| 4084 |
dpurdie |
101 |
(ReleaseMode = enumDB_RELEASE_IN_CLOSED_MODE) OR _
|
|
|
102 |
(ReleaseMode = enumDB_RELEASE_IN_ARCHIVE_MODE) OR _
|
| 119 |
ghuddy |
103 |
(ReleaseMode = enumDB_RELEASE_IN_CCB_MODE) _
|
|
|
104 |
Then
|
|
|
105 |
'Response.write "HERE"& Request("rtag_id")
|
|
|
106 |
Response.write "<img src='images/abtn_use_this_version_off.gif' width='108' height='26' hspace='1' border='0'>"
|
|
|
107 |
|
|
|
108 |
Else
|
|
|
109 |
|
|
|
110 |
|
|
|
111 |
If pkgInfoHash.Item("can_edit_in_project") = "1" OR _
|
|
|
112 |
objAccessControl.IsVisible("EditPackageInExternalProjects") _
|
|
|
113 |
|
|
|
114 |
Then
|
|
|
115 |
Response.write "<a href='"& scriptName &"?"& Persists_Query_String( "action=true" ) &"' onClick='return confirmAction(""You are about to insert "& sPkg_Name &" "& sPkg_Version &" into a project release. \nDo you want to proceed?"");'><img src='images/abtn_use_this_version.gif' alt='Use this version in project release.' width='107' height='25' hspace='1' border='0'></a>"
|
|
|
116 |
End If
|
|
|
117 |
|
|
|
118 |
|
|
|
119 |
End If
|
|
|
120 |
|
|
|
121 |
Response.write "<img src='images/spacer.gif' width='25' height='25'>"
|
|
|
122 |
If filterInUse Then
|
|
|
123 |
Response.write "<input type='image' name='btn' src='images/abtn_filter_on.gif' width='25' height='25' border='0' alt='Apply filter. (Filter is in use!)'>"
|
|
|
124 |
Else
|
|
|
125 |
Response.write "<input type='image' name='btn' src='images/abtn_filter.gif' width='25' height='25' border='0' alt='Apply filter'>"
|
|
|
126 |
End If
|
|
|
127 |
Response.write "<a href='"& scriptName &"?"& Persists_Query_String( "filter_reset=true" ) &"'><img src='images/abtn_remove_filter.gif' alt='Remove filter' width='25' height='25' hspace='2' border='0'></a>"
|
|
|
128 |
%></td>
|
|
|
129 |
<td width="1" valign="middle" background="images/bg_action_norm.gif"><a href="javascript:;" onClick="window.opener.document.location='dependencies.asp?pv_id=<%=parPv_id%>';self.close();"><img src="images/abtn_open.gif" width="46" height="25" hspace="5" border="0" alt="Open In Parent Window."></a></td>
|
|
|
130 |
<td width="1" valign="middle" background="images/bg_action_norm.gif"><a href="javascript:;" onClick="self.close();"><img src="images/abtn_close.gif" width="46" height="25" hspace="5" border="0" alt="Close this window."></a></td>
|
|
|
131 |
</tr>
|
|
|
132 |
</table>
|
|
|
133 |
<!--------------------- CAPTION ---------------------------->
|
|
|
134 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
135 |
<tr>
|
|
|
136 |
<td class="lbox_ttl_b" background="images/bg_action_dark.gif" align="center"><%=sPkg_Name%></td>
|
|
|
137 |
</tr>
|
|
|
138 |
</table>
|
|
|
139 |
<!------------------ VERSION LIST -------------------------->
|
|
|
140 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
141 |
<tr>
|
|
|
142 |
<td background="images/bg_action_norm.gif">
|
|
|
143 |
<div id="LayerVersions" style="height: 350px; overflow: auto;" name="LayerVersions">
|
|
|
144 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
|
|
145 |
<tr>
|
|
|
146 |
<td width="1" nowrap background="images/bg_action_dark.gif"><img src="images/spacer.gif" width="15" height="10"></td>
|
|
|
147 |
<td width="1" nowrap background="images/bg_action_dark.gif"> </td>
|
|
|
148 |
<td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Version <br><input name="FLpkg_version" type="text" class="form_ifilter" value="<%=parFLpkg_version%>" size="15"></td>
|
|
|
149 |
<td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Mod. Date </td>
|
|
|
150 |
<td width="100%" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Reason for this version</td>
|
|
|
151 |
<td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Modified <br><input name="FLuser_name" type="text" class="form_ifilter" value="<%=parFLuser_name%>" size="15"></td>
|
|
|
152 |
<td width="1" nowrap background="images/bg_action_dark.gif"></td>
|
|
|
153 |
<td width="1" nowrap background="images/bg_action_dark.gif"></td>
|
|
|
154 |
</tr>
|
|
|
155 |
<%
|
|
|
156 |
Dim aVersions, lastRow, i, objSortHelper
|
|
|
157 |
|
|
|
158 |
|
|
|
159 |
Set rsVB = OraDatabase.DbCreateDynaset( Get_All_Versions ( parPkg_id ), cint(0))
|
|
|
160 |
|
|
|
161 |
|
|
|
162 |
|
|
|
163 |
|
|
|
164 |
' Descending order
|
|
|
165 |
If rsVB.RecordCount > 0 Then
|
|
|
166 |
aVersions = rsVB.GetRows()
|
|
|
167 |
lastRow = UBound( aVersions, 2 )
|
|
|
168 |
|
|
|
169 |
Set objSortHelper = New SortHelper
|
|
|
170 |
|
|
|
171 |
|
|
|
172 |
' Sort versions
|
|
|
173 |
Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsVB.FieldIndex("pkg_version") )
|
|
|
174 |
|
|
|
175 |
|
|
|
176 |
DestroyPackage = ""
|
|
|
177 |
CanDestroyPackage = objAccessControl.IsVisible ( "DestroyPackage" )
|
|
|
178 |
|
|
|
179 |
' Descending order
|
|
|
180 |
For i = lastRow To 0 Step -1
|
|
|
181 |
|
|
|
182 |
%>
|
|
|
183 |
<% ' Highlight row case
|
|
|
184 |
rowColor = IMGBG_ROW
|
|
|
185 |
imgPointer = ""
|
|
|
186 |
If CStr( aVersions( rsVB.FieldIndex("pv_id"), i ) ) = parPv_id Then
|
|
|
187 |
rowColor = IMGBG_ROW_HI
|
|
|
188 |
imgPointer = IMG_PONTER
|
|
|
189 |
End If
|
|
|
190 |
|
|
|
191 |
' Official/Unofficial case
|
|
|
192 |
imgLock = IMG_NOT_OFFICIAL
|
|
|
193 |
'fieldRelease_Date = ""
|
|
|
194 |
'fieldReleased_By = ""
|
|
|
195 |
If (aVersions( rsVB.FieldIndex("dlocked"), i ) = "Y") OR (aVersions( rsVB.FieldIndex("dlocked"), i ) = "A") Then
|
|
|
196 |
imgLock = IMG_OFFICIAL
|
|
|
197 |
End If
|
|
|
198 |
|
|
|
199 |
fieldRelease_Date = EuroDateTime ( aVersions( rsVB.FieldIndex("modified_stamp"), i ) )
|
|
|
200 |
fieldReleased_By = "<a href='mailto:"& aVersions( rsVB.FieldIndex("user_email"), i ) &"' class='txt_linked'><img src='images/i_user.gif' width='10' height='13' hspace='2' border='0' align='absmiddle' alt='"& aVersions( rsVB.FieldIndex("full_name"), i ) &" <"& aVersions( rsVB.FieldIndex("user_email"), i ) &">'>"& aVersions( rsVB.FieldIndex("user_name"), i ) &"</a>"
|
|
|
201 |
|
|
|
202 |
' Full Release Notes availability
|
|
|
203 |
fieldDownloadFullReleaseNotes = ""
|
|
|
204 |
If NOT IsNull( aVersions( rsVB.FieldIndex("release_notes_info"), i ) ) OR ( InStr( aVersions( rsVB.FieldIndex("release_notes_info"), i ), "MGS:") < 1) Then
|
| 177 |
brianf |
205 |
fieldDownloadFullReleaseNotes = "<a href='"& HTTP_PKG_ARCHIVE & aVersions( rsVB.FieldIndex("release_notes_info"), i ) &"' target='_blank'><img src='images/i_download_small.gif' alt='Download full release notes.' width='16' height='16' hspace='2' border='0'></a>"
|
| 119 |
ghuddy |
206 |
End If
|
|
|
207 |
|
|
|
208 |
anchorName = "ANC_"& aVersions( rsVB.FieldIndex("pv_id"), i )
|
|
|
209 |
If aVersions( rsVB.FieldIndex("is_patch"), i ) = "Y" Then
|
|
|
210 |
URLstring = "_wform_versions_history_release_notes.asp?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName
|
|
|
211 |
Else
|
|
|
212 |
URLstring = scriptName &"?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName
|
|
|
213 |
End If
|
|
|
214 |
|
|
|
215 |
|
|
|
216 |
' Set destroy package action
|
|
|
217 |
If CanDestroyPackage Then
|
|
|
218 |
DestroyPackage = "<a href='_destroy_package.asp?pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) &"&bfile="& ScriptName &"&rtag_id="& parRtag_id &"&FLuser_name="& parFLuser_name &"&FLpkg_version="& parFLpkg_version &"&rfile="& parRfile &"&pkg_id="& parPkg_id &"&OLDpv_id="& parOLDpv_id &"' "&_
|
|
|
219 |
" title='Destroy this package from the database.' "&_
|
|
|
220 |
" onClick='return confirmAction(""You are about to destroy ["& sPkg_Name &" "& aVersions( rsVB.FieldIndex("pkg_version"), i ) &"]. You cannot undo this operation.\nDo you want to proceed?"");' ><img src='icons/i_destroy_package_sml.gif' width='15' height='15' border='0' ><a>"
|
|
|
221 |
End If
|
|
|
222 |
%>
|
|
|
223 |
<tr <%=Set_Row_Style ( URLstring )%>>
|
|
|
224 |
<td align="right" background="images/bg_action_dark.gif"><%=imgPointer%></td>
|
|
|
225 |
<td align="center" valign="top" <%=rowColor%>><%=imgLock%></td>
|
|
|
226 |
<td valign="top" nowrap <%=rowColor%>><a name="<%=anchorName%>"></a><a href="<%=URLstring%>" class="txt_linked"><%=aVersions( rsVB.FieldIndex("pkg_version"), i )%></a></td>
|
|
|
227 |
<td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldRelease_Date%></td>
|
|
|
228 |
<td valign="top" <%=rowColor%> class="form_item"><%=NewLine_To_BR ( To_HTML( aVersions( rsVB.FieldIndex("comments"), i ) ) )%></td>
|
|
|
229 |
<td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldReleased_By%></td>
|
|
|
230 |
<td align="center" valign="top" <%=rowColor%>><%=fieldDownloadFullReleaseNotes%></td>
|
|
|
231 |
<td align="center" valign="top" <%=rowColor%>><%=DestroyPackage%></td>
|
|
|
232 |
</tr>
|
|
|
233 |
<%
|
|
|
234 |
Next
|
|
|
235 |
End If
|
|
|
236 |
%>
|
|
|
237 |
</table>
|
|
|
238 |
</div></td>
|
|
|
239 |
</tr>
|
|
|
240 |
</table>
|
|
|
241 |
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
|
|
|
242 |
<input type="hidden" name="pkg_id" value="<%=parPkg_id%>">
|
|
|
243 |
<input type="hidden" name="rfile" value="<%=parRfile%>">
|
|
|
244 |
<input type="hidden" name="OLDpv_id" value="<%=parOLDpv_id%>">
|
| 1268 |
iaugusti |
245 |
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
|
| 119 |
ghuddy |
246 |
<input type="hidden" name="filter_reset" value="">
|
|
|
247 |
</form>
|
|
|
248 |
|
|
|
249 |
|
|
|
250 |
|