Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%
2
'=====================================================
3
'					  NEW VERSION
4
' 				         PAGE
5
'=====================================================
6
%>
7
<!--#include file="_tabs.asp"-->
121 hknight 8
<!--#include file="_drawExtensionSelectBox.asp"-->
119 ghuddy 9
<%
10
'------------ Variable Definition -------------
11
Dim parPv_id
12
Dim rsLocRel
13
Dim parPage_title
14
Dim objPkgInfo
121 hknight 15
Dim rsTemp2
119 ghuddy 16
'------------ Constants Declaration -----------
17
'------------ Variable Init -------------------
18
parPv_id = QStrPar("pv_id")
19
parPage_title = "NEW VERSION"
20
Set objPkgInfo = CreateObject("Scripting.Dictionary")
21
'-----------------------------------------------------------------------------------------------------------------------------
121 hknight 22
Function Get_Projects
23
	Get_Projects = _
24
	" SELECT * FROM projects ORDER BY proj_name ASC"
25
End Function
26
'-----------------------------------------------------------------------------------------------------------------------------
119 ghuddy 27
Sub GetPackageInfo( nPvId, outPkgInfo )
28
	Dim rsTemp, Query_String
29
	If IsEmpty(nPvId) Then Exit Sub
121 hknight 30
 
119 ghuddy 31
	Query_String = _
32
	" SELECT pv.pv_id, pkg.pkg_id, pkg.pkg_name, pv.pkg_version, pv.v_ext"&_
33
	"  FROM packages pkg, package_versions pv"&_
34
	" WHERE pkg.pkg_id = pv.pkg_id  AND pv.pv_id ="& nPvId
121 hknight 35
 
119 ghuddy 36
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
121 hknight 37
 
119 ghuddy 38
	If ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF)) Then
39
		outPkgInfo.Item("pv_id") = rsTemp.Fields("pv_id")
40
		outPkgInfo.Item("pkg_id") = rsTemp.Fields("pkg_id")
41
		outPkgInfo.Item("pkg_name") = rsTemp.Fields("pkg_name")
42
		outPkgInfo.Item("pkg_version") = rsTemp.Fields("pkg_version")
43
		outPkgInfo.Item("v_ext") = rsTemp.Fields("v_ext")
44
	End If
121 hknight 45
 
119 ghuddy 46
	rsTemp.Close
47
	Set rsTemp = nothing
48
End Sub
49
'-----------------------------------------------------------------------------------------------------------------------------
50
%>
51
<%
52
'===================== MAIN LINE ============================
53
Call GetPackageInfo( parPv_id, objPkgInfo )
54
'============================================================
55
%>
121 hknight 56
<style TYPE="text/css">
57
	#spanVersionNumberAuto   { display:none }
58
	#spanVersionNumberManual { display:block }
59
</style>
119 ghuddy 60
<script language="JavaScript" type="text/JavaScript">
61
<!--
121 hknight 62
 
63
/*
64
Summary of Javascript functionality implemented by Haydon Knight for DEVI-044075 and DEVI-043066:
65
 
66
The form 'NEWVersion' invokes _new_version.asp when submitted.  The value of the FRnewver input box (which is hidden)  is passed
67
through to _new_version.asp.  This value is kept identical to the text in the span 'spanFullVersion' and stores the full version number+extension.
68
The full version (that displayed and that stored in FRnewver) is updated by updateFullVersion(), which is invoked whenever the user
69
changes the version base-number or version extension via any of:
70
 
71
1. clicking a radio button to select auto/manual
72
2. altering the value of the 'inputVersionNumberManual' text entry box
73
3. changing the extension via the 'v_ext' select pull-down menu.
74
 
75
The radio button to select auto/manual is 'build_type', and a value of 'M' = manual and 'A' = auto.  Changing what is selected
76
invokes changeVisibility(), which toggles which span out of spanVersionNumberAuto and spanVersionNumberManual is
77
selected.  Each of these spans has their own input box for the version base, but spanVersionNumberAuto's input text box
78
is disabled.
79
*/
80
 
