Subversion Repositories DevTools

Rev

Rev 121 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'                         ADD NEW Runtime Dependency
'               --- PROCESS FORM ---
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0    ' always load the page, dont store
%>
<%
' Page Access Condition
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "runtime_dependencies.asp" )
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim rtdArray()
'------------ Constants Declaration -----------
Const COL_pkg_name = 0
Const COL_pkg_version = 1
'------------ Variable Init -------------------
'----------------------------------------------
%>
<%
Sub Add_Runtime_Dependency ( ARRrtd, NNpv_id, NNuser_id )
        Dim i
        
        For i = 0 To UBound( ARRrtd, 2 )
                OraDatabase.ExecuteSQL "BEGIN Add_Runtime_Dependency ( "& NNpv_id &", "&_
                                                                          "'"& ARRrtd( COL_pkg_name, i ) &"', "&_
                                                                                                                                  "'"& ARRrtd( COL_pkg_version, i ) &"', "&_
                                                                                                                                  NNuser_id &" ); END;"
        Next
        
End Sub

Sub Populate_rtdArray ( NNpkg_list, ARRrtd )
        Dim depList, lastItem, i, recCnt, pkg_name, pkg_version
        Dim rsTemp, Query_String
        
        Query_String = _
        " SELECT pkg_id, pkg_name"&_
        "  FROM packages"&_
        " WHERE pkg_id IN ("& NNpkg_list &")"
        Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
        
        recCnt = 0
        While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
                ReDim Preserve ARRrtd( 1, recCnt )
                ARRrtd( COL_pkg_name, recCnt ) = rsTemp("pkg_name")
                ARRrtd( COL_pkg_version, recCnt ) =  Trim( Request( "pkgn"& rsTemp("pkg_id") ) )                ' Trim extra spaces
                
                recCnt = recCnt + 1
                rsTemp.MoveNext
        WEnd
        
        rsTemp.Close
        Set rsTemp = nothing
End Sub
%>
<%
'-----------------------  MAIN LINE  ---------------------------

'--- Process submition ---
If (Request("pv_id") <> "") AND (Request("rtag_id") <> "") Then
        ' All mendatory parameters FOUND
        
        'COMPLETE THE REQUEST...
        Call Populate_rtdArray ( Request("pkg_list"), rtdArray )
        
        Call Add_Runtime_Dependency ( rtdArray, Request("pv_id"), objAccessControl.UserId )
        
        Response.Redirect("runtime_dependencies.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id"))
Else
        Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
        Response.write QSTR_All 
End If
%>

<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->