Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|				        EDIT 					     |
6
'|					  DEPENDENCIES				     |
7
'|                   				                 |
8
'=====================================================
9
%>
10
<%
11
Option explicit
12
' Good idea to set when using redirect
13
Response.Expires = 0	' always load the page, dont store
14
%>
15
<!--#include file="common/conf.asp"-->
16
<!--#include file="common/globals.asp"-->
17
<!--#include file="common/formating.asp"-->
18
<!--#include file="common/qstr.asp"-->
19
<!--#include file="common/common_subs.asp"-->
20
 
21
<%
22
' Make sure rtag_id is always present
23
If Request("pv_id") = "" Then
24
	Response.Redirect("index.asp")
25
End If
26
%>
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 rsPkgs
37
Dim HTML_pkg_list
38
Dim JSrequirementsSTR
39
'------------ Constants Declaration -----------
40
'------------ Variable Init -------------------
41
parPv_id = Request("pv_id")
42
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
121 hknight 43
 
119 ghuddy 44
Sub Generate_Dependencies_List ( NNpv_id, nRtag_id, SShtml_pkg_list, SSJSreq )
45
	Dim rsDeps, Query_String, LatestVisible, disabled
121 hknight 46
 
119 ghuddy 47
	Query_String = ReadFile( rootPath & "queries\edit_dependencies.sql" )
121 hknight 48
 
119 ghuddy 49
	OraDatabase.Parameters.Add "RTAG_ID", nRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
50
	OraDatabase.Parameters.Add "PV_ID", NNpv_id, ORAPARM_INPUT, ORATYPE_NUMBER
121 hknight 51
 
119 ghuddy 52
	Set rsDeps = OraDatabase.DbCreateDynaset( Query_String, cint(0))
53
	While ((NOT rsDeps.BOF) AND (NOT rsDeps.EOF))
54
		disabled = FALSE
121 hknight 55
		'If IsNull(rsDeps("lpv_id")) Then
119 ghuddy 56
		'	disabled = TRUE
57
		'End If
121 hknight 58
 
59
		If NOT disabled Then
119 ghuddy 60
			SShtml_pkg_list = SShtml_pkg_list &"<tr> "
61
			SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>"& rsDeps("pkg_name") &"<input name='bt"& rsDeps("pv_id") &"' type='hidden' value='"& rsDeps("build_type") &"'></td>"
121 hknight 62
			SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif'><input type='text' id='pkgn"& rsDeps("pv_id") &"' name='pkgn"& rsDeps("pv_id") &"' class='form_item' size='12' value='"& rsDeps("pkg_version") &"' onBlur='Compare_Version ( """& rsDeps("pv_id") &""" );' onFocus='Compare_Version ( """& rsDeps("pv_id") &""" );'> "
63
			SShtml_pkg_list = SShtml_pkg_list &"    <a href='javascript:;' onClick='MM_openBrWindow(""_wform_get_version.asp?pkg_id="& rsDeps("pkg_id") &"&pkg_name="& rsDeps("pkg_name") &"&pv_id="& rsDeps("pv_id") &""",""GetVersion"",""resizable=yes,width=350,height=150"")'><img src='images/i_get.gif' width='16' height='16' align='absmiddle' hspace='5' border='0' alt='Get package version from the list' title='Get package version from the list'></a> "
119 ghuddy 64
			SShtml_pkg_list = SShtml_pkg_list &"  </td>"
65
		Else
66
			SShtml_pkg_list = SShtml_pkg_list &"<tr> "
67
			SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif' nowrap class='form_item'>"& rsDeps("pkg_name") &"<input name='bt"& rsDeps("pv_id") &"' type='hidden' value='"& rsDeps("build_type") &"'></td>"
68
			SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif'><input disabled type='text' class='form_item' size='12' value='"& rsDeps("pkg_version") &"'>"
69
			SShtml_pkg_list = SShtml_pkg_list &"  </td>"
70
		End If
121 hknight 71
 
119 ghuddy 72
		' Latest Versions
73
		LatestVisible = "style='display:none;'"
74
		If ( rsDeps("pv_id") <> rsDeps("lpv_id") ) AND ( NOT disabled ) Then
75
			LatestVisible = ""
76
		End If
77
		SShtml_pkg_list = SShtml_pkg_list &"  <td background='images/bg_form_lightgray.gif' class='sublbox_hitem'><DIV id='divLPV"& rsDeps("pv_id") &"' name='divLPV"& rsDeps("pv_id") &"' "& LatestVisible &">"&_
78
								  		      "<a href='javascript:;' onClick='Merge_Version ( ""pkgn"& rsDeps("pv_id") &""", """& rsDeps("lpkg_version") &""", ""divLPV"& rsDeps("pv_id") &""" );'>"&_
79
											  "<img src='images/bt_move_left.gif' border='0' alt='Bring over this latest version' hspace='2' align='absmiddle'>"&_
