Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
62 rsolanki 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
66 ghuddy 5
'|                RequestProductLocation             |
62 rsolanki 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
<%
17
'------------ VARIABLE DEFINITION -------------
18
Dim IsProductInNewBom
19
Dim QueryName
66 ghuddy 20
 
21
' parameters refering to production BOM items
22
Dim parProdBomId
23
Dim parProdBomProdId
24
 
25
' parameters refering this BOM items
26
Dim parThisBomId
27
Dim parThisProdId
28
Dim parThisPkgId
29
Dim parThisVersion
30
 
62 rsolanki 31
'------------ CONSTANTS DECLARATION -----------
32
'------------ VARIABLE INIT -------------------
66 ghuddy 33
parProdBomId     = Request("bom_id")
34
parProdBomProdId = Request("prod_id")
35
 
36
parThisBomId     = Request("compare_bom_id")
37
parThisProdId    = Request("new_prod_id")
38
parThisPkgId     = Request("pkg_id")
39
parThisVersion   = Request("new_version")
40
 
62 rsolanki 41
'------------ CONDITIONS ----------------------
42
'----------------------------------------------
43
%>
44
<%
45
'--------------------------------------------------------------------------------------------------------------
46
'--------------------------------------------------------------------------------------------------------------
47
%>
48
<%
49
'------------ RUN BEFORE PAGE RENDER ----------
50
'If (Request("change_type") = "R") Then
66 ghuddy 51
'   QueryName = "BomRemovedProductLocation.sql"
52
'   IsProductInNewBom = FALSE
53
 
62 rsolanki 54
'ElseIf (Request("change_type") = "U") Then
66 ghuddy 55
'   QueryName = "BomUpdatedProductLocation.sql"
56
'   IsProductInNewBom = FALSE
62 rsolanki 57
'Else
66 ghuddy 58
 
59
   QueryName = "BomAddedProductLocation.sql"
60
'   IsProductInNewBom = TRUE
61
 
62 rsolanki 62
'End If
63
'----------------------------------------------
64
%>
65
 
66
 
66 ghuddy 67
<table width="100%"  border="0" cellspacing="3" cellpadding="0">
68
   <tr>
69
      <td background="images/bg_form_lightgray.gif" nowrap class="body_txt">
70
         <SPAN id="IMG_EXPAND_PRODNOTES_<%=parThisBomId%>_<%=parThisProdId%>" style="display:block;">
71
            <a href="javascript:;" class="menu_link" onClick="RequestProductNotes('?prod_id=<%=parProdBomProdId%>&new_prod_id=<%=parThisProdId%>', '<%=parThisBomId%>_<%=parThisProdId%>');">
72
               <img src="icons/i_plus.gif" border="0" align="absmiddle" hspace="3">
73
               <img src="icons/i_product.gif" border="0" align="absmiddle" hspace="3">Product Notes
74
            </a>
75
         </SPAN>
76
         <SPAN id="IMG_COLLAPSE_PRODNOTES_<%=parThisBomId%>_<%=parThisProdId%>" style="display:none;">
77
            <a href="javascript:;" class="menu_link" onClick="ToggleDisplay( 'PRODNOTES_<%=parThisBomId%>_<%=parThisProdId%>', 'IMG_EXPAND_PRODNOTES_<%=parThisBomId%>_<%=parThisProdId%>', 'IMG_COLLAPSE_PRODNOTES_<%=parThisBomId%>_<%=parThisProdId%>');">
78
               <img src="icons/i_minus.gif" border="0" align="absmiddle" hspace="3">
79
               <img src="icons/i_product.gif" border="0" align="absmiddle" hspace="3">Product Notes
80
            </a>
81
         </SPAN>
82
      </td>
83
   </tr>
84
   <tr>
85
      <td nowrap valign="top" class="body_row" colspan="3">
86
         <DIV id="PRODNOTES_<%=parThisBomId%>_<%=parThisProdId%>" name="PRODNOTES_<%=parThisBomId%>_<%=parThisProdId%>" style="display:none;"><%=enumLOADING%></DIV>
87
      </td>
88
   </tr>
89
   <%
90
   ' parThisBomId is the ID of the BOM under which exists the package version that was clicked that led to this file being processed.
91
   ' It is not the production BOM, which is referred to by parProdBomId.
92
   ' parThisProdId is the ID of the product in the BOM refered to by parThisBomId
93
   ' parThisPkgId is the ID of the package of which the product is just one instance (version) of.
94
   OraDatabase.Parameters.Add "BOM_ID",   parThisBomId,  ORAPARM_INPUT, ORATYPE_NUMBER
95
   OraDatabase.Parameters.Add "PROD_ID",  parThisProdId, ORAPARM_INPUT, ORATYPE_NUMBER
96
   OraDatabase.Parameters.Add "PKG_ID",   parThisPkgId,  ORAPARM_INPUT, ORATYPE_NUMBER
62 rsolanki 97
 
66 ghuddy 98
   Dim rsQryThisBom
99
   Set rsQryThisBom = OraDatabase.DbCreateDynaset( GetQuery ( QueryName ), ORADYN_DEFAULT )
62 rsolanki 100
 
66 ghuddy 101
   Dim bgColor
102
   bgColor = NULL
62 rsolanki 103
 
66 ghuddy 104
   If rsQryThisBom.RecordCount < 1 Then
105
      %>
106
      <tr>
107
         <td <%=bgColor%> nowrap valign="top" class="body_row" colspan="2">Product not found.</td>
108
      </tr>
109
      <%
110
   End If
111
 
112
   While (NOT rsQryThisBom.BOF) AND (NOT rsQryThisBom.EOF)
