Subversion Repositories DevTools

Rev

Rev 62 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 62 Rev 5356
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
'|                                                   |
4
'|                                                   |
5
'|			          wAddProdNew				 	 |
5
'|			          wAddProdNew				 	 |
6
'|                                                   |
6
'|                                                   |
7
'=====================================================
7
'=====================================================
8
%>
8
%>
9
<%
9
<%
10
Option explicit
10
Option explicit
11
Response.Expires = 0
11
Response.Expires = 0
12
%>
12
%>
13
<!--#include file="common/globals.asp"-->
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
17
<%
17
<%
18
'------------ ACCESS CONTROL ------------------
18
'------------ ACCESS CONTROL ------------------
19
%>
19
%>
20
<!--#include file="_access_control_general.asp"-->
20
<!--#include file="_access_control_general.asp"-->
21
<%
21
<%
22
'------------ VARIABLE DEFINITION -------------
22
'------------ VARIABLE DEFINITION -------------
23
Dim rsQry
23
Dim rsQry
24
Dim objFormCollector
24
Dim objFormCollector
25
Dim sMessage
25
Dim sMessage
26
'------------ CONSTANTS DECLARATION -----------
26
'------------ CONSTANTS DECLARATION -----------
27
Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
27
Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
28
Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
28
Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
29
'------------ VARIABLE INIT -------------------
29
'------------ VARIABLE INIT -------------------
30
sMessage = NULL
30
sMessage = NULL
31
parBom_id = Request("bom_id")
31
parBom_id = Request("bom_id")
32
parOs_id = Request("os_id")
32
parOs_id = Request("os_id")
33
Set objFormCollector = CreateObject("Scripting.Dictionary")
33
Set objFormCollector = CreateObject("Scripting.Dictionary")
34
'------------ CONDITIONS ----------------------
34
'------------ CONDITIONS ----------------------
35
'----------------------------------------------
35
'----------------------------------------------
36
%>
36
%>
37
<%
37
<%
38
'--------------------------------------------------------------------------------------------------------------------------
38
'--------------------------------------------------------------------------------------------------------------------------
39
Function HasSimilarNames ( sProdName )
39
Function HasSimilarNames ( sProdName )
40
	Dim rsQry
40
	Dim rsQry
41
	
41
	
42
	HasSimilarNames = FALSE
42
	HasSimilarNames = FALSE
43
	
43
	
44
	OraDatabase.Parameters.Add "PROD_NAME", sProdName, ORAPARM_INPUT, ORATYPE_VARCHAR2
44
	OraDatabase.Parameters.Add "PROD_NAME", sProdName, ORAPARM_INPUT, ORATYPE_VARCHAR2
45
	
45
	
46
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("SimilarProductNames.sql"), ORADYN_DEFAULT )
46
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("SimilarProductNames.sql"), ORADYN_DEFAULT )
47
	If rsQry.RecordCount > 0 Then
47
	If rsQry.RecordCount > 0 Then
48
		HasSimilarNames = TRUE
48
		HasSimilarNames = TRUE
49
	End If
49
	End If
50
	
50
	
51
	OraDatabase.Parameters.Remove "PROD_NAME"
51
	OraDatabase.Parameters.Remove "PROD_NAME"
52
	
52
	
53
	rsQry.Close
53
	rsQry.Close
54
	Set rsQry = Nothing
54
	Set rsQry = Nothing
55
End Function
55
End Function
56
'--------------------------------------------------------------------------------------------------------------------------
56
'--------------------------------------------------------------------------------------------------------------------------
57
Sub AddProdToOs ()
57
Sub AddProdToOs ()
58
	On Error Resume Next
58
	On Error Resume Next
59
	
59
	
60
	OraDatabase.Parameters.Add "PROD_NAME", 	Request("prod_name"), 		ORAPARM_INPUT, ORATYPE_VARCHAR2
60
	OraDatabase.Parameters.Add "PROD_NAME", 	Request("prod_name"), 		ORAPARM_INPUT, ORATYPE_VARCHAR2
