Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
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
4703 dpurdie 16
Dim hideRipple
17
Dim rippleFilter
119 ghuddy 18
Dim DestroyPackage
19
Dim CanDestroyPackage
20
'------------ Constants Declaration -----------
21
Const IMGBG_ROW_HI = "background='images/bg_row_hi.gif'"
22
Const IMGBG_ROW = "bgcolor='#FFFFFF'"
23
Const IMG_PONTER = "<img src='images/i_pointer.gif' width='6' height='11' hspace='3'>"
24
Const IMG_OFFICIAL = "<img src='images/i_locked.gif' width='7' height='10' hspace='5' vspace='2' alt='Package is official'>"
25
Const IMG_NOT_OFFICIAL = "<img src='images/spacer.gif' width='7' height='10' hspace='5' vspace='2'>"
26
Const IMG_DOWNLOAD = "<img src='images/i_download_small.gif' alt='Download full release notes.' width='16' height='16' hspace='2' border='0'>"
27
'------------ Variable Init -------------------
28
If Request("filter_reset") <> "" Then 
29
	parFLpkg_version = "*"
30
	parFLuser_name	 = "*"
31
	filterInUse = FALSE
32
Else
33
	parFLpkg_version = Request( "FLpkg_version" )
34
	parFLuser_name	 = Request( "FLuser_name" )
35
	filterInUse = Is_Filter_In_Use ( "FLpkg_version, FLuser_name" )
36
End If
4703 dpurdie 37
 
38
If Request("hideRipple") = "True" Then 
39
	hideRipple = True
40
    rippleFilter = "AND PV.BUILD_TYPE != 'Y'"
41
Else
42
	hideRipple = False
43
    rippleFilter = ""
44
End If
45
 
119 ghuddy 46
'----------------------------------------------
47
%>
48
<%
49
'-----------------------------------------------------------------------------------------------------------------------------------
50
Function Get_All_Versions ( nPkg_id )
51
	Get_All_Versions = _
4703 dpurdie 52
	" 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, PV.BUILD_TYPE "&_
119 ghuddy 53
	"   FROM PACKAGE_VERSIONS PV, USERS USR "&_
54
	"  WHERE PV.MODIFIER_ID = USR.USER_ID "&_
55
	"    AND PV.PKG_ID = :PKG_ID"&_
56
	"    /*-- Manual Filer --*/"&_
57
	"    "& Construct_Filter ( parFLpkg_version, "pv.pkg_version" ) &_
58
	"    "& Construct_Filter ( parFLuser_name, "usr.user_name" ) &_
4703 dpurdie 59
    "    "& rippleFilter &_
119 ghuddy 60
	"    /*------------------*/"
61
 
62
	Get_All_Versions = Replace( Get_All_Versions, ":PKG_ID", nPkg_id)
63
End Function
64
'-----------------------------------------------------------------------------------------------------------------------------------
65
Function Construct_Filter ( sPar_val, sCol_name )
66
	Select Case sPar_val
67
	Case Empty
68
		Construct_Filter = "AND "& sCol_name &" IS NULL"
69
 
70
	Case "*"
71
		Construct_Filter = ""
72
 
73
	Case Else
74
		If InStr( sPar_val, "*") > 0 Then
75
			' Asterisk found in string. Use LIKE
76
			Construct_Filter = "AND "& sCol_name &" LIKE '"& Replace( sPar_val, "*", "%" ) &"'"
77
		Else
78
			' No asterisk. Use =
79
			Construct_Filter = "AND "& sCol_name &" = '"& sPar_val &"'"
80
		End If
81
 
82
	End Select
83
 
84
End Function
85
'-----------------------------------------------------------------------------------------------------------------------------------
86
Function Is_Filter_In_Use ( sFilters )
87
	Dim filters, filterName
88
	Is_Filter_In_Use = FALSE
89
 
90
	filters = Split( Replace( sFilters, " ", "" ), "," )
91
 
92
	For Each filterName In filters
93
		If Request( filterName ) <> "*" Then 
94
			Is_Filter_In_Use = TRUE
95
			Exit For
96
		End If
97
	Next
98
 
99
End Function
100
'-----------------------------------------------------------------------------------------------------------------------------------
101
%>
5173 dpurdie 102
<!--#include file="_jquery_includes.asp"-->
103
<script language="JavaScript" type="text/JavaScript">
104
function useThisVersion (pkgName, pkgVersion, rtagId, oldPvid, newPvid) {
105
    console.log("useThisVersion:", pkgName, pkgVersion);
106
    debugger;
107
    //alert ("Use this version");
108
    $( "#dialog-confirm" ).dialog({
109
      position: { my: "top", at: "top+100", of: window },
110
      modal: true,
111
      draggable: true,
112
      resizable: true,
113
      dialogClass: "rounded_box",
114
      height:250,
115
      width:350,
116
      buttons: {
117
        "Direct": function() {
118
          window.opener.document.location="_new_version.asp?OLDpv_id=" + oldPvid + "&rtag_id=" + rtagId + "&pv_id=" + newPvid
119
          self.close();
120
          $( this ).dialog( "close" );
121
        },
122
        "Pending": function() {
123
          window.opener.document.location="_new_version.asp?OLDpv_id=" + oldPvid + "&rtag_id=" + rtagId + "&pv_id=" + newPvid + '&iMode=pending';
124
          self.close();
125
          $( this ).dialog( "close" );
126
        },
127
        Cancel: function() {
128
          $( this ).dialog( "close" );
129
        }
130
      },
131
      open: function() {
132
          $(this).siblings('.ui-dialog-buttonpane').find('button:eq(2)').focus(); 
133
      }
134
    });
135
 
136
    return false;
137
}
138
//# sourceURL=_version_browser_1.asp	
139
</script>
140
 
