Subversion Repositories DevTools

Rev

Rev 5357 | Rev 5590 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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