| 5357 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
| 5590 |
dpurdie |
3 |
'=====================================================
|
|
|
4 |
'|
|
|
|
5 |
'| _wform_change_previous_version.asp
|
|
|
6 |
'| Chnage the previous version of a package
|
|
|
7 |
'| This page is designed to operation within an iframe
|
|
|
8 |
'|
|
|
|
9 |
'=====================================================
|
|
|
10 |
%>
|
|
|
11 |
<%
|
| 5357 |
dpurdie |
12 |
Option explicit
|
|
|
13 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
14 |
%>
|
|
|
15 |
<%
|
|
|
16 |
'=====================================================
|
|
|
17 |
' Change Previous Version
|
|
|
18 |
'=====================================================
|
|
|
19 |
%>
|
|
|
20 |
<!--#include file="common/conf.asp"-->
|
|
|
21 |
<!--#include file="common/globals.asp"-->
|
|
|
22 |
<!--#include file="common/qstr.asp"-->
|
|
|
23 |
<!--#include file="common/common_subs.asp"-->
|
|
|
24 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
25 |
<!--#include file="common/_popup_window_common.asp"-->
|
|
|
26 |
<!--#include file="class/classSortHelper.asp"-->
|
|
|
27 |
<%
|
|
|
28 |
'------------ ACCESS CONTROL ------------------
|
|
|
29 |
%>
|
|
|
30 |
<!--#include file="_access_control_login.asp"-->
|
|
|
31 |
<!--#include file="_access_control_general.asp"-->
|
|
|
32 |
<!--#include file="_access_control_project.asp"-->
|
|
|
33 |
<%
|
|
|
34 |
'------------ Variable Definition -------------
|
|
|
35 |
Dim parPv_id
|
|
|
36 |
Dim parRfile
|
|
|
37 |
'------------ Constants Declaration -----------
|
|
|
38 |
'------------ Variable Init -------------------
|
|
|
39 |
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
|
|
|
40 |
parPv_id = QStrPar("pv_id")
|
|
|
41 |
parRfile = QStrPar("rfile")
|
|
|
42 |
'----------------------------------------------
|
|
|
43 |
%>
|
|
|
44 |
<%
|
|
|
45 |
Sub Short_Pkg_Info ( NNpv_id )
|
|
|
46 |
Dim rsTemp, Query_String
|
|
|
47 |
|
|
|
48 |
Query_String = _
|
|
|
49 |
" SELECT pkg.pkg_name, pv.pkg_version, pv.pkg_id, pv.last_pv_id"&_
|
|
|
50 |
" FROM packages pkg, package_versions pv"&_
|
|
|
51 |
" WHERE pkg.pkg_id = pv.pkg_id"&_
|
|
|
52 |
" AND pv.pv_id = "& NNpv_id
|
|
|
53 |
|
|
|
54 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
|
|
55 |
|
|
|
56 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
57 |
pkgInfoHash.Add "pkg_name", (rsTemp.Fields("pkg_name"))
|
|
|
58 |
pkgInfoHash.Add "pkg_id", (rsTemp.Fields("pkg_id"))
|
|
|
59 |
pkgInfoHash.Add "last_pv_id", (rsTemp.Fields("last_pv_id"))
|
|
|
60 |
End If
|
|
|
61 |
|
|
|
62 |
rsTemp.Close
|
|
|
63 |
Set rsTemp = nothing
|
|
|
64 |
End Sub
|
|
|
65 |
|
|
|
66 |
|
|
|
67 |
Function All_Versions_List ( nOldPv_id, nPkg_id )
|
|
|
68 |
If nOldPv_id = "" OR IsNull(nOldPv_id) Then nOldPv_id = "-1"
|
|
|
69 |
All_Versions_List = _
|
|
|
70 |
" SELECT pv.pv_id, pv.pkg_version, pv.dlocked,"&_
|
|
|
71 |
" DECODE(pv.pv_id, "& nOldPv_id &", 'selected', NULL) AS selected "&_
|
|
|
72 |
" FROM PACKAGE_VERSIONS pv"&_
|
|
|
73 |
" WHERE pv.pkg_id = "& nPkg_id &_
|
|
|
74 |
" AND pv.is_patch IS NULL"
|
|
|
75 |
'Response.write All_Versions_List
|
|
|
76 |
End Function
|
|
|
77 |
|
|
|
78 |
Sub Update_Previous_Version ( NNpv_id, nLast_pv_id )
|
|
|
79 |
Dim rsTemp, Query_String
|
|
|
80 |
If nLast_pv_id = "" Then nLast_pv_id = NULL
|
|
|
81 |
|
|
|
82 |
Query_String = _
|
| 5590 |
dpurdie |
83 |
"SELECT last_pv_id, release_notes_info"&_
|
| 5357 |
dpurdie |
84 |
" FROM package_versions"&_
|
|
|
85 |
" WHERE pv_id = "& NNpv_id
|
|
|
86 |
|
|
|
87 |
Set rsTemp = OraDatabase.CreateDynaset( Query_String, cint(0))
|
|
|
88 |
'update fields
|
|
|
89 |
rsTemp.Edit
|
|
|
90 |
rsTemp.Fields("last_pv_id").Value = nLast_pv_id
|
|
|
91 |
rsTemp.Fields("release_notes_info").Value = NULL
|
|
|
92 |
rsTemp.Update
|
|
|
93 |
|
|
|
94 |
rsTemp.Close
|
|
|
95 |
Set rsTemp = nothing
|
|
|
96 |
End Sub
|
|
|
97 |
%>
|
|
|
98 |
<%
|
|
|
99 |
'Process submition
|
|
|
100 |
If CBool(QStrPar("action")) AND objAccessControl.UserLogedIn Then
|
|
|
101 |
Call Update_Previous_Version ( parPv_id, Request("last_pv_id") )
|
| 5590 |
dpurdie |
102 |
Call ReloadParentWindow
|
|
|
103 |
Call CloseWindow
|
| 5357 |
dpurdie |
104 |
End If
|
|
|
105 |
%>
|
|
|
106 |
<%
|
|
|
107 |
Call Short_Pkg_Info ( parPv_id )
|
|
|
108 |
%>
|
|
|
109 |
<html>
|
|
|
110 |
<head>
|
|
|
111 |
<title>Release Manager</title>
|
|
|
112 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
113 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
114 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
115 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
116 |
<link rel="stylesheet" href="images/navigation.css" type="text/css">
|
|
|
117 |
<script language="JavaScript" src="images/tipster.js"></script>
|
|
|
118 |
<script language="JavaScript" src="images/_help_tips.js"></script>
|
|
|
119 |
<script language="JavaScript" src="images/common.js"></script>
|
|
|
120 |
</head>
|
|
|
121 |
|
|
|
122 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();">
|
| 5590 |
dpurdie |
123 |
<form name="preversion" method="post" action="<%=scriptName%>" class="form_tight">
|
|
|
124 |
<table border="0" cellspacing="0" cellpadding="2" width="100%">
|
| 5357 |
dpurdie |
125 |
<tr>
|
|
|
126 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
|
|
127 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
|
|
128 |
<tr>
|
|
|
129 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
|
|
|
130 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
131 |
<%=pkgInfoHash.Item ("pkg_name")%></td>
|
|
|
132 |
</tr>
|
|
|
133 |
<tr>
|
| 5590 |
dpurdie |
134 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Previous Version </td>
|
| 5357 |
dpurdie |
135 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif">
|
|
|
136 |
<select name="last_pv_id" class="form_item">
|
|
|
137 |
<option></option>
|
|
|
138 |
<%
|
|
|
139 |
Dim rsQry,aVersions,lastRow,objSortHelper,i
|
|
|
140 |
Set rsQry = OraDatabase.DbCreateDynaset( All_Versions_List( pkgInfoHash.Item ("last_pv_id"), pkgInfoHash.Item ("pkg_id") ), cint(0))
|
|
|
141 |
|
|
|
142 |
If rsQry.RecordCount > 0 Then
|
|
|
143 |
aVersions = rsQry.GetRows()
|
|
|
144 |
lastRow = UBound( aVersions, 2 )
|
|
|
145 |
Set objSortHelper = New SortHelper
|
|
|
146 |
|
|
|
147 |
' Sort versions
|
|
|
148 |
Call objSortHelper.VersionSort( aVersions, 0, lastRow, rsQry.FieldIndex("pkg_version") )
|
|
|
149 |
|
|
|
150 |
' Descending order
|
|
|
151 |
For i = lastRow To 0 Step -1
|
|
|
152 |
%>
|
|
|
153 |
<option value="<%=aVersions(rsQry.FieldIndex("pv_id"),i)%>" <%=aVersions(rsQry.FieldIndex("selected"),i)%>>
|
|
|
154 |
|
|
|
155 |
<%
|
|
|
156 |
If aVersions( rsQry.FieldIndex("dlocked"), i ) = "Y" Then%>
|
|
|
157 |
R
|
|
|
158 |
<%Else%>
|
|
|
159 |
|
|
|
160 |
<%End If%>
|
|
|
161 |
<%=aVersions( rsQry.FieldIndex("pkg_version"), i )%>
|
|
|
162 |
</option>
|
|
|
163 |
<%
|
|
|
164 |
Next
|
|
|
165 |
Set objSortHelper = nothing
|
|
|
166 |
End If
|
|
|
167 |
rsQry.Close
|
|
|
168 |
set rsQry = nothing
|
|
|
169 |
%>
|
|
|
170 |
</select>
|
|
|
171 |
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
|
|
|
172 |
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
|
|
|
173 |
<input type="hidden" name="rfile" value="<%=parRfile%>">
|
|
|
174 |
<input type="hidden" name="action" value="true">
|
|
|
175 |
</td>
|
|
|
176 |
</tr>
|
|
|
177 |
</table>
|
|
|
178 |
</td>
|
|
|
179 |
</tr>
|
| 5590 |
dpurdie |
180 |
<tr>
|
|
|
181 |
<td align="right">
|
|
|
182 |
<input type="submit" name="btn" value="Update" class="form_btn_comp">
|
|
|
183 |
<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="parent.closeIFrame();">
|
|
|
184 |
</td>
|
| 5357 |
dpurdie |
185 |
</table>
|
|
|
186 |
</form>
|
|
|
187 |
</body>
|
|
|
188 |
</html>
|
|
|
189 |
<!-- DESTRUCTOR ------->
|
| 119 |
ghuddy |
190 |
<!--#include file="common/destructor.asp"-->
|