80
											  "</a>"& rsDeps("lpkg_version") &"<input name='lp"& rsDeps("pv_id") &"' type='hidden' value='"& rsDeps("lpkg_version") &"'></DIV></td> "
121 hknight 81
 
119 ghuddy 82
		SShtml_pkg_list = SShtml_pkg_list &"</tr>"
121 hknight 83
 
119 ghuddy 84
		If disabled Then
121 hknight 85
			' Store not found dependency as hidden field.
119 ghuddy 86
			' NOTE: This is not safe as the client can temper with hidden value but it will do for now.
87
			SShtml_pkg_list = SShtml_pkg_list &"<input type='hidden' name='pkgn"& rsDeps("pv_id") &"' value='"& rsDeps("pkg_version") &"'>"
88
		Else
89
			SSJSreq = SSJSreq & ",'pkgn"& rsDeps("pv_id") &"','"& rsDeps("pkg_name") &" Version','RisVersionStr'"
90
		End If
121 hknight 91
 
119 ghuddy 92
		rsDeps.MoveNext
93
	WEnd
94
	If SSJSreq <> "" Then SSJSreq = Right( SSJSreq, Len(SSJSreq)-1 )		' Remove first comma
121 hknight 95
 
119 ghuddy 96
	OraDatabase.Parameters.Remove "RTAG_ID"
97
	OraDatabase.Parameters.Remove "PV_ID"
98
End Sub
99
%>
100
<%
101
If parPv_id <> "" Then
102
	Call Get_Pkg_Info ( parPv_id, NULL )
103
End If
104
%>
105
 
106
<%
107
'=================== MAIN LINE =====================
108
Call Generate_Dependencies_List ( parPv_id, parRtag_id, HTML_pkg_list, JSrequirementsSTR )
109
 
121 hknight 110
If JSrequirementsSTR = "" Then
119 ghuddy 111
	'Edit button clicked on empty dependency list. Redirect user to Add Dependencies
112
	Response.Redirect ("form_search_pkgs.asp?pv_id="& parPv_id &"&rtag_id="& parRtag_id &"&add_type="& enum_ADD_DEPENDENCIES)
113
End If
114
%>
115
<html>
116
<head>
117
<title>Release Manager</title>
118
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
119
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
120
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
121
<link rel="stylesheet" href="images/navigation.css" type="text/css">
122
<script language="JavaScript" src="images/common.js"></script>
123
<!-- DROPDOWN MENUS -->
124
<!--#include file="_menu_def.asp"-->
125
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
126
<script language="JavaScript" type="text/JavaScript">
127
<!--
128
function Merge_Version ( pkgtxt_name, lpkg_version, lpkg_div ) {
129
	MM_findObj( pkgtxt_name ).value = lpkg_version;
130
	MM_findObj( lpkg_div ).style.display = "none";
131
}
132
 
133
function Compare_Version ( pv_id ) {
134
	var cv, lv;
135
	cv = MM_findObj( "pkgn" + pv_id ).value;
136
	lv = MM_findObj( "lp" + pv_id ).value;
121 hknight 137
 
119 ghuddy 138
	if ( cv != lv ) {
139
		MM_findObj( "divLPV"+ pv_id ).style.display = "block";
140
	} else {
141
		MM_findObj( "divLPV"+ pv_id ).style.display = "none";
142
	}
143
 
144
}
121 hknight 145
 
146
//-----------------------------------------------------------------------------------------------------------------------------
147
// Javascript Function: updateFields
148
//
149
// Purpose: This is a function that is called by external javascript to update fields in form
150
//
151
// Arguments: myPv_id (integer) - Package version number
152
// myPkgId (integer) - Package number (not used in form_edit_deps.asp implementation of this function)
153
// newVersion (string) - output value of the external javascript.  This is the new version
154
// cancelled (boolean) - true if user cancelled popup, else false
155
//
156
// Returns: nothing
157
//
158
// Notes: this is called by the popup window coded in _wform_get_version.asp when the user clicks 'submit' in that popup window.  An equivalent function also
159
// exists in form_add_pkg_versions.asp for when it activates the code in _wform_get_version.asp.
160
function updateFields( myPv_id, myPkgId, newVersion, cancelled )
161
{
162
	// if user is cancelling the popup, or if the version we have got from the popup is empty...
163
	if (cancelled || newVersion == "")
164
	{
165
		// do nothing
166
	}
167
	else
168
	{
169
		// Note here we use myPv_id as the pkgn input field of the 'editdep' form is associated with a pv_id rather than a pkg_id
170
		document.getElementById("pkgn" + myPv_id).value = newVersion;
171
		document.getElementById("pkgn" + myPv_id).focus();
172
	}
173
}
174
// -->
119 ghuddy 175
</script>
176
 
177
</head>
178
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
179
<!-- MENU LAYERS -------------------------------------->
121 hknight 180
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)">
119 ghuddy 181
</div>
182
<!-- TIPS LAYERS -------------------------------------->
183
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
184
<!----------------------------------------------------->
185
<!-- HEADER -->
186
<!--#include file="_header.asp"-->
187
<!-- BODY ---->
188
<table width="100%" height="80%" border="0" cellpadding="0" cellspacing="0">
189
  <tr>