81
window.onload = function()
82
{
83
    var fullVersion = "<%=objPkgInfo.Item("pkg_version")%>";
84
	var versionExt  = "<%=objPkgInfo.Item("v_ext")%>";
85
 
86
	if (versionExt.length == 0)
87
	{
88
		// is probably an old package version that was made in the days before we enforced all package versions
89
		// to have an extension.
90
		document.all['inputVersionNumberManual'].value = fullVersion;
91
	}
92
	else
93
	{
94
		// strip extension
95
		document.all['inputVersionNumberManual'].value = fullVersion.replace( /(.*)\..*/, "$1");
96
	}
97
	updateFullVersion();
119 ghuddy 98
}
121 hknight 99
 
100
//////////////////////////////////////////////////////////////////
101
// Function: updateFullVersion
102
//
103
// Purpose: Updates the version displayed at the bottom of the window, as well as the FRnewver field that is
104
// passed through to the _new_version.asp script
105
//
106
// Arguments: none
107
//
108
// Returns: none
109
//
110
// Notes: When the user updates the "version base" text field this function is called
111
//
112
function updateFullVersion()
113
{
114
	document.all['spanFullVersion'].innerHTML = getFullVersion();
115
	document.all['FRnewver'].value = document.all['spanFullVersion'].innerHTML;
116
}
117
 
118
 
119
//////////////////////////////////////////////////////////////////
120
// Function: getVersionBase
121
//
122
// Purpose: Works out what the version base is based on user input
123
//
124
// Arguments: none
125
//
126
// Returns: versionBase - a number of the form n.n.n where 'n' is an integer (.e.g. 1.2.3000)
127
//
128
// Notes: If auto just returns ("auto")
129
//
130
function getVersionBase()
131
{
132
	var isManualBuild = document.NEWversion.build_type[0].checked;
133
 
134
	if( !isManualBuild )
135
      return "(auto)";
136
 
137
    return document.all['inputVersionNumberManual'].value;
138
}
139
 
140
 
141
//////////////////////////////////////////////////////////////////
142
// Function: getFullVersion
143
//
144
// Purpose: Returns the full version based on the user input
145
//
146
// Arguments: none
147
//
148
// Returns: fullVersion - e.g. "1.2.3.cr"
149
//
150
// Notes:
151
//
152
function getFullVersion()
153
{
154
	var versionBase = getVersionBase();
155
    var versionExt = document.all['v_ext'].value;
156
	return versionBase + versionExt;
157
}
158
 
159
 
160
//////////////////////////////////////////////////////////////////
161
// Function: changeVisibility
162
//
163
// Purpose: Toggles whether the auto or manual version base input span is displayed
164
//
165
// Arguments: isManualBuild - boolean value indicating whether user has selected 'manual' or not
166
//
167
// Returns: none
168
//
169
// Notes: Called when user clicks the radio button to select auto/manual
170
//
171
function changeVisibility(isManualBuild)
172
{
173
	if( isManualBuild )
174
	{
175
		document.all['spanVersionNumberAuto'].style.display = 'none';
176
		document.all['spanVersionNumberManual'].style.display = 'block';
177
    }
178
    else
179
    {
180
		document.all['spanVersionNumberAuto'].style.display = 'block';
181
		document.all['spanVersionNumberManual'].style.display = 'none';
182
    }
183
 
184
    updateFullVersion();
185
}
186
 
187
// Do not remove these next few lines, otherwise the page does not load properly in Microsoft IE.
119 ghuddy 188
//-->
189
</script>
190
 
191
<script>
121 hknight 192
 
193
 
119 ghuddy 194
function Dependency()
195
{
196
parent.window.location.href="dependencies.asp?rtag_id=<%=parRtag_id%>&pv_id=<%=parPv_id%>";
197
}
121 hknight 198
 
