Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
5355 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
5
'|			          AdminProjectIterations	 	 |
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/_admin_projects_common.asp"-->
17
<%
18
'------------ ACCESS CONTROL ------------------
19
%>
20
<!--#include file="_access_control_general.asp"-->
21
<!--#include file="_access_control_admin_pages.asp"-->
22
<%
23
'------------ VARIABLE DEFINITION -------------
24
Dim rsQry
25
Dim i
26
Dim LastRow
27
Dim aIterationCollector
28
Dim parAction
29
'------------ CONSTANTS DECLARATION -----------
30
'------------ VARIABLE INIT -------------------
31
parAction = Request("action")
32
parBranch_id = Request("branch_id")
33
'------------ CONDITIONS ----------------------
34
'----------------------------------------------
35
%>
36
<%
37
'--------------------------------------------------------------------------------------------------------------------------------
38
Sub GetIterations ( aIterationCollector, nProj_id )
39
	Dim rsQry
40
 
41
	OraDatabase.Parameters.Add "PROJ_ID", nProj_id,	ORAPARM_INPUT, ORATYPE_NUMBER 
42
 
43
	Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("AdminProductionList.sql"), ORADYN_DEFAULT )
44
 
45
	If rsQry.RecordCount > 0 Then
46
		aIterationCollector = rsQry.GetRows()
47
	Else
48
		aIterationCollector = NULL
49
	End If
50
 
51
	rsQry.Close
52
	Set rsQry = Nothing
53
	OraDatabase.Parameters.Remove "PROJ_ID"
54
End Sub
55
'--------------------------------------------------------------------------------------------------------------------------------
56
Sub RenderPMBOMCombo( nVtree_id, nRMProj_fk ) 
57
	Dim rsQry, Disabled, Query
58
 
59
	Disabled = ""
60
 
61
	If (nRMProj_fk = "") OR ( IsNull(nRMProj_fk) ) Then Disabled = "disabled"
62
 
63
	OraDatabase.Parameters.Add "RM_PROJ_FK", 	nRMProj_fk,	ORAPARM_INPUT, ORATYPE_NUMBER
64
	OraDatabase.Parameters.Add "VTREE_ID", 		nVtree_id,	ORAPARM_INPUT, ORATYPE_NUMBER
65
 
66
	Query  = "select * from"&_
67
			 "	branches br, boms bm, bom_names bn"&_
68
			 "	where br.proj_id = "&Request("PROJ_ID")&""&_
69
			 "	and bm.BRANCH_ID = br.BRANCH_ID"&_
70
			 "	and bn.BOM_NAME_ID = bm.BOM_NAME_ID"&_
71
			 "  and bm.bom_id not in (select bom_id from production_bom)"
72
 
73
	Set rsQry = OraDatabase.DbCreateDynaset( Query, ORADYN_DEFAULT )
74
 
75
 
76
	Response.write "<select name='bom_id' class='form_iname' "& Disabled &">"
77
 
78
 
79
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
80
		Response.write "<option value='"& rsQry("bom_id") &"'>"& rsQry("bom_name").Value &""&VBNewLine&""& rsQry("bom_version") &"."&rsQry("bom_lifecycle")&"</option>"
81
 
82
		rsQry.MoveNext
83
	WEnd
84
 
85
 
86
	Response.write "</select>"
87
 
88
 
89
 
90
	rsQry.Close
91
	Set rsQry = Nothing
92
 
93
	OraDatabase.Parameters.Remove "RM_PROJ_FK"
94
	OraDatabase.Parameters.Remove "VTREE_ID"
95
End Sub
96
'--------------------------------------------------------------------------------------------------------------------------------
97
Sub RenderPMBranchesCombo( nVtree_id, nRMProj_fk ) 
98
	Dim rsQry, Disabled
99
 
100
	Disabled = ""
101
 
102
	If (nRMProj_fk = "") OR ( IsNull(nRMProj_fk) ) Then Disabled = "disabled"
103
 
104
	Set rsQry = OraDatabase.DbCreateDynaset( "select * from branches where proj_id = "&nRMProj_fk&" and is_hidden is null order by branch_id desc", ORADYN_DEFAULT )
105
 
106
 
107
	Response.write "<select name='branch_id' class='form_iname' "& Disabled &">"
108
 
109
 
