Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'   wAddProjReplica.asp
'   IFrame Dialog to add package replias to the current Project
'=====================================================
%>
<%
Option explicit
Response.Expires = 0    ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/common_dbedit.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim rsQry
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
'----------------------------------------------
%>
<%
Function Get_All_Server_Names
        Get_All_Server_Names = _ 
        "SELECT" &_
        "    bs.*," &_
        "    nvl2(bp.BLAT_ID, 1, 0) AS inuse" &_
        " FROM" &_
        "    blat_servers bs," &_
        "    blat_projects bp" &_
        " WHERE" &_
        "    bs.BLAT_ID = bp.BLAT_ID (+)" &_
        "    AND bp.proj_id(+) = " & DB_PROJ_ID &_
        " ORDER BY" &_
        "    upper(blat_display_name) ASC"

End Function
%>
<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 rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
<!--#include file="_jquery_includes.asp"-->
<!-- TIPS -->
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
<script language="javascript">
$(document).ready(function () {

    //  Add operation to all the ADD buttons
    $('.btn_add').on('click', function(){
        var el = $(this);
        var trel = el.closest("tr");
        var proj_id = <%=DB_PROJ_ID%>;
        var server_id = trel.data("server_id");

        var colData = new Array();
        trel.each(function(){
            $(this).find('td').each(function(){
                colData.push($(this));
            })
        });
        var replicaName = colData[1].text();

        vixConfirm("Add replication to '"+replicaName+"' of all Releases in this Project", 
            {
                deferred : true,  
            }).done(function(){
                $.ajax({
                    type : 'POST',
                    url : '_json_Replication.asp',
                    data : {Opr : 'AddProject', server_id : server_id, user_id : <%=objAccessControl.UserId%>, proj_id : proj_id },
                    dataType : 'json',
                }).fail(function( jqXHR, textStatus, errorThrown ){
                    vixAlert('Ajax Error. Unexpected result.<p>' + errorThrown);
                }).done(function( data, textStatus, jqXHR ){
                    if (typeof data.result === undefined){
                        vixAlert('Ajax Error. Unexpected result');
                    } else if (data.result != 0){
                        vixAlert('Error Adding item.<p>' + data.emsgDetails);
                    } else {
                        // Process individual items to show that an action has been taken
                        colData[0].empty().append('<input checked disabled title="Replication Enabled" type="checkbox">');
                    }
                });
            });
    });
});
</script>
<script language="JavaScript" type="text/javascript">
formTips.tips.activeReplica   = stdTip(200, 'Active Replica', 'This package replica has been marked as active.');
formTips.tips.fullReplica  = stdTip(200, 'Full Replication','When enabled all packages are being replicated. <P>Adding project level replication will have no effect.');
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
    <tr>
      <td valign="top" nowrap colspan="3" class="wform_ttl">
        <table width="100%" border="0" cellspacing="1" cellpadding="2">
          <tr>
            <td colspan="2" width="1%" nowrap class="form_field">
              <div style="min-height:300px;max-height:500px;overflow:auto;">
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
                <tr>
                  <td nowrap width="1%" class="form_field_hdr form_align">Opr</td>
                  <td nowrap width="100%" class="form_field_hdr form_align">Target Server</td>
                  <td nowrap width="1%" class="form_field_hdr form_align">Active<%=Quick_Help("activeReplica")%></td>
                  <td nowrap width="1%" class="form_field_hdr form_align">Replication Mode<%=Quick_Help("fullReplica")%></td>
                </tr>
                <%Set rsQry = OraDatabase.DbCreateDynaset( Get_All_Server_Names, cint(0))
                                While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
                    Dim canAdd
                    canAdd = rsQry("INUSE") = 0

                    Dim replicationMode

                    replicationMode = ""
                    If rsQry("blat_full") = "P" Then
                        replicationMode = "All Projects"
                    ElseIf rsQry("blat_full") = "E" Then
                        replicationMode = "Entire Archive"
                    ElseIf  rsQry("inUse") > 0 Then
                        replicationMode = "Project"
                    End If
                %>
                <tr data-server_id="<%=rsQry("BLAT_ID")%>">
                  <td nowrap class="form_item form_field_grey_bg">
                  <%If canAdd Then%>
                        <img class="btn_add" src="icons/btn_add.gif" width="13" height="13" align="absmiddle" border="0" hspace="3" title="Replicate to this server">
                  <%Else%>
                        <input checked disabled title="Replication Enabled" type="checkbox">
                  <%End If%>
                  </td>
                  <td class="form_item form_field_grey_bg"><%=rsQry.Fields("blat_display_name")%></td>
                  <td class="form_item form_field_grey_bg"><input disabled type="checkbox" <%=Iif(rsQry.Fields("blat_enable") = "Y", "checked","")%>></td>
                  <td class="form_item form_field_grey_bg"><%=replicationMode%></td>
                </tr>
                <%rsQry.MoveNext
                                WEnd%>
                                <%If rsQry.RecordCount < 1 Then%>
                                <tr>
                  <td nowrap class="form_item form_field_grey_bg"></td>
                  <td class="err_alert form_field_grey_bg">No Replica servers found!</td>
                </tr>
                                <%End If%>
              </table>
              </div>
            </td>
          </tr>
        </table>
      </td>
    </tr>
    <tr>
      <td align="right">
        <input type="reset" name="btn" value="Done" class="form_btn_comp" onclick="window.parent.location.reload(false);">
      </td>
    </tr>
  </table>
</body>
</html>
<%
Call Destroy_All_Objects
%>