Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                    wAddSchedule
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#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/_form_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim rsQry
Dim rsTemp
Dim sMessage
Dim Query_String
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------
sMessage = NULL

Set objFormCollector = CreateObject("Scripting.Dictionary")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Function GetMachType ( ngbe_id )
    Dim rsQry, query
    
    OraDatabase.Parameters.Add "gbe_id",   ngbe_id, ORAPARM_INPUT, ORATYPE_NUMBER 
    
    query = GetQuery ("GBE_MACHTYPECombo.sql")
    
    Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
    If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
        GetMachType = rsQry.GetRows()
    Else
        GetMachType = NULL
        
    End If
    
    rsQry.Close()
    Set rsQry = Nothing
    
    OraDatabase.Parameters.Remove "gbe_id"
End Function
'--------------------------------------------------------------------------------------------------------------------------
Sub RenderRepeatCombo( cRepeat )
    Response.Write "<select name='repeat_combo' class='form_item'>" 
    Response.write "<option value='0'>Once Only</option>"
    Response.write "<option value='1'>Daily</option>"
    Response.write "<option value='7'>Weekly</option>"
    Response.Write "</select>"  
End Sub
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
If CBool(Request("action")) Then

    If Len(Request("repeat_combo")) > 1 Then
    
        Call DisplayInfo ( "REPEAT_SCHEDULE_NOT_SELECTED", "100%" )
    
    Else
        On Error Resume Next
        OraDatabase.Parameters.Add "SCHEDULED_PAUSE",   Request("scheduled_pause"),     ORAPARM_INPUT, ORATYPE_VARCHAR2
        OraDatabase.Parameters.Add "SCHEDULED_RESUME",  Request("scheduled_resume"),    ORAPARM_INPUT, ORATYPE_VARCHAR2
        OraDatabase.Parameters.Add "REPEAT",            Request("repeat_combo"),        ORAPARM_INPUT, ORATYPE_CHAR
        OraDatabase.Parameters.Add "INDEFINITE_PAUSE",  Request("indefinite_pause"),    ORAPARM_INPUT, ORATYPE_CHAR
        
        objEH.TryORA ( OraSession )
        
        OraDatabase.ExecuteSQL _
           "BEGIN PK_BUILDAPI.Insert_Schedule_Info ( " &_
                "TO_DATE(:SCHEDULED_PAUSE,'DY DD-MON-YYYY HH24:MI'), " &_
                "TO_DATE(:SCHEDULED_RESUME,'DY DD-MON-YYYY HH24:MI'), " &_
                ":REPEAT, " &_
                ":INDEFINITE_PAUSE );" &_
            "END;"
        
        objEH.CatchORA ( OraSession )

        OraDatabase.Parameters.Remove "SCHEDULED_PAUSE"
        OraDatabase.Parameters.Remove "SCHEDULED_RESUME"
        OraDatabase.Parameters.Remove "REPEAT"
        OraDatabase.Parameters.Remove "INDEFINITE_PAUSE"

        If objEH.Finally Then
            Call OpenInParentWindow ("admin_build_service.asp")
            Call CloseWindow()
            Call Destroy_All_Objects
            Response.End
        End If

        rsQry.Close()
        Set rsQry = nothing
    End If
        
End If


'----------------------------------------------
%>
<html>
    <head>
        <title>Release Manager</title>
        <link rel="shortcut icon" href="<%=FavIcon%>"/>
        <meta http-equiv="Pragma" content="no-cache">
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
        <link href="images/release_manager_style.css?ver=<%=VixVerNum%>" rel="stylesheet" type="text/css">
        <script language="JavaScript" src="scripts/common.js?ver=<%=VixVerNum%>"></script>
        <%bJqueryTimePicker = TRUE%>
        <!--#include file="_jquery_includes.asp"-->
        <script>
        $(document).ready(function(){
            // Set common defaults
            $.timepicker.setDefaults({
                        timeFormat: "HH:mm",
                dateFormat: "D dd-M-yy",
                        controlType: 'select',
                        oneLine: true,
                        timeInput: true,
                constrainInput: true,
                showOn: 'both',
                buttonImageOnly : true,
                buttonImage: "images/cal.gif",
                buttonText: "Select Date and Time",
                minDate : 0,
                changeYear : true, 
                yearRange : "0000:2099",
                changeMonth: true
            });

            //  Set up two linked pickers
                var startTime =  $('#scheduled_pause');
                var endTime =  $('#scheduled_resume');
                $.timepicker.datetimeRange(
                    startTime,
                    endTime,
                    {
                        start: {             // start picker options
                    onClose : function(p1,p2){
                        checkForm();
                                }
                },
                        end: {               // end picker options
                    onClose : function(p1,p2){
                        checkForm();
                                }
                }                                       
                    });

            // Update form controls before display
            checkForm();

                });

        // Enable / Disable the forms submit button
        // Enable when both dates are not empty
        function checkForm() {
            var resume = $('#scheduled_resume').val().length;
            var pause = $('#scheduled_pause').val().length;
            var ok = ( resume > 0 && pause > 0);

            var but = $("#formSubmit");
            but.toggleClass("form_btn", ok);
            but.toggleClass("form_btn_disabled", !ok);
            but.prop("disabled", !ok );
        }

        </script>
        <style>
            #ui-datepicker-div {
                position: absolute !important;
                top: 0px !important;
                left: 0px !important;
                }
        </style>
    </head>
    <body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onload="self.focus();">
        <table width="100%" border="0" cellspacing="0" cellpadding="10">
            <%
            '-- FROM START --------------------------------------------------------------------------------------------------------------
            objFormComponent.FormName = "run_level_schedule"
            objFormComponent.FormClass = "form_tight"
            objFormComponent.Action = ScriptName
            objFormComponent.OnSubmit = "ShowProgress();"
            Call objFormComponent.FormStart()
            %>
            <tr>
                <td>
                    <!-- NEW SCHEDULE ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++  -->
                    <%Call Messenger ( sMessage , 3, "100%" )%>
                    <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                    <!--#include file="messages/_msg_inline.asp"-->
                    <br>
                    <table border="0">
                        <tr>
                            <td nowrap class="form_iname">Scheduled Pause</td>
                            <td nowrap class="form_item"><%=objFormComponent.TextBox ("scheduled_pause", "", "size='20' class='form_ivalue' id='scheduled_pause'" )%></td>
                        </tr>
                        <tr>
                            <td nowrap class="form_iname">Scheduled Resume</td>
                            <td nowrap class="form_item"><%=objFormComponent.TextBox ("scheduled_resume", "", "size='20' class='form_ivalue' id='scheduled_resume'" )%></td>
                            </td>
                        </tr>
                        <tr>
                            <td nowrap class="form_iname">Repeat</td>
                            <td nowrap class="form_item"><% Call RenderRepeatCombo("")%></td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td style="height:100px">
                </td>
            </tr>
            <tr>
                <td background="images/bg_login.gif">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td><%=ProgressBar()%></td>
                            <td align="right">
                                <input name="btn" type="submit" class="form_btn" value="Add" id="formSubmit">
                                <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();">
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <%=objPMod.ComposeHiddenTags()%>
            <input type="hidden" name="action" value="true">
            <%
            Call objFormComponent.FormEnd()
            '-- FROM END ----------------------------------------------------------------------------------------------------------------
            %>
        </table>
    </body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
Set objFormCollector = Nothing
'----------------------------------------------
Call Destroy_All_Objects
%>