110
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
111
		Response.write "<option value='"& rsQry("branch_id") &"'>"& rsQry("branch_name").Value &"</option>"
112
 
113
		rsQry.MoveNext
114
	WEnd
115
 
116
 
117
	Response.write "</select>"
118
 
119
 
120
 
121
	rsQry.Close
122
	Set rsQry = Nothing
123
 
124
 
125
End Sub
126
'--------------------------------------------------------------------------------------------------------------------------------
127
Sub RenderState( nVtree_id, nRMProj_fk ) 
128
	Dim rsQry, Disabled
129
 
130
	Disabled = ""
131
 
132
	If (nRMProj_fk = "") OR ( IsNull(nRMProj_fk) ) Then Disabled = "disabled"
133
 
134
	Set rsQry = OraDatabase.DbCreateDynaset( "select * from states where proj_id = "&nRMProj_fk, ORADYN_DEFAULT )
135
 
136
 
137
	Response.write "<select name='state_id' class='form_iname' "& Disabled &">"
138
 
139
 
140
	While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
141
		Response.write "<option value='"& rsQry("state_id") &"'>"& rsQry("state_name").Value &"</option>"
142
 
143
		rsQry.MoveNext
144
	WEnd
145
 
146
 
147
	Response.write "</select>"
148
 
149
 
150
 
151
	rsQry.Close
152
	Set rsQry = Nothing
153
 
154
 
155
End Sub
156
'--------------------------------------------------------------------------------------------------------------------------------
157
Sub AddProductionBOM ()
158
	On Error Resume Next
159
 
160
	OraDatabase.Parameters.Add "BOM_ID", 	Request("bom_id"),		ORAPARM_INPUT, ORATYPE_VARCHAR2
161
	OraDatabase.Parameters.Add "BRANCH_ID", Request("branch_id"), 		ORAPARM_INPUT, ORATYPE_NUMBER 