113
 
114
      If IsNull( bgColor ) Then
115
         bgColor = "bgcolor='#F5F5F5'"
116
      Else
117
         bgColor = NULL
118
      End If
119
 
120
      If parProdBomId <> "" AND parThisProdId <> "" Then
121
 
122
         ' Get information from package_versions table for this product
123
         Dim rsQryThisBomPkgVer, ThisBomPkgName, ThisBomPkgVersion, ThisBomPkgId
124
 
125
         Set rsQryThisBomPkgVer = OraDatabase.DbCreateDynaset( "select * from package_versions pv, packages pkg where pv.pv_id = "&parThisProdId&" and pkg.pkg_id = pv.pkg_id", cint(0))
126
 
127
         ThisBomPkgName    = rsQryThisBomPkgVer("pkg_name")
128
         ThisBomPkgVersion = rsQryThisBomPkgVer("pkg_version")
129
         ThisBomPkgId      = rsQryThisBomPkgVer("pkg_id")
130
 
131
         rsQryThisBomPkgVer.Close()
132
         Set rsQryThisBomPkgVer = nothing
133
 
134
         ' Get the project and branch name for the production BOM
135
         Dim rsQryProdBom, ProdBomProjName, ProdBomBranchName
136
         Set rsQryProdBom = OraDatabase.DbCreateDynaset( "select br.branch_name, prj.proj_name from boms bm, branches br, dm_projects prj where bm.bom_id = "&parProdBomId&" and br.BRANCH_ID = bm.RTAG_ID_FK and prj.PROJ_ID = br.PROJ_ID", cint(0))
137
 
138
         ProdBomProjName   = rsQryProdBom("proj_name")
139
         ProdBomBranchName = rsQryProdBom("branch_name")
140
 
141
         rsQryProdBom.Close()
142
         Set rsQryProdBom = nothing
143
 
144
         ' Get the OS name
145
         Dim rsOS, OSName
146
         Set rsOS = OraDatabase.DbCreateDynaset( "select bt.bos_type from os_base_env obe, base_env be, bos_types bt where obe.OS_ID = "&rsQryThisBom("os_id")&" and be.BASE_ENV_ID = obe.BASE_ENV_ID and bt.BOS_ID = be.BOS_ID", cint(0))
147
 
148
         OSName = rsOS("bos_type")
149
 
150
         If OSName = "Windows" OR OSName = "MOS" Then
151
            OSName = "win32"
152
         Else
153
            OSName = "sparc"
154
         End If
155
 
156
         rsOS.Close()
157
         Set rsOS = nothing
158
 
159
      End If
160
 
161
      ' Now display the information we have gathered
162
      %>
163
      <tr>
164
         <td <%=bgColor%> nowrap valign="top" class="body_row" colspan="2">&nbsp;&nbsp;&nbsp;&nbsp;
165
            <%'If IsProductInNewBom Then%>
166
            <img hspace="4" src="icons/<%=rsQryThisBom("node_icon")%>" align="absmiddle" border="0"><a href="NodeDefault.asp?node_id=<%=rsQryThisBom("node_id")%>&bom_id=<%=parThisBomId%>" class="body_link"><%=rsQryThisBom("node_name")%></a>
167
            &nbsp;/&nbsp;<a href="OsDefault.asp?os_id=<%=rsQryThisBom("os_id")%>&bom_id=<%=parThisBomId%>" class="body_link"><%=rsQryThisBom("os_name") %></a>
168
            &nbsp;/&nbsp;<%=rsQryThisBom("pkg_name") &" "& rsQryThisBom("pkg_version")%>
169
            <%'Else%>
170
            <%If InStr(APP_ROOT, "DEPLOYMAN_WWW") > 0 Then%>
72 brianf 171
               &nbsp;&nbsp;<a href="LogDownload.asp?url=http://bms:8002/manager_suite/production_manager/downloads/<%=ThisBomPkgName%>-<%=ThisBomPkgVersion%>-<%=OSName%>.zip&pkg_id=<%=ThisBomPkgId%>&pkg_version=<%=ThisBomPkgVersion%>"  target="_blank" class="body_link">Download Version: <%=Request("new_version") %></a>&nbsp;&nbsp;
66 ghuddy 172
            <%Else%>
72 brianf 173
               &nbsp;&nbsp;<a href="LogDownload.asp?url=http://bms:8002/releases/<%=ProdBomProjName%>/<%=ProdBomBranchName%>/<%=ThisBomPkgName%>/<%=OSName%>/<%=ThisBomPkgVersion%>/<%=ThisBomPkgName%>-<%=ThisBomPkgVersion%>-<%=OSName%>.zip&pkg_id=<%=ThisBomPkgId%>&pkg_version=<%=ThisBomPkgVersion%>"  target="_blank" class="body_link">Download Version: <%=parThisVersion %></a>&nbsp;&nbsp;
66 ghuddy 174
            <%End If%>
175
            <%'End If%>
176
 
177
         </td>
178
      </tr>
179
      <%
180
      rsQryThisBom.MoveNext
181
   WEnd
182
 
183
   OraDatabase.Parameters.Remove "BOM_ID"
184
   OraDatabase.Parameters.Remove "PROD_ID"
185
   OraDatabase.Parameters.Remove "PKG_ID"
186
 
187
   rsQryThisBom.Close
188
   Set rsQryThisBom = Nothing
189
   %>
190
 
191
</table>
192
 
62 rsolanki 193
<%
194
'------------ RUN AFTER PAGE RENDER -----------
195
'----------------------------------------------
66 ghuddy 196
%><!--#include file="common/globals_destructor.asp"-->