119 ghuddy 141
	  <!--------------- ACTION BUTTONS -------------------------->
142
	  <form name="filter" method="get" action="<%=scriptName%>">
143
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
144
        <tr>
145
          <td width="1" valign="middle" background="images/bg_action_norm.gif"><img src="images/spacer.gif" width="5" height="35"></td>
146
          <td width="100%" valign="middle" background="images/bg_action_norm.gif"><%
5082 dpurdie 147
          Dim bEnableUse : bEnableUse = FALSE
119 ghuddy 148
		  If Request("rtag_id") = ""  OR  _
149
		  	 Request("pv_id") = "" OR _
5173 dpurdie 150
             parOLDpv_id = ParPv_id OR _
119 ghuddy 151
			 bIsPatch OR _
5082 dpurdie 152
             (NOT bCanInsertPkg) OR _
119 ghuddy 153
			 (NOT objAccessControl.UserLogedIn) OR _
5178 dpurdie 154
             (NOT releaseIsWritable(ReleaseMode))  _
119 ghuddy 155
		  Then
5082 dpurdie 156
                bEnableUse = FALSE
119 ghuddy 157
		  Else
5082 dpurdie 158
                bEnableUse = TRUE
119 ghuddy 159
		  End If
5082 dpurdie 160
 
161
          If bEnableUse Then
5173 dpurdie 162
          %>
163
          <div id='dialog-confirm' title="Confirm version change" style="display:none">
164
          <p>Replace the current version of package <%=sPkg_Name%> with Version <%=sPkg_Version%>.
165
          <p>The new version may be added directly into the release or the change may be made pending. 
166
          </div>
167
          <%
