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