Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%
2
'===============================================================
3
'					Archived 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
'------------ Constants Declaration -----------
17
Const IMGBG_ROW_HI = "background='images/bg_row_hi.gif'"
18
Const IMGBG_ROW = "bgcolor='#FFFFFF'"
19
Const IMG_PONTER = "<img src='images/i_pointer.gif' width='6' height='11' hspace='3'>"
20
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
21
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2'>"
22
Const IMG_DOWNLOAD = "<img src='images/i_download_small.gif' alt='Download full release notes.' width='16' height='16' hspace='2' border='0'>"
23
'------------ Variable Init -------------------
24
If Request("filter_reset") <> "" Then 
25
	parFLpkg_version = "*"
26
	parFLuser_name	 = "*"
27
	filterInUse = FALSE
28
Else
29
	parFLpkg_version = Request( "FLpkg_version" )
30
	parFLuser_name	 = Request( "FLuser_name" )
31
	filterInUse = Is_Filter_In_Use ( "FLpkg_version, FLuser_name" )
32
End If
33
'----------------------------------------------
34
%>
35
<%
36
'-----------------------------------------------------------------------------------------------------------------------------------
37
Function Get_All_Versions ( nPkg_id )
38
	Get_All_Versions = _
39
	" 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 "&_
40
	"   FROM ARCHIVE_MANAGER.PACKAGE_VERSIONS PV, USERS USR "&_
41
	"  WHERE PV.MODIFIER_ID = USR.USER_ID "&_
42
	"    AND PV.PKG_ID = :PKG_ID"&_
43
	"    /*-- Manual Filer --*/"&_
44
	"    "& Construct_Filter ( parFLpkg_version, "pv.pkg_version" ) &_
45
	"    /*------------------*/"
46
 
47
	Get_All_Versions = Replace( Get_All_Versions, ":PKG_ID", nPkg_id)
48
End Function
49
'-----------------------------------------------------------------------------------------------------------------------------------
50
Function Construct_Filter ( sPar_val, sCol_name )
51
	Select Case sPar_val
52
	Case Empty
53
		Construct_Filter = "AND "& sCol_name &" IS NULL"
54
 
55
	Case "*"
56
		Construct_Filter = ""
57
 
58
	Case Else
59
		If InStr( sPar_val, "*") > 0 Then
60
			' Asterisk found in string. Use LIKE
61
			Construct_Filter = "AND "& sCol_name &" LIKE '"& Replace( sPar_val, "*", "%" ) &"'"
62
		Else
63
			' No asterisk. Use =
64
			Construct_Filter = "AND "& sCol_name &" = '"& sPar_val &"'"
65
		End If
66
 
67
	End Select
68
 
69
End Function
70
'-----------------------------------------------------------------------------------------------------------------------------------
71
Function Is_Filter_In_Use ( sFilters )
72
	Dim filters, filterName
73
	Is_Filter_In_Use = FALSE
74
 
75
	filters = Split( Replace( sFilters, " ", "" ), "," )
76
 
77
	For Each filterName In filters
78
		If Request( filterName ) <> "*" Then 
79
			Is_Filter_In_Use = TRUE
80
			Exit For
81
		End If
82
	Next
83
 
84
End Function
85
'-----------------------------------------------------------------------------------------------------------------------------------
86
%>
87
	  <!--------------- ACTION BUTTONS -------------------------->
88
	  <form name="filter" method="get" action="<%=scriptName%>">
89
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
90
        <tr>
91
          <td width="1" valign="middle" background="images/bg_action_norm.gif"><img src="images/spacer.gif" width="5" height="35"></td>
92
          <td width="100%" valign="middle" background="images/bg_action_norm.gif">
93
		</td>
94
 
95
		  <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>
96
        </tr>
97
      </table>
98
	  <!--------------------- CAPTION ---------------------------->
99
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
100
	    <tr>
101
	      <td class="lbox_ttl_b" background="images/bg_action_dark.gif" align="center"><%=sPkg_Name%></td>
102
		</tr>
103
      </table>
104
	  <!------------------ VERSION LIST -------------------------->
105
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
106
        <tr>
107
          <td background="images/bg_action_norm.gif"> 
108
            <div id="LayerVersions" style="height: 350px; overflow: auto;" name="LayerVersions"> 
109
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
110
                <tr>
111
                  <td width="1" nowrap background="images/bg_action_dark.gif"><img src="images/spacer.gif" width="15" height="10"></td>