121 hknight 190
    <td align="center" valign="top" background="images/bg_lght_gray.gif">
119 ghuddy 191
      <!-- MIDDLE ---------------------------------------->
192
      <table width="650" border="0" cellspacing="0" cellpadding="0">
121 hknight 193
        <tr>
119 ghuddy 194
          <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
121 hknight 195
              <tr>
119 ghuddy 196
                <td width="1%"></td>
197
                <td align="right"><img src="images/h_trsp_dot.gif" width="30" height="30"></td>
198
                <td width="1%"></td>
199
              </tr>
121 hknight 200
              <tr>
119 ghuddy 201
                <td width="1%"></td>
202
                <td> <table width="100%" border="0" cellspacing="0" cellpadding="0">
121 hknight 203
                    <tr>
119 ghuddy 204
                      <td nowrap class="form_ttl">EDIT dependencies</td>
205
                      <td align="right" valign="bottom"></td>
206
                    </tr>
207
                  </table></td>
208
                <td width="1%"></td>
209
              </tr>
121 hknight 210
              <tr>
119 ghuddy 211
                <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>
212
                <td background="images/lbox_bg_blue.gif" align="right">
213
                  <!-- Heading -->
214
                  <img src="images/h_trsp_dot.gif" width="1" height="20">
215
                  <!-- END Heading -->
216
                </td>
217
                <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>
218
              </tr>
121 hknight 219
              <tr>
119 ghuddy 220
                <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
121 hknight 221
                <td bgcolor="#FFFFFF" valign="top">
119 ghuddy 222
                  <!-- Body -->
223
                  <table width="100%" border="0" cellspacing="1" cellpadding="2">
224
				    <form name="editdep" method="post" action="_update_dependencies.asp" onSubmit="MM_validateForm(<%=JSrequirementsSTR%>);return document.MM_returnValue">
121 hknight 225
				      <tr>
119 ghuddy 226
                        <td colspan="2" width="1%" nowrap class="form_field"><%=pkgInfoHash.Item ("pkg_name")%>&nbsp;<%=pkgInfoHash.Item ("pkg_version")%></td>
227
                      </tr>
121 hknight 228
                      <tr>
229
                        <td colspan="2" width="1%" nowrap class="form_field">
119 ghuddy 230
                          <table width="100%" border="0" cellspacing="1" cellpadding="2">
121 hknight 231
                            <tr>
119 ghuddy 232
                              <td background="images/bg_form_lightbluedark.gif" nowrap width="1%" class="form_field">Package Name<img src="images/h_trsp_dot.gif" width="1" height="20" align="absmiddle"></td>
233
                              <td background="images/bg_form_lightbluedark.gif" nowrap width="50%" class="form_field">Version</td>
234
							  <td background="images/bg_form_lightbluedark.gif" nowrap width="50%" class="form_field">Released</td>
235
                            </tr>
236
                      		<%=HTML_pkg_list%>
121 hknight 237
                            <tr>
119 ghuddy 238
                              <td nowrap><img src="images/h_trsp_dot.gif" width="120" height="1"></td>
239
                              <td></td>
240
							  <td></td>
241
                            </tr>
242
                          </table></td>
243
                      </tr>
121 hknight 244
                      <tr>
119 ghuddy 245
                        <td colspan="2" nowrap>
121 hknight 246
                          <input type="submit" name="btn" value="Update" class="form_btn">
247
						  <input type="reset" name="btn" value="Cancel" class="form_btn" onClick="history.back();">
248
                          <SPAN id="ProgressBar" name="ProgressBar" style="visibility:hidden;" class="body_scol"><img src="images/i_processing.gif" width="11" height="17" align="absmiddle" hspace="3">Processing...</SPAN>
119 ghuddy 249
                          <br> <br> </td>
250
                      </tr>
251
					  <input type="hidden" name="update_type" value="edit_custom">
252
					  <input type="hidden" name="pv_id" value="<%=parPv_id%>">
253
                      <input type="hidden" name="rtag_id" value="<%=parRtag_id%>">
254
                    </form>
255
                  </table>
256
                  <!-- END Body-->
257
                </td>
258
                <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
259
              </tr>
121 hknight 260
              <tr>
119 ghuddy 261
                <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
262
                <td background="images/lbox_bg_blue.gif"></td>
263
                <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>
264
              </tr>
265
            </table></td>
266
        </tr>
121 hknight 267
      </table>
119 ghuddy 268
      <!-------------------------------------------------->
269
    </td>
270
  </tr>
271
  <tr>
272
    <td valign="bottom" background="images/bg_lght_gray.gif">
273
	<!-- FOOTER -->
274
	<!--#include file="_footer.asp"-->
275
	</td>
276
  </tr>
277
</table>
278
</body>
279
</html>
280
<%
281
Call Destroy_All_Objects
121 hknight 282
%>