| 119 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
| 121 |
hknight |
4 |
' Rename Version
|
| 119 |
ghuddy |
5 |
' --- PROCESS FORM ---
|
|
|
6 |
'=====================================================
|
|
|
7 |
%>
|
|
|
8 |
<%
|
|
|
9 |
Option explicit
|
|
|
10 |
' Good idea to set when using redirect
|
| 121 |
hknight |
11 |
Response.Expires = 0 ' always load the page, dont store
|
| 119 |
ghuddy |
12 |
%>
|
|
|
13 |
<!--#include file="common/conf.asp"-->
|
|
|
14 |
<!--#include file="common/globals.asp"-->
|
|
|
15 |
<!--#include file="common/formating.asp"-->
|
|
|
16 |
<!--#include file="common/qstr.asp"-->
|
|
|
17 |
<!--#include file="common/common_subs.asp"-->
|
|
|
18 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
19 |
<!--#include file="common/_popup_window_common.asp"-->
|
| 121 |
hknight |
20 |
<!--#include file="_drawExtensionSelectBox.asp"-->
|
| 119 |
ghuddy |
21 |
<%
|
|
|
22 |
'------------ ACCESS CONTROL ------------------
|
|
|
23 |
%>
|
|
|
24 |
<!--#include file="_access_control_login.asp"-->
|
|
|
25 |
<!--#include file="_access_control_general.asp"-->
|
|
|
26 |
<!--#include file="_access_control_project.asp"-->
|
|
|
27 |
<%
|
|
|
28 |
'------------ Variable Definition -------------
|
|
|
29 |
Dim parPv_id
|
|
|
30 |
Dim parRfile
|
|
|
31 |
Dim rsPkgInfo
|
|
|
32 |
Dim errMessage
|
|
|
33 |
Dim objPkgInfo
|
|
|
34 |
'------------ Constants Declaration -----------
|
|
|
35 |
'------------ Variable Init -------------------
|
|
|
36 |
parPv_id = QStrPar("pv_id")
|
|
|
37 |
parRfile = QStrPar("rfile")
|
|
|
38 |
Set objPkgInfo = CreateObject("Scripting.Dictionary")
|
|
|
39 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
40 |
Sub GetPackageInfo( nPvId, outPkgInfo )
|
| 129 |
ghuddy |
41 |
Dim rsTemp, Query_String
|
|
|
42 |
If IsEmpty(nPvId) Then Exit Sub
|
| 121 |
hknight |
43 |
|
| 129 |
ghuddy |
44 |
Query_String = _
|
|
|
45 |
" SELECT pv.pv_id, pkg.pkg_id, pkg.pkg_name, pv.pkg_version, pv.v_ext, pv.build_type"&_
|
|
|
46 |
" FROM packages pkg, package_versions pv"&_
|
|
|
47 |
" WHERE pkg.pkg_id = pv.pkg_id AND pv.pv_id ="& nPvId
|
| 121 |
hknight |
48 |
|
| 129 |
ghuddy |
49 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 121 |
hknight |
50 |
|
| 129 |
ghuddy |
51 |
If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
|
|
|
52 |
outPkgInfo.Item("pv_id") = rsTemp.Fields("pv_id")
|
|
|
53 |
outPkgInfo.Item("pkg_id") = rsTemp.Fields("pkg_id")
|
|
|
54 |
outPkgInfo.Item("pkg_name") = rsTemp.Fields("pkg_name")
|
|
|
55 |
outPkgInfo.Item("pkg_version") = rsTemp.Fields("pkg_version")
|
|
|
56 |
outPkgInfo.Item("v_ext") = rsTemp.Fields("v_ext")
|
|
|
57 |
outPkgInfo.Item("build_type") = rsTemp.Fields("build_type")
|
| 121 |
hknight |
58 |
|
| 129 |
ghuddy |
59 |
If rsTemp.Fields("build_type") = "M" Then
|
|
|
60 |
objPkgInfo.Item("M_checked") = "checked"
|
|
|
61 |
objPkgInfo.Item("A_checked") = ""
|
|
|
62 |
objPkgInfo.Item("M_display") = "style='display:inline;'"
|
|
|
63 |
objPkgInfo.Item("A_display") = "style='display:none;'"
|
|
|
64 |
ElseIf rsTemp.Fields("build_type") = "A" Then
|
|
|
65 |
objPkgInfo.Item("M_checked") = ""
|
|
|
66 |
objPkgInfo.Item("A_checked") = "checked"
|
|
|
67 |
objPkgInfo.Item("M_display") = "style='display:none;'"
|
|
|
68 |
objPkgInfo.Item("A_display") = "style='display:inline;'"
|
|
|
69 |
End If
|
|
|
70 |
End If
|
| 121 |
hknight |
71 |
|
| 129 |
ghuddy |
72 |
rsTemp.Close
|
|
|
73 |
Set rsTemp = nothing
|
| 119 |
ghuddy |
74 |
End Sub
|
| 121 |
hknight |
75 |
|
| 119 |
ghuddy |
76 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 121 |
hknight |
77 |
Function GetVersionNumber(SSpkg_version, SSv_ext)
|
| 129 |
ghuddy |
78 |
Dim versionNumber
|
| 121 |
hknight |
79 |
|
| 129 |
ghuddy |
80 |
If SSv_ext <> "" Then
|
|
|
81 |
versionNumber = Replace(SSpkg_version, SSv_ext, "")
|
|
|
82 |
Else
|
|
|
83 |
versionNumber = SSpkg_version
|
|
|
84 |
End If
|
| 121 |
hknight |
85 |
|
| 129 |
ghuddy |
86 |
GetVersionNumber = versionNumber
|
| 121 |
hknight |
87 |
End Function
|
|
|
88 |
'-----------------------------------------------------------------------------------------------------------------------------
|
| 119 |
ghuddy |
89 |
Sub Rename_Pkg_Version ( NNpv_id, SSnewVersion, errMessage )
|
| 129 |
ghuddy |
90 |
OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
91 |
OraDatabase.Parameters.Add "NNpv_id", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 121 |
hknight |
92 |
|
| 129 |
ghuddy |
93 |
If Request("build_type") = "M" Then
|
|
|
94 |
' Manual build
|
|
|
95 |
OraDatabase.Parameters.Add "SSpkg_version", SSnewVersion & Request("v_ext"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
96 |
Else
|
|
|
97 |
' Automated Build
|
|
|
98 |
OraDatabase.Parameters.Add "SSpkg_version", Request("v_ext"), ORAPARM_INPUT, ORATYPE_VARCHAR2
|
| 121 |
hknight |
99 |
|
| 129 |
ghuddy |
100 |
End If
|
| 121 |
hknight |
101 |
|
| 129 |
ghuddy |
102 |
OraDatabase.Parameters.Add "BUILD_TYPE", Request("build_type"), ORAPARM_INPUT, ORATYPE_CHAR
|
|
|
103 |
OraDatabase.Parameters.Add "NNuser_id", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 121 |
hknight |
104 |
|
|
|
105 |
|
| 129 |
ghuddy |
106 |
OraDatabase.Parameters.Add "errMessage", 0, ORAPARM_OUTPUT, ORATYPE_VARCHAR2
|
| 121 |
hknight |
107 |
|
|
|
108 |
|
| 129 |
ghuddy |
109 |
objEH.TryORA ( OraSession )
|
|
|
110 |
On Error Resume Next
|
| 121 |
hknight |
111 |
|
| 129 |
ghuddy |
112 |
OraDatabase.ExecuteSQL _
|
|
|
113 |
"BEGIN Rename_Package_Version ( :NNpv_id,"&_
|
|
|
114 |
" :SSpkg_version,"&_
|
|
|
115 |
" :BUILD_TYPE,"&_
|
|
|
116 |
" :NNuser_id,"&_
|
|
|
117 |
" :errMessage ); END;"
|
| 121 |
hknight |
118 |
|
| 129 |
ghuddy |
119 |
objEH.CatchORA ( OraSession )
|
| 121 |
hknight |
120 |
|
| 129 |
ghuddy |
121 |
errMessage = OraDatabase.Parameters("errMessage").Value
|
| 121 |
hknight |
122 |
|
| 129 |
ghuddy |
123 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
124 |
OraDatabase.Parameters.Remove "NNpv_id"
|
|
|
125 |
OraDatabase.Parameters.Remove "SSpkg_version"
|
|
|
126 |
OraDatabase.Parameters.Remove "NNuser_id"
|
|
|
127 |
OraDatabase.Parameters.Remove "errMessage"
|
|
|
128 |
OraDatabase.Parameters.Remove "BUILD_TYPE"
|
| 119 |
ghuddy |
129 |
End Sub
|
|
|
130 |
'-----------------------------------------------------------------------------------------------------------------------------
|
|
|
131 |
%>
|
|
|
132 |
<%
|
|
|
133 |
'----------------------- MAIN LINE ---------------------------
|
|
|
134 |
'--- Process submition ---
|
|
|
135 |
If CBool(QStrPar("action")) AND objAccessControl.UserLogedIn Then
|
| 121 |
hknight |
136 |
|
| 129 |
ghuddy |
137 |
Call Rename_Pkg_Version ( parPv_id, Request("FRnewver"), errMessage )
|
| 121 |
hknight |
138 |
|
| 129 |
ghuddy |
139 |
If NOT IsNull(errMessage) Then
|
|
|
140 |
Call RaiseMsgInParent ( Eval(errMessage), parRtag_id &"|"& parPv_id)
|
|
|
141 |
Else
|
|
|
142 |
Call OpenInParentWindow ( parRfile &"?pv_id="& parPv_id &"&rtag_id="& parRtag_id )
|
|
|
143 |
End If
|
| 121 |
hknight |
144 |
|
| 129 |
ghuddy |
145 |
Call CloseWindow
|
| 119 |
ghuddy |
146 |
End If
|
|
|
147 |
%>
|
|
|
148 |
<%Call GetPackageInfo( parPv_id, objPkgInfo )%>
|
|
|
149 |
<html>
|
|
|
150 |
<head>
|
|
|
151 |
<title>Release Manager</title>
|
|
|
152 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
153 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
154 |
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
|
|
|
155 |
<link rel="stylesheet" href="images/navigation.css" type="text/css">
|
|
|
156 |
<script language="JavaScript" src="images/common.js"></script>
|
| 121 |
hknight |
157 |
<script language="JavaScript" type="text/JavaScript">
|
|
|
158 |
<!--
|
| 129 |
ghuddy |
159 |
function validateVersion()
|
|
|
160 |
{
|
|
|
161 |
var versionBase = document.getElementsByName('FRnewver')[0].value;
|
| 119 |
ghuddy |
162 |
|
| 129 |
ghuddy |
163 |
var exts = document.getElementsByName('v_ext')[0]
|
|
|
164 |
var versionExt = exts.options[exts.options.selectedIndex].value
|
| 121 |
hknight |
165 |
|
| 129 |
ghuddy |
166 |
var typeButtons = document.getElementsByName('build_type');
|
|
|
167 |
var isAutobuild = typeButtons[1].checked;
|
| 121 |
hknight |
168 |
|
| 129 |
ghuddy |
169 |
document.MM_returnValue = MM_ValidateVersion(null, versionBase, versionExt, isAutobuild);
|
| 121 |
hknight |
170 |
|
| 129 |
ghuddy |
171 |
return document.MM_returnValue;
|
|
|
172 |
}
|
| 121 |
hknight |
173 |
|
| 129 |
ghuddy |
174 |
// Change the elements displayed on the page depending on the build type selected.
|
|
|
175 |
function configurePage(buildType)
|
|
|
176 |
{
|
|
|
177 |
var typeButtons = document.getElementsByName('build_type');
|
| 121 |
hknight |
178 |
|
|
|
179 |
|
| 129 |
ghuddy |
180 |
if (buildType == "M")
|
|
|
181 |
{
|
|
|
182 |
Visible ('divVersionNumber','inline', 'divAutoVersion','none');
|
|
|
183 |
typeButtons[0].checked = true;
|
|
|
184 |
addCots();
|
|
|
185 |
}
|
|
|
186 |
else if (buildType == "A")
|
|
|
187 |
{
|
|
|
188 |
Visible ('divVersionNumber','none', 'divAutoVersion','inline');
|
|
|
189 |
typeButtons[1].checked = true;
|
|
|
190 |
removeCots();
|
|
|
191 |
}
|
|
|
192 |
}
|
| 121 |
hknight |
193 |
|
| 129 |
ghuddy |
194 |
// Add .cots extension to the list of extensions as it's not included in the intial query results.
|
|
|
195 |
function addCots()
|
|
|
196 |
{
|
|
|
197 |
var exts = document.getElementsByName('v_ext')[0];
|
| 121 |
hknight |
198 |
|
| 129 |
ghuddy |
199 |
for (index = 0; index < exts.length - 1; index++)
|
| 121 |
hknight |
200 |
{
|
| 129 |
ghuddy |
201 |
// Loop through extensions to see where .cots should go and insert it there
|
|
|
202 |
if (exts.options[index].value.toLowerCase() < '.cots' && exts.options[index + 1].value.toLowerCase() > '.cots')
|
|
|
203 |
{
|
|
|
204 |
var newOption = document.createElement('option');
|
|
|
205 |
newOption.text = '.cots';
|
|
|
206 |
newOption.value = '.cots';
|
| 121 |
hknight |
207 |
|
| 129 |
ghuddy |
208 |
try
|
|
|
209 |
{
|
|
|
210 |
exts.add(newOption, exts.options[index + 1]); // standards compliant
|
|
|
211 |
}
|
|
|
212 |
catch(ex)
|
|
|
213 |
{
|
|
|
214 |
exts.add(newOption, index + 1); // IE only
|
|
|
215 |
}
|
|
|
216 |
}
|
| 121 |
hknight |
217 |
}
|
| 129 |
ghuddy |
218 |
}
|
| 121 |
hknight |
219 |
|
| 129 |
ghuddy |
220 |
// Remove the .cots extension from the list of extensions.
|
|
|
221 |
function removeCots()
|
|
|
222 |
{
|
|
|
223 |
var exts = document.getElementsByName('v_ext')[0];
|
| 121 |
hknight |
224 |
|
| 129 |
ghuddy |
225 |
for (index = 0; index < exts.length; index++)
|
| 121 |
hknight |
226 |
{
|
| 129 |
ghuddy |
227 |
if (exts.options[index].value == '.cots')
|
|
|
228 |
{
|
|
|
229 |
exts.remove(index);
|
|
|
230 |
}
|
| 121 |
hknight |
231 |
}
|
| 129 |
ghuddy |
232 |
}
|
| 121 |
hknight |
233 |
|
| 129 |
ghuddy |
234 |
// Change the selected extensions in the list to the existing package extension.
|
|
|
235 |
function selectExtension(extension)
|
|
|
236 |
{
|
|
|
237 |
var exts = document.getElementsByName('v_ext')[0];
|
| 121 |
hknight |
238 |
|
| 129 |
ghuddy |
239 |
// Set the first option as selected by default
|
|
|
240 |
exts.options[0].selected = true;
|
| 121 |
hknight |
241 |
|
| 129 |
ghuddy |
242 |
for (index = 0; index < exts.length; index++)
|
| 121 |
hknight |
243 |
{
|
| 129 |
ghuddy |
244 |
if (exts.options[index].value == extension)
|
|
|
245 |
{
|
|
|
246 |
exts.options[index].selected = true;
|
|
|
247 |
}
|
| 121 |
hknight |
248 |
}
|
| 129 |
ghuddy |
249 |
}
|
| 121 |
hknight |
250 |
//-->
|
|
|
251 |
</script>
|
| 119 |
ghuddy |
252 |
</head>
|
| 121 |
hknight |
253 |
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="self.focus();configurePage('<%=objPkgInfo("build_type")%>');selectExtension('<%=objPkgInfo("v_ext")%>');">
|
|
|
254 |
<form name="renameversion" method="post" action="<%=scriptName%>" onsubmit="return validateVersion();">
|
| 129 |
ghuddy |
255 |
<table width="100%" border="0" cellspacing="0" cellpadding="2" height="100%">
|
|
|
256 |
<tr>
|
|
|
257 |
<td background="images/lbox_bg_orange.gif" width="1%" height="1%"><img src="images/i_new_off.gif" width="18" height="23" hspace="5" border="0"></td>
|
|
|
258 |
<td background="images/lbox_bg_blue.gif" nowrap width="50%" class="wform_ttl"> Reversion Package </td>
|
|
|
259 |
<td background="images/lbox_bg_blue.gif" align="right" width="50%">
|
|
|
260 |
<input type="submit" name="btn" value="Submit" class="form_btn_comp">
|
|
|
261 |
<input type="reset" name="btn" value="Cancel" class="form_btn_comp" onclick="self.close()">
|
|
|
262 |
</td>
|
|
|
263 |
<td background="images/lbox_bg_blue.gif" align="right" width="1%%" nowrap>
|
|
|
264 |
<img src="images/h_trsp_dot.gif" width="5" height="22"> </td>
|
|
|
265 |
</tr>
|
|
|
266 |
<tr>
|
|
|
267 |
<td height="100%" width="1%"> </td>
|
|
|
268 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/bg_form_lightgray.gif">
|
|
|
269 |
<table width="100%" border="0" cellspacing="1" cellpadding="2">
|
|
|
270 |
<tr>
|
|
|
271 |
<td width="1%"><img src="images/h_trsp_dot.gif" width="10" height="30"></td>
|
|
|
272 |
<td width="1%" nowrap class="form_group" valign="bottom"></td>
|
|
|
273 |
<td nowrap width="100%"></td>
|
|
|
274 |
</tr>
|
|
|
275 |
<tr>
|
|
|
276 |
<td width="1%"> </td>
|
|
|
277 |
<td width="1%" nowrap class="form_field" background="images/bg_form_lightbluedark.gif">Package</td>
|
|
|
278 |
<td nowrap width="100%" background="images/bg_form_lightbluedark.gif" class="form_txt"><%=objPkgInfo.Item("pkg_name")%></td>
|
|
|
279 |
</tr>
|
|
|
280 |
<tr>
|
|
|
281 |
<td> </td>
|
|
|
282 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_field"> </td>
|
|
|
283 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
284 |
<input name="build_type" type="radio" value="M" onclick="configurePage('M')"> Manual Build
|
|
|
285 |
<input name="build_type" type="radio" value="A" onclick="configurePage('A')"> Automated Build
|
|
|
286 |
</td>
|
|
|
287 |
</tr>
|
|
|
288 |
<tr>
|
|
|
289 |
<td> </td>
|
|
|
290 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_field">Version</td>
|
|
|
291 |
<td nowrap background="images/bg_form_lightbluedark.gif" class="form_txt">
|
|
|
292 |
<DIV id="divVersionNumber" name="divVersionNumber">
|
|
|
293 |
<input type="text" name="FRnewver" class="form_item" size="10" value="<%=GetVersionNumber(objPkgInfo.Item("pkg_version"), objPkgInfo.Item("v_ext"))%>">
|
|
|
294 |
</DIV>
|
|
|
295 |
<div id="divAutoVersion" name="divAutoVersion">(auto-number)</div>
|
|
|
296 |
<div id="divVersionExtension" name="divVersionExtension" style="display:inline;">
|
|
|
297 |
<select name="v_ext" id="v_ext" class="form_item">
|
|
|
298 |
<%
|
|
|
299 |
Call drawExtensionSelectBox( objPkgInfo.Item("v_ext"), false )
|
|
|
300 |
%>
|
|
|
301 |
</select>
|
|
|
302 |
</div>
|
|
|
303 |
</td>
|
|
|
304 |
</tr>
|
|
|
305 |
<tr>
|
|
|
306 |
<td width="1%"> </td>
|
|
|
307 |
<td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="100" height="10"></td>
|
|
|
308 |
<td nowrap width="100%"> <p> </p></td>
|
|
|
309 |
</tr>
|
|
|
310 |
</table>
|
|
|
311 |
</td>
|
|
|
312 |
</tr>
|
|
|
313 |
<tr>
|
|
|
314 |
<td height="1%" width="1%"><img src="images/h_trsp_dot.gif" width="5" height="5"></td>
|
|
|
315 |
<td valign="top" nowrap colspan="3" class="wform_ttl" background="images/lbox_bg_blue.gif"></td>
|
|
|
316 |
</tr>
|
|
|
317 |
</table>
|
| 119 |
ghuddy |
318 |
<input type="hidden" name="pv_id" value="<%=parPv_id%>">
|
|
|
319 |
<input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
|
|
|
320 |
<input type="hidden" name="rfile" value="<%=parRfile%>">
|
| 121 |
hknight |
321 |
<input type="hidden" name="action" value="true">
|
| 119 |
ghuddy |
322 |
</form>
|
|
|
323 |
</body>
|
|
|
324 |
</html>
|
|
|
325 |
|
|
|
326 |
|
|
|
327 |
<!-- DESTRUCTOR ------->
|
| 121 |
hknight |
328 |
<!--#include file="common/destructor.asp"-->
|