162
	OraDatabase.Parameters.Add "STATE_ID", 	Request("state_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER 
163
	OraDatabase.Parameters.Add "PROJ_ID", 	Request("proj_id"), 	ORAPARM_INPUT, ORATYPE_VARCHAR2 
164
 
165
 
166
	objEH.TryORA ( OraSession )
167
 
168
	OraDatabase.ExecuteSQL _
169
	"BEGIN   pk_Production.Add_Production_Bom ( :BOM_ID, :BRANCH_ID, :STATE_ID, :PROJ_ID );   END;"
170
 
171
	objEH.CatchORA ( OraSession )
172
 
173
 
174
	OraDatabase.Parameters.Remove "BOM_ID"
175
	OraDatabase.Parameters.Remove "BRANCH_ID"
176
	OraDatabase.Parameters.Remove "STATE_ID"
177
	OraDatabase.Parameters.Remove "PROJ_ID"
178
 
179
End Sub
180
'--------------------------------------------------------------------------------------------------------------------------------
181
%>
182
<%
183
'------------ RUN BEFORE PAGE RENDER ----------
184
' --- Get Form details from DB ---
185
'Call GetFormDetails ( Request("bom_id"), objFormCollector )
186
 
187
' --- Load Validation Rules ---
188
'Call objForm.LoadValidationRules ( Array("branch_name","branch_comments"), OraDatabase )		' Load Validation Rules
189
 
190
' --- Enter Form Validation Rule Changes here... ----
191
'----------------------------------------------------
192
 
193
' --- RUN onPostBack ---
194
If Request("doit") <> "" Then
195
	If objForm.IsValidOnPostBack Then
196
		' --- Form is Valid ---
197
 
198
		Select Case Request("action")
199
			Case "new"
200
				Call AddProductionBOM()
201
			Case "edit"
202
				Call EditBranch()
203
 
204
		End Select
205
 
206
 
207
		If objEH.Finally Then
208
			Call OpenInWindow ( SCRIPT_NAME &"?"& objPMod.ComposeURL() )
209
		End If
210
 
211
	End If
212
 
213
 
214
 
215
End If
216
 
217
'----------------------------------------------
218
%>
219
<html>
220
<head>
221
<title>Deployment Manager</title>
222
<link rel="shortcut icon" href="<%=FavIcon%>"/>
223
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
224
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
6663 dpurdie 225
<link href="scripts/deployment_manager.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
226
<script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
5355 dpurdie 227
</head>
228
 
229
<body leftmargin="0" topmargin="0">
230
<!-- HEADER ++++++++++++++++ -->
231
<!--#include file="_header.asp"-->
232
<!-- +++++++++++++++++++++++ -->
233
<!-- MAIN MENU  ++++++++++++++++++++++++++ -->
234
<!--#include file="_main_menu_admin.asp"-->
235
<!-- +++++++++++++++++++++++++++++++++++++ -->
236
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
237
  <tr>
238
    <td width="1%" valign="top" background="images/bg_bage_0.gif">
239
	<!-- ADMIN BROWSER ++++++++++++++++++++++ -->
240
	<!--#include file="_admin_project_browser.asp"-->
241
    <!-- END OF ADMIN BROWSER +++++++++++++++ -->
242
	</td>
243
    <td width="1" background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="600"></td>
244
    <td width="100%" valign="top" bgcolor="#FFFFFF">
245
	<table width="100%"  border="0" cellspacing="0" cellpadding="0">
246
      <tr>
247
        <td width="1%" valign="top" background="images/bg_darkbage.gif"></td>
248
        <td width="100%" valign="bottom" background="images/bg_darkbage.gif">
249
 
250
		</td>
251
        <td width="1%" background="images/bg_darkbage.gif"><img src="images/img_spanner.gif" width="190" height="55"></td>
252
        </tr>
253
      <tr>
254
        <td background="images/bg_bage_0.gif"><img src="images/spacer.gif" width="30" height="10"></td>
255
        <td background="images/bg_bage_0.gif">
256
		<!-- BUTTONS CONTROL +++++++++++++++++++ -->
257
		<!-- +++++++++++++++++++++++++++++++++++ -->
258
		</td>
259
        <td background="images/bg_darkbage.gif"><table width="100%"  border="0" cellspacing="0" cellpadding="0">
260
          <tr>
261
            <td width="100%" background="images/bg_bage_0.gif">&nbsp;</td>
262
            <td width="1"><img src="images/p_bar_corrner.gif" width="17" height="42"></td>
263
          </tr>
264
        </table></td>
265
        </tr>
266
      <tr>
267
        <td>&nbsp;</td>
268
        <td><br><br>
269
		  <!-- PAGE DETAILS +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
270
          <table width="100%"  border="0" cellspacing="0" cellpadding="0">
271
		  <form name="FormName" method="post" action="<%=SCRIPT_NAME%>" onSubmit="ShowProgress();">
272
		  <%
273
		  Call GetIterations ( aIterationCollector, parProj_id )
274
 
275
 
276
		  %>
277
            <tr>
278
              <td background="images/bg_bage_0a.gif"><table width="100%"  border="0" cellspacing="1" cellpadding="2">
279
                <tr>
280
                  <td width="1" background="images/bg_bage_0.gif"></td>
281
                  <td width="20%" background="images/bg_bage_0.gif" class="body_col" nowrap>Production Branch </td>
282
                  <td width="20%" background="images/bg_bage_0.gif" class="body_col" nowrap>Production BOM </td>
283
				  <td width="60%" background="images/bg_bage_0.gif" class="body_col" nowrap>Production State</td>
284
				 <!--  <td width="1" background="images/bg_bage_0.gif" class="body_col" nowrap>Hide</td> -->
285
                </tr>
286
				<%
287
				If NOT IsNull(aIterationCollector) Then
288
					LastRow = Ubound( aIterationCollector, 2 )
289
					For i = 0 To LastRow
290
					%>
291
					<%If parAction = "" Then%>
292
					<!-- NORMAL ROW +++++++++++++++++++ -->
293
	                <tr>
294
	                  <td background="images/bg_bage_0.gif" align="center"></td>
295
	                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(9, i)%></td>					  
296
	                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(7, i)%><%=VBNewLine%><%=aIterationCollector(12, i)%></td>
297
					  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=( aIterationCollector(11, i) )%></td>
298
<!-- 	                  <td align="center" nowrap background="images/bg_bage_0.gif"><a href="<%=SCRIPT_NAME%>?action=edit&branch_id=<%=aIterationCollector(0, i)%>&<%=objPMod.ComposeURL()%>"><%=LIMG_EDIT%></a><a href="_RemoveBranch.asp?rfile=<%=SCRIPT_NAME%>&branch_id=<%=aIterationCollector(0, i)%>&<%=objPMod.ComposeURL()%>" onClick="return confirmAction('Remove \'<%=aIterationCollector(1, i)%>\' from this list?');"><%=LIMG_REMOVE%></a></td> -->
299
	                </tr>
300
					<!-- +++++++++++++++++++++++++++++++++ -->
301
 
302
					<%Else%>
303
 
304
						<%If CStr(aIterationCollector(0, i)) <> parBranch_id Then%>
305
						<!-- JUST DATA ROW +++++++++++++++++++ -->
306
						<tr>
307
		                  <td background="images/bg_bage_0.gif" align="center"></td>
308
		                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(9, i)%></td>						  
309
		                  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=aIterationCollector(7, i)%><%=VBNewLine%><%=aIterationCollector(12, i)%></td>
310
						  <td valign="top" bgcolor="#FFFFFF" class="body_row" nowrap><%=( aIterationCollector(11, i) )%></td>
311
		                </tr>
312
						<!-- +++++++++++++++++++++++++++++++++ -->
313
						<%End If%>
314
					<%End If%>
315
 
316
 
317
				<%
318
					Next
319
 
320
				End If
321
				%>
322
 
323
 
324
				<!-- NEW ENTRY ROW FORM ++++++++++++++ -->
325
				<%If parAction = "new" Then%>
326
 
327
				<input type="hidden" name="action" value="new">
328
				<tr>
329
                  <td background="images/bg_bage_0.gif" align="center" valign="top"><%=LIMG_POINTER%></td>
330
                  <td background="images/bg_note.gif" class="body_row" valign="top"><%Call RenderPMBranchesCombo( Request("rm_vtree_fk"), objProjCollector.Item("rm_projects_fk") )%></td>
331
                  <td background="images/bg_note.gif" class="body_row" valign="top"><%Call RenderPMBOMCombo( Request("rm_vtree_fk"), objProjCollector.Item("rm_projects_fk") )%></td>
332
				  <td background="images/bg_note.gif" class="body_row" valign="top"><%Call RenderState( Request("rm_vtree_fk"), objProjCollector.Item("rm_projects_fk") )%></td>
333
                  <td background="images/bg_note.gif" align="center" nowrap valign="top"><%=LIMG_ROW_SUBMIT%><a href="<%=SCRIPT_NAME%>?<%=objPMod.ComposeURL()%>" ><%=LIMG_ROW_CANCEL%></a></td>
334
                </tr>
335
				<%End If%>
336
				<!-- +++++++++++++++++++++++++++++++++ -->
337
 
338
 
339
				<!-- NEW ENTRY BUTTON ++++++++++++++++ -->
340
				<%If parAction = "" Then%>
341
				<tr>
342
                  <td background="images/bg_bage_0.gif" align="center"><a href="<%=SCRIPT_NAME%>?action=new&<%=objPMod.ComposeURL()%>"><%=LIMG_NEW_ENTRY%></a></td>
343
                  <td bgcolor="#FFFFFF" class="body_row">&nbsp;</td>
344
                  <td bgcolor="#FFFFFF" class="body_row">&nbsp;</td>
345
				  <td bgcolor="#FFFFFF" class="body_row">&nbsp;</td>
346
                </tr>
347
				<%End If%>
348
				<!-- +++++++++++++++++++++++++++++++++ -->
349
 
350
              </table></td>
351
            </tr>
352
		  <%=objPMod.ComposeHiddenTags()%>
353
		  <input type="hidden" name="doit" value="true">
354
		  </form>
355
          </table>
356
          </td>
357
        <td valign="top"></td>
358
        </tr>
359
    </table>
360
	<!-- ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
361
	</td>
362
  </tr>
363
  <tr>
364
    <td background="images/bg_bage_0a.gif"><img src="images/spacer.gif" width="200" height="15"></td>
365
    <td background="images/bg_bage_1.gif"><img src="images/spacer.gif" width="1" height="1"></td>
366
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
367
  </tr>
368
  <tr>
369
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="20"></td>
370
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
371
    <td bgcolor="#FFFFFF"><img src="images/spacer.gif" width="1" height="1"></td>
372
  </tr>
373
</table>
374
<!-- FOOTER ++++++++++++++++ -->
375
<!--#include file="_footer.asp"-->
376
<!-- +++++++++++++++++++++++ -->
377
</body>
378
</html>