Subversion Repositories DevTools

Rev

Rev 6774 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6770 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'   wAddProjReplica.asp
5
'   IFrame Dialog to add package replias to the current Project
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
Response.Expires = 0	' always load the page, dont store
11
%>
12
<!--#include file="common/conf.asp"-->
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/qstr.asp"-->
15
<!--#include file="common/common_subs.asp"-->
16
<!--#include file="common/common_dbedit.asp"-->
17
<!--#include file="common/_popup_window_common.asp"-->
18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_login.asp"-->
22
<!--#include file="_access_control_general.asp"-->
23
<%
24
'------------ Variable Definition -------------
25
Dim rsQry
26
'------------ Constants Declaration -----------
27
'------------ Variable Init -------------------
28
'----------------------------------------------
29
%>
30
<%
31
Function Get_All_Server_Names
32
	Get_All_Server_Names = _ 
33
        "SELECT" &_
34
        "    bs.*," &_
35
        "    nvl2(bp.BLAT_ID, 1, 0) AS inuse" &_
36
        " FROM" &_
37
        "    blat_servers bs," &_
38
        "    blat_projects bp" &_
39
        " WHERE" &_
40
        "    bs.BLAT_ID = bp.BLAT_ID (+)" &_
41
        "    AND bp.proj_id(+) = " & DB_PROJ_ID &_
42
        " ORDER BY" &_
43
        "    upper(blat_display_name) ASC"
44
 
45
End Function
46
%>
47
<html>
48
<head>
49
<title>Release Manager</title>
50
<link rel="shortcut icon" href="<%=FavIcon%>"/>
51
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
52
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
53
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
54
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
55
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
56
<!--#include file="_jquery_includes.asp"-->
57
<!-- TIPS -->
58
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
59
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
60
<script language="javascript">
61
$(document).ready(function () {
62
 
63
    //  Add operation to all the ADD buttons
64
    $('.btn_add').on('click', function(){
65
        var el = $(this);
66
        var trel = el.closest("tr");
67
        var proj_id = <%=DB_PROJ_ID%>;
68
        var server_id = trel.data("server_id");
69
 
70
        var colData = new Array();
71
        trel.each(function(){
72
            $(this).find('td').each(function(){
73
                colData.push($(this));
74
            })
75
        });
76
        var replicaName = colData[1].text();
77
 
78
        vixConfirm("Add replication to '"+replicaName+"' of all Releases in this Project", 
79
            {
80
                deferred : true,  
81
            }).done(function(){
82
                $.ajax({
83
                    type : 'POST',
84
                    url : '_json_Replication.asp',
85
                    data : {Opr : 'AddProject', server_id : server_id, user_id : <%=objAccessControl.UserId%>, proj_id : proj_id },
86
                    dataType : 'json',
87
                }).fail(function( jqXHR, textStatus, errorThrown ){
88
                    vixAlert('Ajax Error. Unexpected result.<p>' + errorThrown);
89
                }).done(function( data, textStatus, jqXHR ){
90
                    if (typeof data.result === undefined){
91
                        vixAlert('Ajax Error. Unexpected result');
92
                    } else if (data.result != 0){
93
                        vixAlert('Error Adding item.<p>' + data.emsgDetails);
94
                    } else {
95
                        // Process individual items to show that an action has been taken
96
                        colData[0].empty().append('<input checked disabled title="Replication Enabled" type="checkbox">');
97
                    }
98
                });
99
            });
100
    });
101
});
102
</script>
103
<script language="JavaScript" type="text/javascript">
104
formTips.tips.activeReplica   = stdTip(200, 'Active Replica', 'This package replica has been marked as active.');
105
formTips.tips.fullReplica  = stdTip(200, 'Full Replication','When enabled all packages are being replicated. <P>Adding project level replication will have no effect.');
106
</script>
107
</head>
108
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
109
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
110
    <tr>
111
      <td valign="top" nowrap colspan="3" class="wform_ttl">
112
        <table width="100%" border="0" cellspacing="1" cellpadding="2">
113
          <tr>
114
            <td colspan="2" width="1%" nowrap class="form_field">
115
              <div style="min-height:300px;max-height:500px;overflow:auto;">
116
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
117
                <tr>
118
                  <td nowrap width="1%" class="form_field_hdr form_align">Opr</td>
119
                  <td nowrap width="100%" class="form_field_hdr form_align">Target Server</td>
120
                  <td nowrap width="1%" class="form_field_hdr form_align">Active<%=Quick_Help("activeReplica")%></td>
121
                  <td nowrap width="1%" class="form_field_hdr form_align">Replication Mode<%=Quick_Help("fullReplica")%></td>
122
                </tr>
123
                <%Set rsQry = OraDatabase.DbCreateDynaset( Get_All_Server_Names, cint(0))
124
				While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
125
                    Dim canAdd
126
                    canAdd = rsQry("INUSE") = 0
127
 
128
                    Dim replicationMode
129
 
130
                    replicationMode = ""
131
                    If rsQry("blat_full") = "Y" Then
132
                        replicationMode = "Repository"
133
                    ElseIf  rsQry("inUse") > 0 Then
134
                        replicationMode = "Project"
135
                    End If
136
                %>
137
                <tr data-server_id="<%=rsQry("BLAT_ID")%>">
138
                  <td nowrap class="form_item form_field_grey_bg">
139
                  <%If canAdd Then%>
140
                        <img class="btn_add" src="icons/btn_add.gif" width="13" height="13" align="absmiddle" border="0" hspace="3" title="Replicate to this server">
141
                  <%Else%>
142
                        <input checked disabled title="Replication Enabled" type="checkbox">
143
                  <%End If%>
144
                  </td>
145
                  <td class="form_item form_field_grey_bg"><%=rsQry.Fields("blat_display_name")%></td>
146
                  <td class="form_item form_field_grey_bg"><input disabled type="checkbox" <%=Iif(rsQry.Fields("blat_enable") = "Y", "checked","")%>></td>
147
                  <td class="form_item form_field_grey_bg"><%=replicationMode%></td>
148
                </tr>
149
                <%rsQry.MoveNext
150
			  	WEnd%>
151
				<%If rsQry.RecordCount < 1 Then%>
152
				<tr>
153
                  <td nowrap class="form_item form_field_grey_bg"></td>
154
                  <td class="err_alert form_field_grey_bg">No Replica servers found!</td>
155
                </tr>
156
				<%End If%>
157
              </table>
158
              </div>
159
            </td>
160
          </tr>
161
        </table>
162
      </td>
163
    </tr>
164
    <tr>
165
      <td align="right">
166
        <input type="reset" name="btn" value="Done" class="form_btn_comp" onclick="window.parent.location.reload(false);">
167
      </td>
168
    </tr>
169
  </table>
170
</body>
171
</html>
172
<%
173
Call Destroy_All_Objects
174
%>