Subversion Repositories DevTools

Rev

Rev 62 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
62 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|	          wUpdateProdAtNodes.asp				 |
6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/config.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/_popup_window_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<%
22
'------------ VARIABLE DEFINITION -------------
23
Dim rsQry
24
Dim objFormCollector
25
'------------ CONSTANTS DECLARATION -----------
26
'------------ VARIABLE INIT -------------------
27
parBom_id = Request("bom_id")
28
Set objFormCollector = CreateObject("Scripting.Dictionary")
29
'------------ CONDITIONS ----------------------
30
'----------------------------------------------
31
%>
32
<%
33
'--------------------------------------------------------------------------------------------------------------------------
34
Sub GetFormDetails ( nBom_id, ByRef outobjDetails )
35
	Dim rsQry, query
36
	OraDatabase.Parameters.Add "BOM_ID", 		nBom_id,		ORAPARM_INPUT, ORATYPE_NUMBER 
37
	OraDatabase.Parameters.Add "BASE_ENV_ID", 	NULL,			ORAPARM_INPUT, ORATYPE_NUMBER 
38
 
39
 
40
	query = _
41
	"   SELECT proj.RM_PROJECTS_FK,"&_
42
	"		   br.RM_VTREE_FK"&_
43
	"	  FROM DM_PROJECTS proj,"&_
44
	"	  	   BRANCHES br,"&_
45
	"		   BOMS bo"&_
46
	"	 WHERE br.PROJ_ID = proj.PROJ_ID"&_
47
	"	   AND bo.BRANCH_ID = br.BRANCH_ID"&_
48
	"	   AND bo.BOM_ID = :BOM_ID"
49
 
50
	Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
51
	If (NOT rsQry.BOF) AND (NOT rsQry.EOF)Then
52
		outobjDetails.Item ("rm_projects_fk") = rsQry("rm_projects_fk")
53
		outobjDetails.Item ("rm_vtree_fk") = rsQry("rm_vtree_fk")
54
 
55
	End If
56
 
57
 
58
	OraDatabase.Parameters.Remove "BOM_ID"
59
	OraDatabase.Parameters.Remove "BASE_ENV_ID"
60
 
61
	rsQry.Close
62
	Set rsQry = Nothing
63
End Sub
64
'--------------------------------------------------------------------------------------------------------------------------
65
Sub AddProd ()
66
	On Error Resume Next
67
 
68
	OraDatabase.Parameters.Add "PROD_ID_LIST", 	Request("prod_id_list"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2
69
	OraDatabase.Parameters.Add "OS_ID", 		Request("os_id"), 			ORAPARM_INPUT, ORATYPE_NUMBER 
70
 
71
 
72
	objEH.TryORA ( OraSession )
73
 
74
	OraDatabase.ExecuteSQL _
75
	"BEGIN   pk_Product.Add_Product ( :PROD_ID_LIST, :OS_ID );   END;"
76
 
77
	objEH.CatchORA ( OraSession )
78
 
79
 
80
	OraDatabase.Parameters.Remove "PROD_ID_LIST"
81
	OraDatabase.Parameters.Remove "OS_ID"
82
End Sub
83
'--------------------------------------------------------------------------------------------------------------------------
84
Function SearchPackageNames ( SSpkgfind )
85
	Dim pkg_name_like, SQLor, pkglistARR
86
 
87
	SQLor = ""
88
	If Len( Replace( SSpkgfind, " ", "" ) ) = 0 Then
89
		' Show all pkg names
90
		SQLor = " OR pkg.pkg_name LIKE '%'"
91
 
92
	Else
93
		' Search for ...
94
		pkglistARR = Split( Trim( SSpkgfind ), " ")
95
 
96
		If Ubound( pkglistARR ) > 0 Then
97
			' Multiple pkg_name search
98
			For Each pkg_name_like In pkglistARR
99
				If pkg_name_like <> "" Then
100
					SQLor = SQLor &" OR UPPER(pkg.pkg_name) LIKE UPPER('%"& pkg_name_like &"%')"
101
				End If
102
			Next
103
 
104
		Else
105
			' Single pkg_name search
106
			SQLor = " OR UPPER(pkg.pkg_name) LIKE UPPER('%"& Trim( SSpkgfind ) &"%')"
107
		End If
108
 
109
	End If
110
 
111
	Search_For_Package_Names = _
112
	" SELECT pkg.*"&_
113
	"  FROM packages pkg"&_
114
	" WHERE pkg.pkg_id != 0"&_
115
	"   AND ( pkg.pkg_name = ''"&_
116
	SQLor &_
117
	"       )"&_
118
	"ORDER BY UPPER(pkg.pkg_name)"
119
 
120
End Function
121
'--------------------------------------------------------------------------------------------------------------------------
122
%>
123
<%
124
'------------ RUN BEFORE PAGE RENDER ----------
125
If CBool(Request("action")) Then
126
	If Request("prod_id_list") <> "" Then
127
		'-- Add Product List
128
		Call AddProd()
129
 
130
		If objEH.Finally Then
131
			Call OpenInParentWindow ( Request("rfile") &"?"& objPMod.ComposeURL() )
132
			Call CloseWindow()
133
		End If
134
 
135
 
136
	ElseIf Request("prod_name") <> "" Then
137
		'-- Product Search
138
 
139
 
140
	End If
141
 
142
End If
143
 
144
Call GetFormDetails ( parBom_id, objFormCollector )
145
'----------------------------------------------
146
%>
147
<html>
148
<head>
149
<title>Deployment Manager</title>
150
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
151
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
152
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
153
<script language="JavaScript" src="scripts/common.js"></script>
154
</head>
155
 
156
<body background="images/bg_form.gif" leftmargin="0" topmargin="0" onLoad="self.focus();">
157
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
158
  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>">
159
  <tr>
160
    <td background="images/bg_login.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
161
      <tr>
162
        <td>&nbsp;</td>
163
        <td align="right">
164
		  <input name="btn" type="submit" class="form_btn" value="&laquo; Back">
165
		  <input name="btn" type="submit" class="form_btn" value="Next &raquo;">&nbsp;
166
		  <input name="btn" type="submit" class="form_btn" value="Finish">&nbsp;
167
          <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td>
168
      </tr>
169
    </table></td>
170
  </tr>
171
  <tr>
172
    <td 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>
173
    Product is Found   Search for Product or select from &quot;Recently Released Products&quot;.
174
      <hr width="100%" size="1" noshade color="#ACA899"></td>
175
  </tr>
176
  <tr>
177
    <td>
178
<!-- RECENT PRODUCTS ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->	
179
	<span class="body_colb">Product Found At Other Locations</span>      
180
	<table width="100%"  border="0" cellspacing="3" cellpadding="0">
181
      <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
182
      <%If NOT objEH.Finally Then%>
183
      <tr>
184
        <td><img src="images/spacer.gif" width="1" height="1"></td>
185
        <td colspan="2">
186
          <%objEH.DisplayMessage()%>
187
        </td>
188
      </tr>
189
      <%End If%>
190
      <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
191
      <tr>
192
        <td width="1" background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
193
        <td width="30%" background="images/bg_table_border.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
194
            <tr>
195
              <td align="right" nowrap background="images/bg_table_col.gif" class="body_col">Products</td>
196
            </tr>
197
        </table></td>
198
        <td width="70%" align="right" background="images/bg_table_col.gif" class="body_col"></td>
199
      </tr>
200
      <%
201
	  ' -- Only run if links with Release Manager
202
	  If (objFormCollector.Item("rm_projects_fk") <> "")  AND  (objFormCollector.Item("rm_vtree_fk") <> "") Then
203
 
204
		  OraDatabase.Parameters.Add "RM_PROJECTS_FK", 			objFormCollector.Item("rm_projects_fk"),	ORAPARM_INPUT, ORATYPE_NUMBER 
205
		  OraDatabase.Parameters.Add "RM_VTREE_FK", 			objFormCollector.Item("rm_vtree_fk"),		ORAPARM_INPUT, ORATYPE_NUMBER 
206
		  OraDatabase.Parameters.Add "RM_PRODUCTS_BASE_VIEW", 	enumPRODUCTS_BASE_VIEW_ID,					ORAPARM_INPUT, ORATYPE_NUMBER 
207
		  OraDatabase.Parameters.Add "DAYS_BACK_IN_TIME", 		enumRELEASES_DAYS_BACK_IN_TIME,				ORAPARM_INPUT, ORATYPE_NUMBER 
208
		  OraDatabase.Parameters.Add "BOM_ID", 					parBom_id,									ORAPARM_INPUT, ORATYPE_NUMBER 
209
 
210
		  Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("LatestRecentlyReleasedProducts.sql"), ORADYN_DEFAULT )