199
function checkVersion()
200
{
201
	var fullVersion = document.all['FRnewver'].value
202
 
203
	var versionBase = fullVersion.replace( /(.*)(\..*)/, "$1");
204
	var versionExt =  fullVersion.replace( /(.*)(\..*)/, "$2");
205
 
206
	var isAutobuild = document.NEWversion.build_type[1].checked;
207
 
208
	document.MM_returnValue = MM_ValidateVersion(null, versionBase, versionExt, isAutobuild);
209
 
210
	if  (document.MM_returnValue == true)
211
	{
212
		parent.window.location.href="dependencies.asp?rtag_id=<%=parRtag_id%>&pv_id=<%=parPv_id%>";
213
	}
214
 
215
	return document.MM_returnValue;
216
}
119 ghuddy 217
</script>
218
 
219
<table width="650" border="0" cellspacing="0" cellpadding="0">
121 hknight 220
  <tr>
221
    <td>
119 ghuddy 222
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
121 hknight 223
        <tr>
119 ghuddy 224
          <td width="1%">&nbsp;</td>
225
          <td align="right"><img src="images/h_trsp_dot.gif" width="30" height="30"></td>
226
          <td width="1%">&nbsp;</td>
227
        </tr>
121 hknight 228
        <tr>
119 ghuddy 229
          <td width="1%">&nbsp;</td>
121 hknight 230
          <td>
119 ghuddy 231
            <table width="100%" border="0" cellspacing="0" cellpadding="0">
121 hknight 232
              <tr>
119 ghuddy 233
                <td nowrap class="form_ttl"><%=parPage_title%></td>
234
                <td align="right" valign="bottom">
235
                  <!-- TABS -->
236
				  &nbsp;
237
                </td>
238
              </tr>
239
            </table>
240
          </td>
241
          <td width="1%">&nbsp;</td>
242
        </tr>
121 hknight 243
        <tr>
119 ghuddy 244
          <td align="left" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
245
          <td background="images/lbox_bg_blue.gif"><!-- Heading --><img src="images/h_trsp_dot.gif" width="1" height="20"><!-- END Heading --></td>
246
          <td align="right" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
247
        </tr>
121 hknight 248
        <tr>
119 ghuddy 249
          <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
121 hknight 250
          <td bgcolor="#FFFFFF" valign="top">
119 ghuddy 251
            <!-- Body -->
252
           <table width="100%" border="0" cellspacing="1" cellpadding="2">
253
			<form name="NEWversion" method="post" action="_new_version.asp">
121 hknight 254
			  <tr>
119 ghuddy 255
			      <td width="1%"><img src="images/h_trsp_dot.gif" width="1" height="10"></td>
256
			      <td width="1%" nowrap class="form_group" valign="bottom"></td>
257
			      <td nowrap width="100%" align="right" class="form_step"></td>
258
              </tr>
121 hknight 259
              <tr>
119 ghuddy 260
                <td width="1%">&nbsp;</td>
261
                <td colspan="2" width="1%" nowrap class="form_field">
262
			        <table width="100%" border="0" cellspacing="1" cellpadding="5">
121 hknight 263
			          <tr>
119 ghuddy 264
			            <td background="images/bg_form_lightbluedark.gif" nowrap width="1" class="form_field">Package Name</td>
265
			            <td background="images/bg_form_lightgray.gif" nowrap width="100%" class="form_field"><%=objPkgInfo.Item("pkg_name")%></td>
266
			          </tr>
267
			          <tr>
268
			            <td background="images/bg_form_lightbluedark.gif" nowrap class="form_field">&nbsp;</td>
269
                        <td background="images/bg_form_lightgray.gif" class="form_txt">
121 hknight 270
							<input name="build_type" id="build_type" type="radio" value="M" checked onclick="changeVisibility(true);"> Manual Build
