| 5355 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
'| |
|
|
|
5 |
'| NewBom |
|
|
|
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/_form_window_common.asp"-->
|
|
|
17 |
<%
|
|
|
18 |
'------------ ACCESS CONTROL ------------------
|
|
|
19 |
%>
|
|
|
20 |
<!--#include file="_access_control_general.asp"-->
|
|
|
21 |
<%
|
|
|
22 |
'------------ VARIABLE DEFINITION -------------
|
|
|
23 |
Dim rsQry
|
|
|
24 |
Dim isSelectDisabled
|
|
|
25 |
'------------ CONSTANTS DECLARATION -----------
|
|
|
26 |
Const enumBOM_EDITMODE = "<img src='icons/bi_edit.gif' width='20' height='16' border='0' align='absmiddle' hspace='5' vspace='3' title='BOM is in edit mode.'>"
|
|
|
27 |
Const enumBOM_NEW = "<img src='icons/bi_new.gif' width='20' height='16' border='0' align='absmiddle' hspace='5' vspace='3' title='New BOM available.'>"
|
|
|
28 |
Const enumBOM_ACCEPTED = "<img src='icons/bi_accepted.gif' width='20' height='16' border='0' align='absmiddle' hspace='5' vspace='3' title='BOM is tested and Accepted.'>"
|
|
|
29 |
Const enumBOM_REJECTED = "<img src='icons/bi_rejected.gif' width='20' height='16' border='0' align='absmiddle' hspace='5' vspace='3' title='BOM is tested and Rejected.'>"
|
|
|
30 |
'------------ VARIABLE INIT -------------------
|
|
|
31 |
parProj_id = Request("proj_id")
|
|
|
32 |
parBranch_id = Request("branch_id")
|
|
|
33 |
'------------ CONDITIONS ----------------------
|
|
|
34 |
'----------------------------------------------
|
|
|
35 |
%>
|
|
|
36 |
<%
|
|
|
37 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
38 |
Sub GetRecentBoms ( nBranch_id )
|
|
|
39 |
Dim rsQry, query
|
|
|
40 |
OraDatabase.Parameters.Add "BRANCH_ID", nBranch_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
41 |
|
|
|
42 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("RecentBomsInBranch.sql"), ORADYN_DEFAULT )
|
|
|
43 |
If rsQry.RecordCount < 1 Then
|
|
|
44 |
Response.write "There are no recent BOMs found."
|
|
|
45 |
End If
|
|
|
46 |
|
|
|
47 |
While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
|
|
|
48 |
Response.write "<a href='AddBomFrom.asp?from_bom_id="& rsQry("bom_id") &"&"& objPMod.ComposeURL() &"' class='menu_link'>"&_
|
|
|
49 |
BomIcon( rsQry("is_readonly"), rsQry("is_rejected") ) & rsQry("bom_name").Value &" "& rsQry("bom_version") &"."& rsQry("bom_lifecycle") &"</a><br>"
|
|
|
50 |
rsQry.MoveNext
|
|
|
51 |
WEnd
|
|
|
52 |
|
|
|
53 |
OraDatabase.Parameters.Remove "BRANCH_ID"
|
|
|
54 |
|
|
|
55 |
rsQry.Close
|
|
|
56 |
Set rsQry = Nothing
|
|
|
57 |
End Sub
|
|
|
58 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
59 |
Function GetProjectList ( nProjId )
|
|
|
60 |
Dim rsQry, Selected, aComboItems, lastItem, i
|
|
|
61 |
|
|
|
62 |
OraDatabase.Parameters.Add "PROJ_ID", nProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
63 |
|
|
|
64 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("ProjectsCombo.sql"), ORADYN_DEFAULT )
|
|
|
65 |
|
|
|
66 |
If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
|
|
|
67 |
aComboItems = rsQry.GetRows()
|
|
|
68 |
|
|
|
69 |
Else
|
|
|
70 |
Err.Raise 8, "Sub GetProjectList", "Empty record set returned. nProjId="& nProjId
|
|
|
71 |
|
|
|
72 |
End If
|
|
|
73 |
|
|
|
74 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
75 |
|
|
|
76 |
rsQry.Close
|
|
|
77 |
Set rsQry = Nothing
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
'-- Alter combo item link column to work with OnChange javascript
|
|
|
81 |
lastItem = Ubound( aComboItems, 2 )
|
|
|
82 |
For i = 0 To lastItem
|
|
|
83 |
aComboItems(0, i) = SCRIPT_NAME &"?from_proj_id="& aComboItems(0, i) &"&"& objPMod.ComposeURL()
|
|
|
84 |
Next
|
|
|
85 |
|
|
|
86 |
|
|
|
87 |
'-- Return Combo Items Array
|
|
|
88 |
GetProjectList = aComboItems
|
|
|
89 |
|
|
|
90 |
End Function
|
|
|
91 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
92 |
Function GetBranchList ( nProjId, nBranch_id )
|
|
|
93 |
Dim rsQry, Selected, aComboItems, lastItem, i
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
OraDatabase.Parameters.Add "PROJ_ID", nProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
97 |
OraDatabase.Parameters.Add "BRANCH_ID", nBranch_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
98 |
|
|
|
99 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("BranchesCombo.sql"), ORADYN_DEFAULT )
|
|
|
100 |
|
|
|
101 |
If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
|
|
|
102 |
aComboItems = rsQry.GetRows()
|
|
|
103 |
|
|
|
104 |
End If
|
|
|
105 |
|
|
|
106 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
107 |
OraDatabase.Parameters.Remove "BRANCH_ID"
|
|
|
108 |
|
|
|
109 |
rsQry.Close
|
|
|
110 |
Set rsQry = Nothing
|
|
|
111 |
|
|
|
112 |
If IsArray(aComboItems) Then
|
|
|
113 |
'-- Alter combo item link column to work with OnChange javascript
|
|
|
114 |
lastItem = Ubound( aComboItems, 2 )
|
|
|
115 |
For i = 0 To lastItem
|
|
|
116 |
aComboItems(0, i) = SCRIPT_NAME &"?from_proj_id="& nProjId &"&from_branch_id="& aComboItems(0, i) &"&"& objPMod.ComposeURL()
|
|
|
117 |
Next
|
|
|
118 |
End If
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
'-- Return Combo Items Array
|
|
|
122 |
GetBranchList = aComboItems
|
|
|
123 |
|
|
|
124 |
End Function
|
|
|
125 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
126 |
Function GetBomList ( nProjId, nBranch_id )
|
|
|
127 |
Dim rsQry, Selected, aComboItems, lastItem, i
|
|
|
128 |
|
|
|
129 |
|
|
|
130 |
OraDatabase.Parameters.Add "PROJ_ID", nProjId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
131 |
OraDatabase.Parameters.Add "BRANCH_ID", nBranch_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
132 |
OraDatabase.Parameters.Add "BOM_ID", 0, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
133 |
|
|
|
134 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("BomsCombo.sql"), ORADYN_DEFAULT )
|
|
|
135 |
|
|
|
136 |
If ((NOT rsQry.BOF) AND (NOT rsQry.EOF)) Then
|
|
|
137 |
GetBomList = rsQry.GetRows()
|
|
|
138 |
|
|
|
139 |
End If
|
|
|
140 |
|
|
|
141 |
OraDatabase.Parameters.Remove "PROJ_ID"
|
|
|
142 |
OraDatabase.Parameters.Remove "BRANCH_ID"
|
|
|
143 |
OraDatabase.Parameters.Remove "BOM_ID"
|
|
|
144 |
|
|
|
145 |
rsQry.Close
|
|
|
146 |
Set rsQry = Nothing
|
|
|
147 |
End Function
|
|
|
148 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
149 |
%>
|
|
|
150 |
<%
|
|
|
151 |
'------------ RUN BEFORE PAGE RENDER ----------
|
|
|
152 |
'-- Redirect if known from_bom_id
|
|
|
153 |
If Request("bom_id_list") <> "" Then
|
|
|
154 |
Call OpenInWindow ( "AddBomFrom.asp?from_bom_id="& Request("bom_id_list") &"&"& objPMod.ComposeURL() )
|
|
|
155 |
End If
|
|
|
156 |
|
|
|
157 |
'----------------------------------------------
|
|
|
158 |
%>
|
|
|
159 |
<html>
|
|
|
160 |
<head>
|
|
|
161 |
<title>Deployment Manager</title>
|
|
|
162 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
163 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
164 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
| 6663 |
dpurdie |
165 |
<link href="scripts/deployment_manager.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
|
|
|
166 |
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
|
| 5355 |
dpurdie |
167 |
|
|
|
168 |
</head>
|
|
|
169 |
<body background="images/bg_lite_blue.gif" leftmargin="0" topmargin="0">
|
|
|
170 |
<!-- HEADER ++++++++++++++++ -->
|
|
|
171 |
<!--#include file="_header.asp"-->
|
|
|
172 |
<!-- +++++++++++++++++++++++ -->
|
|
|
173 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
174 |
<%
|
|
|
175 |
'-- FROM START ---------------------------------------------------------------------------------------------------------
|
|
|
176 |
objFormComponent.FormName = "FormName"
|
|
|
177 |
objFormComponent.Action = "AddBomFrom.asp"
|
|
|
178 |
Call objFormComponent.FormStart()
|
|
|
179 |
%>
|
|
|
180 |
<tr>
|
|
|
181 |
<td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="42"></td>
|
|
|
182 |
</tr>
|
|
|
183 |
<tr>
|
|
|
184 |
<td align="center" valign="middle" bgcolor="#FFFFFF">
|
|
|
185 |
<!-- FROM ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
186 |
<table width="600" border="0" cellspacing="0" cellpadding="1">
|
|
|
187 |
<tr>
|
|
|
188 |
<td background="images/bg_bage_2.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
189 |
<tr>
|
|
|
190 |
<td bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="10">
|
|
|
191 |
<tr>
|
|
|
192 |
<td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src='icons/bi_new.gif' width='20' height='16' border='0' align='absmiddle' hspace='2'>New BOM </span> <br>
|
|
|
193 |
Create New Bill of Materials (BOM) by selecting available options below.</td>
|
|
|
194 |
</tr>
|
|
|
195 |
<tr>
|
|
|
196 |
<td background="images/bg_bage_0.gif">
|
|
|
197 |
<table width="100%" border="0" cellspacing="10" cellpadding="0">
|
|
|
198 |
<tr>
|
|
|
199 |
<td width="33%" valign="top" class="body_txt">
|
|
|
200 |
<strong>Create New</strong><br>
|
|
|
201 |
<a href="AddBlankBom.asp?NEXT=OK&<%=objPMod.ComposeURL()%>" class="menu_link"><img src="icons/bi_new.gif" width="20" height="16" hspace="5" vspace="3" border="0" align="absmiddle">Blank </a><br><br>
|
|
|
202 |
</td>
|
|
|
203 |
<td width="1" background="images/bg_bage_2.gif"><img src="images/spacer.gif" width="1" height="250"></td>
|
|
|
204 |
<td nowrap width="34%" valign="top" class="body_txt">
|
|
|
205 |
<strong>Create from Recent </strong><br>
|
|
|
206 |
<%Call GetRecentBoms ( parBranch_id )%>
|
|
|
207 |
</td>
|
|
|
208 |
<td width="1" background="images/bg_bage_2.gif"><img src="images/spacer.gif" width="1" height="1"></td>
|
|
|
209 |
<td width="33%" valign="top" class="body_txt" nowrap>
|
|
|
210 |
<strong>Create From Other</strong><br><br>
|
|
|
211 |
<%=objFormComponent.Combo ( "from_proj_id", GetProjectList( Request("from_proj_id") ), TRUE, "class='form_ivalue' onChange=""MM_jumpMenu('parent',this,0)"" " )%><br>
|
|
|
212 |
<%
|
|
|
213 |
If Request("from_proj_id") <> "" Then
|
|
|
214 |
Response.write objFormComponent.Combo ( "from_branch_id", GetBranchList( Request("from_proj_id"), Request("from_branch_id") ), TRUE, "class='form_ivalue' onChange=""MM_jumpMenu('parent',this,0)"" " )
|
|
|
215 |
Response.write "<br>"
|
|
|
216 |
End If
|
|
|
217 |
%>
|
|
|
218 |
<%
|
|
|
219 |
isSelectDisabled = "disabled"
|
|
|
220 |
If Request("from_branch_id") <> "" Then
|
|
|
221 |
Response.write objFormComponent.Combo ( "from_bom_id", GetBomList( Request("from_proj_id"), Request("from_branch_id") ), FALSE, "class='form_ivalue' " )
|
|
|
222 |
Response.write "<br>"
|
|
|
223 |
isSelectDisabled = ""
|
|
|
224 |
End If
|
|
|
225 |
%>
|
|
|
226 |
<%=objFormComponent.SubmitButton ( "Select", "class='form_ivalue' "& isSelectDisabled )%>
|
|
|
227 |
</td>
|
|
|
228 |
</tr>
|
|
|
229 |
</table>
|
|
|
230 |
</td>
|
|
|
231 |
</tr>
|
|
|
232 |
<tr>
|
|
|
233 |
<td background="images/bg_login.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
234 |
<tr>
|
|
|
235 |
<td></td>
|
|
|
236 |
<td align="right">
|
|
|
237 |
<%=objFormComponent.CancelButton ( "Cancel", "class='form_btn'", Request("rfile") &"?CANCEL=OK"& objPMod.ComposeURLWithout("rfile") )%></td>
|
|
|
238 |
</tr>
|
|
|
239 |
</table></td>
|
|
|
240 |
</tr>
|
|
|
241 |
<%=objPMod.ComposeHiddenTags()%>
|
|
|
242 |
</table></td>
|
|
|
243 |
</tr>
|
|
|
244 |
</table></td>
|
|
|
245 |
</tr>
|
|
|
246 |
</table>
|
|
|
247 |
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --> </td>
|
|
|
248 |
</tr>
|
|
|
249 |
<tr>
|
|
|
250 |
<td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="42"></td>
|
|
|
251 |
</tr>
|
|
|
252 |
<%
|
|
|
253 |
Call objFormComponent.FormEnd()
|
|
|
254 |
'-- FROM END ----------------------------------------------------------------------------------------------------------------
|
|
|
255 |
%>
|
|
|
256 |
</table>
|
|
|
257 |
<!-- FOOTER ++++++++++++++++++++++ -->
|
|
|
258 |
<!--#include file="_footer.asp"-->
|
|
|
259 |
<!-- +++++++++++++++++++++++++++++ -->
|
|
|
260 |
</body>
|
|
|
261 |
</html>
|