112
                  <td width="1" nowrap background="images/bg_action_dark.gif">&nbsp;</td>
113
                  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Version&nbsp;&nbsp;<br><input name="FLpkg_version" type="text" class="form_ifilter" value="<%=parFLpkg_version%>" size="15"></td>
114
                  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Mod. Date&nbsp;&nbsp;</td>
115
                  <td width="100%" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Reason for this version</td>
116
				  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Modified&nbsp;&nbsp;<br></td>
117
                </tr>
118
				<%
119
				Dim aVersions, lastRow, i, objSortHelper
120
 
121
				Set rsVB = OraDatabase.DbCreateDynaset( Get_All_Versions ( parPkg_id ), cint(0))
122
 
123
 
124
 
125
 
126
			  	' Descending order
127
				If rsVB.RecordCount > 0 Then
128
				aVersions = rsVB.GetRows()
129
				lastRow = UBound( aVersions, 2 )
130
 
131
				Set objSortHelper = New SortHelper
132
 
133
 
134
				' Sort versions
135
				Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsVB.FieldIndex("pkg_version") )
136
 
137
 
138
 
139
			  	' Descending order
140
				For i = lastRow To 0 Step -1
141
 
142
				%>
143
				<%	' Highlight row case
144
					rowColor = IMGBG_ROW
145
					imgPointer = ""
146
					If CStr( aVersions( rsVB.FieldIndex("pv_id"), i ) ) = parPv_id Then 
147
						rowColor = IMGBG_ROW_HI
148
						imgPointer = IMG_PONTER
149
					End If
150
 
151
					' Official/Unofficial case
152
					imgLock = IMG_NOT_OFFICIAL
153
					'fieldRelease_Date = ""
154
					'fieldReleased_By = ""
155
					If (aVersions( rsVB.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsVB.FieldIndex("dlocked"), i ) = "A") Then
156
						imgLock = IMG_OFFICIAL
157
					End If
158
 
159
					fieldRelease_Date = EuroDateTime ( aVersions( rsVB.FieldIndex("modified_stamp"), i ) )
160
					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 ) &" &lt;"& aVersions( rsVB.FieldIndex("user_email"), i ) &"&gt;'>"& aVersions( rsVB.FieldIndex("user_name"), i ) &"</a>"
161
 
162
					' Full Release Notes availability
163
					fieldDownloadFullReleaseNotes = ""
164
					If NOT IsNull( aVersions( rsVB.FieldIndex("release_notes_info"), i ) ) OR ( InStr( aVersions( rsVB.FieldIndex("release_notes_info"), i ), "MGS:") < 1)  Then
165
						fieldDownloadFullReleaseNotes = "<a href='"& enumHTTP_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>"
166
					End If
167
 
168
					anchorName = "ANC_"& aVersions( rsVB.FieldIndex("pv_id"), i )
169
					If aVersions( rsVB.FieldIndex("is_patch"), i ) = "Y" Then
170
						URLstring = "_wform_archived_versions_history_release_notes.asp?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName
171
					Else
172
						URLstring = scriptName &"?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName
173
					End If
174
				%>
175
                <tr <%=Set_Row_Style ( URLstring )%>> 
176
                  <td align="right" background="images/bg_action_dark.gif"><%=imgPointer%></td>
177
                  <td align="center" valign="top" <%=rowColor%>><%=imgLock%></td>
178
                  <td valign="top" nowrap <%=rowColor%>><a name="<%=anchorName%>"></a><a href="<%=URLstring%>" class="txt_linked"><%=aVersions( rsVB.FieldIndex("pkg_version"), i )%></a></td>
179
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldRelease_Date%></td>
180
                  <td valign="top" <%=rowColor%> class="form_item"><%=NewLine_To_BR ( To_HTML( aVersions( rsVB.FieldIndex("comments"), i ) ) )%></td>
181
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldReleased_By%></td>
182
                </tr>
183
				<%
184
				Next
185
				End If
186
				%>
187
              </table>
188
            </div></td>
189
        </tr>
190
      </table> 
191
	  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
192
	  <input type="hidden" name="pkg_id" value="<%=parPkg_id%>">
193
	  <input type="hidden" name="rfile" value="<%=parRfile%>">
194
	  <input type="hidden" name="OLDpv_id" value="<%=parOLDpv_id%>">
195
	  <input type="hidden" name="filter_reset" value="">
196
	  </form>
197
 
198
 
199