271
							<input name="build_type" id="build_type" type="radio" value="A"         onclick="changeVisibility(false);"> Automated Build
272
						</td>
119 ghuddy 273
		              </tr>
274
			          <tr>
121 hknight 275
						<td background="images/bg_form_lightbluedark.gif" nowrap class="form_field">Version Number</td>
119 ghuddy 276
			            <td background="images/bg_form_lightgray.gif" class="form_item">
121 hknight 277
						  <SPAN id="spanVersionNumberManual" name="spanVersionNumberManual">
278
							<input type="text" id="inputVersionNumberManual" onmouseout="updateFullVersion();" onblur="updateFullVersion();" onclick="updateFullVersion();" onmouseup="updateFullVersion();" onchange="updateFullVersion();" onkeyup="updateFullVersion();" name="inputVersionNumberManual" class="form_item" size="12" ID="Text1">
279
						  </SPAN>
280
						  <SPAN id="spanVersionNumberAuto" name="spanVersionNumberAuto">
281
						    <input type="text" value="(auto)" disabled class="form_item" size="12" ID="Text1" NAME="Text1">
282
						  </SPAN>
283
						</td>
284
					  </tr>
285
					  <tr>
286
					  	<td background="images/bg_form_lightbluedark.gif" nowrap class="form_field">Version Extension</td>
287
			            <td background="images/bg_form_lightgray.gif" class="form_item">
288
						  <DIV id="divVersionExt" name="divVersionExt">
289
						  	<select name="v_ext" id="v_ext" onchange="updateFullVersion();">
290
						  	<%
291
							Call drawExtensionSelectBox( objPkgInfo.Item("v_ext"), true )
292
							%>
293
							</select>
119 ghuddy 294
						  </DIV>
121 hknight 295
 
119 ghuddy 296
						</td>
297
			          </tr>
121 hknight 298
			          <tr>
299
						<td background="images/bg_form_lightbluedark.gif" nowrap width="1" class="form_field">Version</td>
300
			            <td background="images/bg_form_lightgray.gif" nowrap width="100%" class="form_field">
301
			            <SPAN id="spanFullVersion" name="spanFullVersion"></SPAN>
302
			            <input type="hidden" name="FRnewver" id="FRnewver" value="hello">
303
			            </td>
304
			          </tr>
119 ghuddy 305
					  <input type="hidden" name="OLDpv_id" value="<%=parPv_id%>">
306
					  <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
307
					  <input type="hidden" name="page_title" value="<%=parPage_title%>">
308
					  <input type="hidden" name="action" value="true">
309
			          <tr>
310
			            <td nowrap><img src="images/h_trsp_dot.gif" width="120" height="1"></td>
311
			            <td></td>
312
			          </tr>
313
			        </table>
314
				</td>
315
              </tr>
121 hknight 316
              <tr>
119 ghuddy 317
                <td width="1%">&nbsp;</td>
318
      			<td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
121 hknight 319
                <td nowrap width="100%" class="body_scol">
320
				  <input type="submit" name="btn" value="Submit" class="form_btn" onClick="return checkVersion();">
119 ghuddy 321
                  <input type="reset" name="btn" value="Cancel" class="form_btn" onClick="Dependency();">
322
				  <SPAN id="ProgressBar" name="ProgressBar" style="visibility:hidden;"><img src="images/i_processing.gif" width="11" height="17" align="absmiddle" hspace="3">Processing...</SPAN>
323
				  <br><br>
324
                </td>
325
              </tr>
326
			</form>
327
            </table>
328
            <!-- END Body-->
329
          </td>
330
          <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
331
        </tr>
121 hknight 332
        <tr>
119 ghuddy 333
          <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
334
          <td background="images/lbox_bg_blue.gif"></td>
335
          <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
336
        </tr>
337
      </table>
338
    </td>
339
  </tr>
340
</table>