211
		  While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
212
		  %>
213
      <tr>
214
        <td nowrap class="form_iname"><input type="checkbox" name="prod_at_os" value="<%=rsQry("prod_id")%>" <%=rsQry("used")%>></td>
215
        <td valign="top" nowrap class="body_txt"><img src="icons/i_product.gif" width="19" height="19" hspace="2" align="absmiddle"><%=rsQry("pkg_name") &" "& rsQry("pkg_version")%></td>
216
        <td valign="top" class="body_rowg"><%If NOT IsNull(rsQry("used")) Then%>Already Added.<%End If%></td>
217
      </tr>
218
      <%rsQry.MoveNext%>
219
      <%If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then%>
220
      <tr>
221
        <td colspan="3" background="images/bg_table_border.gif"><img src="images/spacer.gif" width="1" height="1"></td>
222
      </tr>
223
      <%End If%>
224
      <%
225
		  WEnd
226
 
227
		  OraDatabase.Parameters.Remove "RM_PROJECTS_FK"
228
		  OraDatabase.Parameters.Remove "RM_VTREE_FK"
229
		  OraDatabase.Parameters.Remove "RM_PRODUCTS_BASE_VIEW"
230
		  OraDatabase.Parameters.Remove "DAYS_BACK_IN_TIME"
231
		  OraDatabase.Parameters.Remove "BOM_ID"
232
 
233
	  End If
234
	  %>
235
      <tr>
236
        <td colspan="3" background="images/bg_table_border.gif">
237
          <table width="100%"  border="0" cellspacing="1" cellpadding="2">
238
            <tr>
239
              <td nowrap background="images/bg_table_col.gif"><img src="images/spacer.gif" width="1" height="1"></td>
240
            </tr>
241
        </table></td>
242
      </tr>
243
    </table>
244
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->		
245
	</td>
246
  </tr>
247
  <%Response.write Request("prod_id_list") &"<br>"%>
248
  <%Response.write Request("prod_at_os")%>
249
  <input type="hidden" name="prod_at_os" value="<%=Request("prod_at_os")%>">
250
  <input type="hidden" name="action" value="true">
251
  </form>
252
</table>
253
</body>
254
</html>
255
<%
256
'------------ RUN AFTER PAGE RENDER -----------
257
Set objFormCollector = Nothing
258
'----------------------------------------------
259
%><!--#include file="common/globals_destructor.asp"-->