61
	OraDatabase.Parameters.Add "PROD_VERSION", 	Request("prod_version"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
61
	OraDatabase.Parameters.Add "PROD_VERSION", 	Request("prod_version"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
62
	OraDatabase.Parameters.Add "OS_ID", 		Request("os_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
62
	OraDatabase.Parameters.Add "OS_ID", 		Request("os_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
63
	OraDatabase.Parameters.Add "USER_ID", 		objAccessControl.UserId, 	ORAPARM_INPUT, ORATYPE_NUMBER 
63
	OraDatabase.Parameters.Add "USER_ID", 		objAccessControl.UserId, 	ORAPARM_INPUT, ORATYPE_NUMBER 
64
	
64
	
65
	objEH.TryORA ( OraSession )
65
	objEH.TryORA ( OraSession )
66
	
66
	
67
	OraDatabase.ExecuteSQL _
67
	OraDatabase.ExecuteSQL _
68
	"DECLARE "&_
68
	"DECLARE "&_
69
	"   outProdId NUMBER;"&_
69
	"   outProdId NUMBER;"&_
70
	"BEGIN   "&_
70
	"BEGIN   "&_
71
	"   pk_Product.New_Product ( :PROD_NAME, :PROD_VERSION, :USER_ID, outProdId );"&_
71
	"   pk_Product.New_Product ( :PROD_NAME, :PROD_VERSION, :USER_ID, outProdId );"&_
72
	"   pk_Product.Add_Product ( outProdId, :OS_ID, :USER_ID );"&_
72
	"   pk_Product.Add_Product ( outProdId, :OS_ID, :USER_ID );"&_
73
	"END;"
73
	"END;"
74
	
74
	
75
	objEH.CatchORA ( OraSession )
75
	objEH.CatchORA ( OraSession )
76
	
76
	
77
	
77
	
78
	OraDatabase.Parameters.Remove "PROD_NAME"
78
	OraDatabase.Parameters.Remove "PROD_NAME"
79
	OraDatabase.Parameters.Remove "PROD_VERSION"
79
	OraDatabase.Parameters.Remove "PROD_VERSION"
80
	OraDatabase.Parameters.Remove "OS_ID"
80
	OraDatabase.Parameters.Remove "OS_ID"
81
	OraDatabase.Parameters.Remove "USER_ID"
81
	OraDatabase.Parameters.Remove "USER_ID"
82
End Sub
82
End Sub
83
'--------------------------------------------------------------------------------------------------------------------------
83
'--------------------------------------------------------------------------------------------------------------------------
84
Sub AddProdToBaseEnv ()
84
Sub AddProdToBaseEnv ()
85
	On Error Resume Next
85
	On Error Resume Next
86
	
86
	
87
	OraDatabase.Parameters.Add "PROD_NAME", 	Request("prod_name"), 		ORAPARM_INPUT, ORATYPE_VARCHAR2
87
	OraDatabase.Parameters.Add "PROD_NAME", 	Request("prod_name"), 		ORAPARM_INPUT, ORATYPE_VARCHAR2
88
	OraDatabase.Parameters.Add "PROD_VERSION", 	Request("prod_version"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
88
	OraDatabase.Parameters.Add "PROD_VERSION", 	Request("prod_version"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
89
	OraDatabase.Parameters.Add "BASE_ENV_ID", 	Request("base_env_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
89
	OraDatabase.Parameters.Add "BASE_ENV_ID", 	Request("base_env_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
90
	OraDatabase.Parameters.Add "OS_ID", 		Request("os_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
90
	OraDatabase.Parameters.Add "OS_ID", 		Request("os_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
91
	OraDatabase.Parameters.Add "USER_ID", 		objAccessControl.UserId, 	ORAPARM_INPUT, ORATYPE_NUMBER 
91
	OraDatabase.Parameters.Add "USER_ID", 		objAccessControl.UserId, 	ORAPARM_INPUT, ORATYPE_NUMBER 
92
	
92
	
93
	objEH.TryORA ( OraSession )
93
	objEH.TryORA ( OraSession )
94
	
94
	
95
	OraDatabase.ExecuteSQL _
95
	OraDatabase.ExecuteSQL _
96
	"DECLARE "&_
96
	"DECLARE "&_
97
	"   outProdId NUMBER;"&_
97
	"   outProdId NUMBER;"&_
98
	"BEGIN   "&_
98
	"BEGIN   "&_
99
	"   pk_Product.New_Product ( :PROD_NAME, :PROD_VERSION, :USER_ID, outProdId );"&_
99
	"   pk_Product.New_Product ( :PROD_NAME, :PROD_VERSION, :USER_ID, outProdId );"&_
100
	"   pk_Base_Env.Add_Product ( outProdId, :BASE_ENV_ID, :OS_ID, :USER_ID );"&_
100
	"   pk_Base_Env.Add_Product ( outProdId, :BASE_ENV_ID, :OS_ID, :USER_ID );"&_
101
	"END;"
101
	"END;"
102
	
102
	
103
	objEH.CatchORA ( OraSession )
103
	objEH.CatchORA ( OraSession )
104
	
104
	
105
	
105
	
106
	OraDatabase.Parameters.Remove "PROD_NAME"
106
	OraDatabase.Parameters.Remove "PROD_NAME"
107
	OraDatabase.Parameters.Remove "PROD_VERSION"
107
	OraDatabase.Parameters.Remove "PROD_VERSION"
108
	OraDatabase.Parameters.Remove "BASE_ENV_ID"
108
	OraDatabase.Parameters.Remove "BASE_ENV_ID"
109
	OraDatabase.Parameters.Remove "OS_ID"
109
	OraDatabase.Parameters.Remove "OS_ID"
110
	OraDatabase.Parameters.Remove "USER_ID"
110
	OraDatabase.Parameters.Remove "USER_ID"
111
End Sub
111
End Sub
112
'--------------------------------------------------------------------------------------------------------------------------
112
'--------------------------------------------------------------------------------------------------------------------------
113
Sub AddProdNew ()
113
Sub AddProdNew ()
114
	
114
	
115
	If Request("skip_similar_names") = "" Then
115
	If Request("skip_similar_names") = "" Then
116
		If HasSimilarNames( Request("prod_name") ) Then
116
		If HasSimilarNames( Request("prod_name") ) Then
117
			Call OpenInWindow ( "wAddProdSimilarNames.asp?prod_name="& Request("prod_name") &"&prod_version="& Request("prod_version") &"&"& objPMod.ComposeURL() )
117
			Call OpenInWindow ( "wAddProdSimilarNames.asp?prod_name="& Request("prod_name") &"&prod_version="& Request("prod_version") &"&"& objPMod.ComposeURL() )
118
		End If
118
		End If
119
	End If
119
	End If
120
	
120
	
121
	'-- Now add product
121
	'-- Now add product
122
	If Request("base_env_id") = "" Then
122
	If Request("base_env_id") = "" Then
123
		'-- Add to OS
123
		'-- Add to OS
124
		Call AddProdToOs()
124
		Call AddProdToOs()
125
		
125
		
126
	Else
126
	Else
127
		'-- Add to Base Env
127
		'-- Add to Base Env
128
		Call AddProdToBaseEnv()
128
		Call AddProdToBaseEnv()
129
		
129
		
130
	End If
130
	End If
131
	
131
	
132
	
132
	
133
	
133
	
134
End Sub
134
End Sub
135
 
135
 
136
'--------------------------------------------------------------------------------------------------------------------------
136
'--------------------------------------------------------------------------------------------------------------------------
137
%>
137
%>
138
<%
138
<%
139
'------------ RUN BEFORE PAGE RENDER ----------
139
'------------ RUN BEFORE PAGE RENDER ----------
140
objPMod.PersistInQryString ( Array("base_env_id") )
140
objPMod.PersistInQryString ( Array("base_env_id") )
141
 
141
 
142
' --- Get Form details from DB ---
142
' --- Get Form details from DB ---
143
 
143
 
144
' --- Load Validation Rules ---
144
' --- Load Validation Rules ---
145
Call objForm.LoadValidationRules ( Array("prod_name","prod_version"), OraDatabase )		' Load Validation Rules
145
Call objForm.LoadValidationRules ( Array("prod_name","prod_version"), OraDatabase )		' Load Validation Rules
146
 
146
 
147
' --- Enter Form Validation Rule Changes here... ----
147
' --- Enter Form Validation Rule Changes here... ----
148
'If Request("base_env_id") <> "" Then
148
'If Request("base_env_id") <> "" Then
149
	' /* There is a problem if you want to add 3rd party product in OS and the Product Name is not to ERG standards.
149
	' /* There is a problem if you want to add 3rd party product in OS and the Product Name is not to ERG standards.
150
	'    I will allow entry of any kind of names and versions for now. */
150
	'    I will allow entry of any kind of names and versions for now. */
151
	objForm.UpdateRules ("id='prod_name' RegExp=''")
151
	objForm.UpdateRules ("id='prod_name' RegExp=''")
152
	objForm.UpdateRules ("id='prod_version' RegExp=''")
152
	objForm.UpdateRules ("id='prod_version' RegExp=''")
153
'End If
153
'End If
154
'----------------------------------------------------
154
'----------------------------------------------------
155
 
155
 
156
If CBool(Request("action")) Then
156
If CBool(Request("action")) Then
157
	If objForm.IsValidOnPostBack Then
157
	If objForm.IsValidOnPostBack Then
158
		'-- Add Product
158
		'-- Add Product
159
		Call AddProdNew()
159
		Call AddProdNew()
160
		
160
		
161
		If objEH.Finally Then
161
		If objEH.Finally Then
162
			Call OpenInParentWindow ( Request("rfile") &"?ADDED=OK"& objPMod.ComposeURLWithout("rfile") )
162
			Call OpenInParentWindow ( Request("rfile") &"?ADDED=OK"& objPMod.ComposeURLWithout("rfile") )
163
			Call CloseWindow()
163
			Call CloseWindow()
164
		End If
164
		End If
165
	End If
165
	End If
166
End If
166
End If
167
 
167
 
168
'----------------------------------------------
168
'----------------------------------------------
169
%>
169
%>
170
<html>
170
<html>
171
<head>
171
<head>
172
<title>Deployment Manager</title>
172
<title>Deployment Manager</title>
173
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
173
<link rel="shortcut icon" href="<%=FavIcon%>"/>
174
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
174
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
175
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
175
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
176
<script language="JavaScript" src="scripts/common.js"></script>
176
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
177
</head>
177
<script language="JavaScript" src="scripts/common.js"></script>
178
 
178
</head>
179
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.prod_name.focus();">
179
 
180
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
180
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.prod_name.focus();">
181
  <tr>
181
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
182
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add Product </span> <br>
182
  <tr>
183
    Enter Product Name and Version.
183
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;Add Product </span> <br>
184
      </td>
184
    Enter Product Name and Version.
185
  </tr>
185
      </td>
186
<%
186
  </tr>
187
'-- FROM START --------------------------------------------------------------------------------------------------------------
187
<%
188
objFormComponent.FormName = "FormName"
188
'-- FROM START --------------------------------------------------------------------------------------------------------------
189
objFormComponent.Action = SCRIPT_NAME
189
objFormComponent.FormName = "FormName"
190
objFormComponent.OnSubmit = "ShowProgress();"
190
objFormComponent.Action = SCRIPT_NAME
191
Call objFormComponent.FormStart()
191
objFormComponent.OnSubmit = "ShowProgress();"
192
%>  
192
Call objFormComponent.FormStart()
193
  <tr>
193
%>  
194
    <td background="images/bg_login.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
194
  <tr>
195
      <tr>
195
    <td background="images/bg_login.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
196
        <td><%=ProgressBar()%></td>
196
      <tr>
197
        <td align="right"><input name="btn" type="reset" class="form_btn" value="&laquo; Back" onClick="history.back();">
197
        <td><%=ProgressBar()%></td>
198
        &nbsp;&nbsp;
198
        <td align="right"><input name="btn" type="reset" class="form_btn" value="&laquo; Back" onClick="history.back();">
199
        <input name="btn" type="submit" class="form_btn" value="Add">
199
        &nbsp;&nbsp;
200
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
200
        <input name="btn" type="submit" class="form_btn" value="Add">
201
      </tr>
201
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
202
    </table></td>
202
      </tr>
203
  </tr>
203
    </table></td>
204
  <tr>
204
  </tr>
205
    <td>
205
  <tr>
206
<!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->		
206
    <td>
207
	<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->	
207
<!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->		
208
	<!--#include file="messages/_msg_inline.asp"-->
208
	<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->	
209
    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
209
	<!--#include file="messages/_msg_inline.asp"-->
210
	<table width="100%"  border="0" cellspacing="2" cellpadding="0">
210
    <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
211
      <tr>
211
	<table width="100%"  border="0" cellspacing="2" cellpadding="0">
212
        <td nowrap class="form_iname" valign="top">Product Name </td>
212
      <tr>
213
        <td valign="top"><%=objFormComponent.TextBox ( "prod_name", objForm.GetValue( "prod_name", objFormCollector.Item("prod_name") ), "size='60' class='form_ivalue'" )%></td>
213
        <td nowrap class="form_iname" valign="top">Product Name </td>
214
		<td valign="top"><%=objForm.Validate ("prod_name")%></td>
214
        <td valign="top"><%=objFormComponent.TextBox ( "prod_name", objForm.GetValue( "prod_name", objFormCollector.Item("prod_name") ), "size='60' class='form_ivalue'" )%></td>
215
      </tr>
215
		<td valign="top"><%=objForm.Validate ("prod_name")%></td>
216
      <tr>
216
      </tr>
217
        <td nowrap class="form_iname" valign="top">Product Version</td>
217
      <tr>
218
        <td valign="top"><%=objFormComponent.TextBox ( "prod_version", objForm.GetValue( "prod_version", objFormCollector.Item("prod_version") ), "size='60' class='form_ivalue'" )%></td>
218
        <td nowrap class="form_iname" valign="top">Product Version</td>
219
		<td valign="top"><%=objForm.Validate ("prod_version")%></td>
219
        <td valign="top"><%=objFormComponent.TextBox ( "prod_version", objForm.GetValue( "prod_version", objFormCollector.Item("prod_version") ), "size='60' class='form_ivalue'" )%></td>
220
      </tr>
220
		<td valign="top"><%=objForm.Validate ("prod_version")%></td>
221
      <tr>
221
      </tr>
222
        <td width="10%" class="form_iname">&nbsp;</td>
222
      <tr>
223
        <td width="1%">&nbsp;</td>
223
        <td width="10%" class="form_iname">&nbsp;</td>
224
		<td width="90%" class="val_err"></td>
224
        <td width="1%">&nbsp;</td>
225
      </tr>
225
		<td width="90%" class="val_err"></td>
226
    </table>
226
      </tr>
227
	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
227
    </table>
228
    </td>
228
	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
229
  </tr>
229
    </td>
230
  <%=objPMod.ComposeHiddenTags()%>
230
  </tr>
231
  <input type="hidden" name="action" value="true">
231
  <%=objPMod.ComposeHiddenTags()%>
232
<%
232
  <input type="hidden" name="action" value="true">
233
Call objFormComponent.FormEnd()
233
<%
234
'-- FROM END ----------------------------------------------------------------------------------------------------------------
234
Call objFormComponent.FormEnd()
235
%>
235
'-- FROM END ----------------------------------------------------------------------------------------------------------------
236
</table>
236
%>
237
</body>
237
</table>
238
</html>
238
</body>
239
<%
239
</html>
240
'------------ RUN AFTER PAGE RENDER -----------
240
<%
241
Set objFormCollector = Nothing
241
'------------ RUN AFTER PAGE RENDER -----------
242
'----------------------------------------------
242
Set objFormCollector = Nothing
243
%><!--#include file="common/globals_destructor.asp"-->
243
'----------------------------------------------
-
 
244
%><!--#include file="common/globals_destructor.asp"-->