| 13 |
rsolanki |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
'| |
|
|
|
5 |
'| wSortBase |
|
|
|
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/_os_common.asp"-->
|
|
|
17 |
|
|
|
18 |
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
|
|
|
22 |
|
|
|
23 |
<%
|
|
|
24 |
'------------ ACCESS CONTROL ------------------
|
|
|
25 |
%>
|
|
|
26 |
<!--#include file="_access_control_general.asp"-->
|
|
|
27 |
<%
|
|
|
28 |
'------------ VARIABLE DEFINITION -------------
|
|
|
29 |
Dim rsQry
|
|
|
30 |
Dim objFormCollector
|
|
|
31 |
Dim sMessage
|
|
|
32 |
Dim parBase_id
|
|
|
33 |
Dim BaseEnvId
|
|
|
34 |
'------------ CONSTANTS DECLARATION -----------
|
|
|
35 |
'Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
|
|
|
36 |
'Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
|
|
|
37 |
'------------ VARIABLE INIT -------------------
|
|
|
38 |
sMessage = NULL
|
|
|
39 |
parBom_id = Request("bom_id")
|
|
|
40 |
parOs_id = Request("os_id")
|
|
|
41 |
parBase_id = Request("base_env_id")
|
|
|
42 |
BaseEnvId = objOsCollector.Item("base_env_id")
|
|
|
43 |
|
|
|
44 |
Set objFormCollector = CreateObject("Scripting.Dictionary")
|
|
|
45 |
'------------ CONDITIONS ----------------------
|
|
|
46 |
'----------------------------------------------
|
|
|
47 |
%>
|
|
|
48 |
<%
|
|
|
49 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
50 |
Sub SortProd ()
|
|
|
51 |
Dim sProdOrderList
|
|
|
52 |
|
|
|
53 |
'-- Check cookie for new soring list
|
|
|
54 |
If Request.Cookies("sort-list") = "" Then Exit Sub
|
|
|
55 |
|
|
|
56 |
'-- Replace pipe separated values with comma for database use
|
|
|
57 |
sProdOrderList = Replace( Request.Cookies("sort-list") , "|", "," )
|
|
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
|
61 |
|
|
|
62 |
On Error Resume Next
|
|
|
63 |
|
|
|
64 |
OraDatabase.Parameters.Add "PROD_ORDER", sProdOrderList, ORAPARM_INPUT, ORATYPE_VARCHAR2
|
|
|
65 |
OraDatabase.Parameters.Add "BASE_ENV", BaseEnvId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
66 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
67 |
|
|
|
68 |
|
|
|
69 |
objEH.TryORA ( OraSession )
|
|
|
70 |
|
|
|
71 |
OraDatabase.ExecuteSQL _
|
|
|
72 |
"BEGIN pk_Base_Env.Sort_Products ( :PROD_ORDER, :BASE_ENV, :USER_ID ); END;"
|
|
|
73 |
|
|
|
74 |
objEH.CatchORA ( OraSession )
|
|
|
75 |
|
|
|
76 |
|
|
|
77 |
OraDatabase.Parameters.Remove "PROD_ORDER"
|
|
|
78 |
OraDatabase.Parameters.Remove "BASE_ENV"
|
|
|
79 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
80 |
End Sub
|
|
|
81 |
|
|
|
82 |
'--------------------------------------------------------------------------------------------------------------------------
|
|
|
83 |
%>
|
|
|
84 |
<%
|
|
|
85 |
'------------ RUN BEFORE PAGE RENDER ----------------
|
|
|
86 |
'----------------------------------------------------
|
|
|
87 |
|
|
|
88 |
If CBool(Request("action")) Then
|
|
|
89 |
'-- Sort Product
|
|
|
90 |
|
|
|
91 |
Call SortProd()
|
|
|
92 |
|
|
|
93 |
If objEH.Finally Then
|
|
|
94 |
%>
|
|
|
95 |
<script language="JavaScript" type="text/javascript">
|
|
|
96 |
<!--
|
|
|
97 |
window.opener.document.location='<%="Os_BaseConf.asp?SORTED=OK"& objPMod.ComposeURLWithout("rfile")%>';
|
|
|
98 |
//-->
|
|
|
99 |
</script>
|
|
|
100 |
|
|
|
101 |
<SCRIPT language="JavaScript" type="text/javascript">
|
|
|
102 |
<!--
|
|
|
103 |
self.close();
|
|
|
104 |
//-->
|
|
|
105 |
</SCRIPT>
|
|
|
106 |
|
|
|
107 |
<%
|
|
|
108 |
'Call OpenInParentWindow ( Request("rfile") &"?SORTED=OK"& objPMod.ComposeURLWithout("rfile") )
|
|
|
109 |
'Call CloseWindow()
|
|
|
110 |
End If
|
|
|
111 |
|
|
|
112 |
End If
|
|
|
113 |
|
|
|
114 |
|
|
|
115 |
|
|
|
116 |
|
|
|
117 |
'----------------------------------------------
|
|
|
118 |
%>
|
|
|
119 |
<html>
|
|
|
120 |
<head>
|
|
|
121 |
<title>Deployment Manager</title>
|
|
|
122 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
123 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
|
124 |
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
|
|
|
125 |
|
|
|
126 |
<script language="JavaScript" src="scripts/common.js"></script>
|
|
|
127 |
|
|
|
128 |
<!-- Drag and Drop modules +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
129 |
<script language="JavaScript" type="text/javascript" src="scripts/dragdrop/tool-man/core.js"></script>
|
|
|
130 |
<script language="JavaScript" type="text/javascript" src="scripts/dragdrop/tool-man/events.js"></script>
|
|
|
131 |
<script language="JavaScript" type="text/javascript" src="scripts/dragdrop/tool-man/css.js"></script>
|
|
|
132 |
<script language="JavaScript" type="text/javascript" src="scripts/dragdrop/tool-man/coordinates.js"></script>
|
|
|
133 |
<script language="JavaScript" type="text/javascript" src="scripts/dragdrop/tool-man/drag.js"></script>
|
|
|
134 |
<script language="JavaScript" type="text/javascript" src="scripts/dragdrop/tool-man/dragsort.js"></script>
|
|
|
135 |
<script language="JavaScript" type="text/javascript" src="scripts/dragdrop/tool-man/cookies.js"></script>
|
|
|
136 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
137 |
|
|
|
138 |
<script language="JavaScript" type="text/javascript"><!--
|
|
|
139 |
var dragsort = ToolMan.dragsort()
|
|
|
140 |
var junkdrawer = ToolMan.junkdrawer()
|
|
|
141 |
|
|
|
142 |
window.onload = function() {
|
|
|
143 |
self.focus();
|
|
|
144 |
|
|
|
145 |
dragsort.makeListSortable(document.getElementById("list"),
|
|
|
146 |
verticalOnly, saveOrder);
|
|
|
147 |
}
|
|
|
148 |
|
|
|
149 |
function verticalOnly(item) {
|
|
|
150 |
item.toolManDragGroup.verticalOnly()
|
|
|
151 |
}
|
|
|
152 |
|
|
|
153 |
function saveOrder(item) {
|
|
|
154 |
var group = item.toolManDragGroup
|
|
|
155 |
var list = group.element.parentNode
|
|
|
156 |
var id = list.getAttribute("id")
|
|
|
157 |
if (id == null) return
|
|
|
158 |
group.register('dragend', function() {
|
|
|
159 |
ToolMan.cookies().set("sort-" + id,
|
|
|
160 |
junkdrawer.serializeList(list), 365)
|
|
|
161 |
})
|
|
|
162 |
}
|
|
|
163 |
|
|
|
164 |
//-->
|
|
|
165 |
</script>
|
|
|
166 |
</head>
|
|
|
167 |
|
|
|
168 |
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0">
|
|
|
169 |
|
|
|
170 |
<table width="100%" border="0" cellspacing="0" cellpadding="10">
|
|
|
171 |
<tr>
|
|
|
172 |
<td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle"> Sort Products </span> <br>
|
|
|
173 |
Drag Products to Sort and then click Submit.
|
|
|
174 |
</td>
|
|
|
175 |
</tr>
|
|
|
176 |
<%
|
|
|
177 |
'-- FROM START --------------------------------------------------------------------------------------------------------------
|
|
|
178 |
objFormComponent.FormName = "FormName"
|
|
|
179 |
objFormComponent.Action = SCRIPT_NAME
|
|
|
180 |
objFormComponent.OnSubmit = "ShowProgress();"
|
|
|
181 |
Call objFormComponent.FormStart()
|
|
|
182 |
%>
|
|
|
183 |
<tr>
|
|
|
184 |
<td background="images/bg_login.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
185 |
<tr>
|
|
|
186 |
<td><%=ProgressBar()%></td>
|
|
|
187 |
<td align="right">
|
|
|
188 |
<input name="btn" type="submit" class="form_btn" value="Submit">
|
|
|
189 |
<input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();"></td></tr>
|
|
|
190 |
</table></td>
|
|
|
191 |
</tr>
|
|
|
192 |
<tr>
|
|
|
193 |
<td>
|
|
|
194 |
<!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
195 |
<!--#include file="messages/_msg_inline.asp"-->
|
|
|
196 |
<!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
197 |
<!-- SORT PRODUCT +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
198 |
<ul id="list" class="boxy">
|
|
|
199 |
<%
|
|
|
200 |
|
|
|
201 |
'OraDatabase.Parameters.Add "OS_ID", parOs_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
202 |
OraDatabase.Parameters.Add "BASE_ENV_ID", parBase_id, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
203 |
|
|
|
204 |
Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("BaseEnvContents.sql"), ORADYN_DEFAULT )
|
|
|
205 |
|
|
|
206 |
OraDatabase.Parameters.Remove "BASE_ENV_ID"
|
|
|
207 |
'OraDatabase.Parameters.Remove "BOM_ID"
|
|
|
208 |
|
|
|
209 |
While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
|
|
|
210 |
%>
|
|
|
211 |
|
|
|
212 |
<li id="<%=rsQry("prod_id")%>"><%=GetProductIcon(rsQry) & rsQry("pkg_name") &" "& rsQry("pkg_version") %></li>
|
|
|
213 |
|
|
|
214 |
<%rsQry.MoveNext%>
|
|
|
215 |
<%
|
|
|
216 |
WEnd
|
|
|
217 |
|
|
|
218 |
rsQry.Close()
|
|
|
219 |
Set rsQry = Nothing
|
|
|
220 |
%>
|
|
|
221 |
</ul>
|
|
|
222 |
<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
|
|
|
223 |
</td>
|
|
|
224 |
</tr>
|
|
|
225 |
<%=objPMod.ComposeHiddenTags()%>
|
|
|
226 |
<input type="hidden" name="action" value="true">
|
|
|
227 |
<%
|
|
|
228 |
Call objFormComponent.FormEnd()
|
|
|
229 |
'-- FROM END ----------------------------------------------------------------------------------------------------------------
|
|
|
230 |
%>
|
|
|
231 |
</table>
|
|
|
232 |
|
|
|
233 |
</body>
|
|
|
234 |
</html>
|
|
|
235 |
<%
|
|
|
236 |
'------------ RUN AFTER PAGE RENDER -----------
|
|
|
237 |
Set objFormCollector = Nothing
|
|
|
238 |
'----------------------------------------------
|
|
|
239 |
%><!--#include file="common/globals_destructor.asp"-->
|