168
            Response.write "<a href=';' onClick='return useThisVersion("""& sPkg_Name &""","""& sPkg_Version & """,""" & parRtag_id & ""","""& parOLDpv_id & """,""" & parPv_id & """);'><img src='images/abtn_use_this_version.gif' title='Use this version in project release.' width='107' height='25' hspace='1' border='0'></a>"
5082 dpurdie 169
          Else
170
		    Response.write "<img src='images/abtn_use_this_version_off.gif' width='108' height='26' hspace='1' border='0'>"
171
          End If
119 ghuddy 172
 
173
		  Response.write "<img src='images/spacer.gif' width='25' height='25'>"
174
		  If filterInUse Then
175
		  	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!)'>"
176
		  Else
177
		    Response.write "<input type='image' name='btn' src='images/abtn_filter.gif' width='25' height='25' border='0' alt='Apply filter'>"
178
		  End If
179
		  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>"
4703 dpurdie 180
 
181
		  Response.write "<img src='images/spacer.gif' width='25' height='25'>"
182
          Response.write "<a href='"& scriptName &"?"& Persists_Query_String( "hideRipple=" & not hideRipple ) &"'>"
183
    		  If hideRipple Then
184
    		  	Response.write "<img src='images/RippleSquareOff.gif' width='25' height='25' border='0' title='Rippled Versions Hidden. Toggle'>"
185
    		  Else
186
    		    Response.write "<img src='images/RippleSquare.gif' width='25' height='25' border='0' title='Rippled Versions Shown. Toggle'>"
187
    		  End If
188
          Response.write "</a>"
189
 
119 ghuddy 190
		  %></td>
191
		  <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>
192
		  <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>
193
        </tr>
194
      </table>
195
	  <!--------------------- CAPTION ---------------------------->
196
	  <table width="100%" border="0" cellspacing="0" cellpadding="0">
197
	    <tr>
198
	      <td class="lbox_ttl_b" background="images/bg_action_dark.gif" align="center"><%=sPkg_Name%></td>
199
		</tr>
200
      </table>
201
	  <!------------------ VERSION LIST -------------------------->
202
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
203
        <tr>
204
          <td background="images/bg_action_norm.gif"> 
205
            <div id="LayerVersions" style="height: 350px; overflow: auto;" name="LayerVersions"> 
206
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
207
                <tr>
208
                  <td width="1" nowrap background="images/bg_action_dark.gif"><img src="images/spacer.gif" width="15" height="10"></td>
209
                  <td width="1" nowrap background="images/bg_action_dark.gif">&nbsp;</td>
210
                  <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>
211
                  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Mod. Date&nbsp;&nbsp;</td>
212
                  <td width="100%" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Reason for this version</td>
213
				  <td width="1" valign="top" nowrap background="images/bg_action_dark.gif" class="form_field">Last Modified&nbsp;&nbsp;<br><input name="FLuser_name" type="text" class="form_ifilter" value="<%=parFLuser_name%>" size="15"></td>
214
                  <td width="1" nowrap background="images/bg_action_dark.gif"></td>
215
				  <td width="1" nowrap background="images/bg_action_dark.gif"></td>
216
                </tr>
217
				<%
218
				Dim aVersions, lastRow, i, objSortHelper
219
 
220
 
221
				Set rsVB = OraDatabase.DbCreateDynaset( Get_All_Versions ( parPkg_id ), cint(0))
222
 
223
 
224
 
225
 
226
			  	' Descending order
227
				If rsVB.RecordCount > 0 Then
228
				aVersions = rsVB.GetRows()
229
				lastRow = UBound( aVersions, 2 )
230
 
231
				Set objSortHelper = New SortHelper
232
 
233
 
234
				' Sort versions
235
				Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsVB.FieldIndex("pkg_version") )
236
 
237
 
238
				DestroyPackage = ""
5061 dpurdie 239
				CanDestroyPackage = canShowControlInProject ( "DestroyPackage" )
119 ghuddy 240
 
241
			  	' Descending order
242
				For i = lastRow To 0 Step -1
4703 dpurdie 243
 
119 ghuddy 244
				%>
245
				<%	' Highlight row case
246
					rowColor = IMGBG_ROW
247
					imgPointer = ""
248
					If CStr( aVersions( rsVB.FieldIndex("pv_id"), i ) ) = parPv_id Then 
249
						rowColor = IMGBG_ROW_HI
250
						imgPointer = IMG_PONTER
251
					End If
252
 
253
					' Official/Unofficial case
254
					imgLock = IMG_NOT_OFFICIAL
255
					'fieldRelease_Date = ""
256
					'fieldReleased_By = ""
257
					If (aVersions( rsVB.FieldIndex("dlocked"), i ) = "Y")  OR (aVersions( rsVB.FieldIndex("dlocked"), i ) = "A") Then
258
						imgLock = IMG_OFFICIAL
259
					End If
260
 
261
					fieldRelease_Date = EuroDateTime ( aVersions( rsVB.FieldIndex("modified_stamp"), i ) )
262
					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>"
263
 
264
					' Full Release Notes availability
265
					fieldDownloadFullReleaseNotes = ""
266
					If NOT IsNull( aVersions( rsVB.FieldIndex("release_notes_info"), i ) ) OR ( InStr( aVersions( rsVB.FieldIndex("release_notes_info"), i ), "MGS:") < 1)  Then
177 brianf 267
						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 268
					End If
269
 
270
					anchorName = "ANC_"& aVersions( rsVB.FieldIndex("pv_id"), i )
271
					If aVersions( rsVB.FieldIndex("is_patch"), i ) = "Y" Then
272
						URLstring = "_wform_versions_history_release_notes.asp?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName
273
					Else
274
						URLstring = scriptName &"?"& Persists_Query_String( "pv_id="& aVersions( rsVB.FieldIndex("pv_id"), i ) ) &"#"& anchorName
275
					End If
276
 
277
 
278
					' Set destroy package action
279
					If CanDestroyPackage Then
280
						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 &"' "&_
281
										 " title='Destroy this package from the database.' "&_
282
										 " 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>"
283
					End If
284
				%>
285
                <tr <%=Set_Row_Style ( URLstring )%>> 
286
                  <td align="right" background="images/bg_action_dark.gif"><%=imgPointer%></td>
287
                  <td align="center" valign="top" <%=rowColor%>><%=imgLock%></td>
288
                  <td valign="top" nowrap <%=rowColor%>><a name="<%=anchorName%>"></a><a href="<%=URLstring%>" class="txt_linked"><%=aVersions( rsVB.FieldIndex("pkg_version"), i )%></a></td>
289
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldRelease_Date%></td>
290
                  <td valign="top" <%=rowColor%> class="form_item"><%=NewLine_To_BR ( To_HTML( aVersions( rsVB.FieldIndex("comments"), i ) ) )%></td>
291
                  <td valign="top" nowrap <%=rowColor%> class="form_item"><%=fieldReleased_By%></td>
292
                  <td align="center" valign="top" <%=rowColor%>><%=fieldDownloadFullReleaseNotes%></td>
293
				  <td align="center" valign="top" <%=rowColor%>><%=DestroyPackage%></td>
294
                </tr>
295
				<%
296
				Next
297
				End If
298
				%>
299
              </table>
300
            </div></td>
301
        </tr>
302
      </table> 
303
	  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
304
	  <input type="hidden" name="pkg_id" value="<%=parPkg_id%>">
305
	  <input type="hidden" name="rfile" value="<%=parRfile%>">
306
	  <input type="hidden" name="OLDpv_id" value="<%=parOLDpv_id%>">
1268 iaugusti 307
	  <input type="hidden" name="pv_id" value="<%=parPv_id%>">
119 ghuddy 308
	  <input type="hidden" name="filter_reset" value="">
309
	  </form>
310
 
311
 
5173 dpurdie 312