Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
6770 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'   wAddReleaseReplica.asp
5
'   IFrame Dialog to add package replicas to the current Release
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
        "WITH aa as (" &_
34
        "    SELECT * from blat_projects where proj_id = (select PROJ_ID from RELEASE_TAGS where rtag_id = :RTAG_ID)" &_
35
        " )" &_
36
        " SELECT" &_
37
        "    bs.*," &_
38
        "    nvl2(br.BLAT_ID, 1, 0) AS inRelease," &_
39
        "    nvl2(aa.BLAT_ID, 1, 0) AS inProject" &_
40
        " FROM" &_
41
        "    blat_servers bs," &_
42
        "    blat_releases br," &_
43
        "    aa" &_
44
        " WHERE" &_
45
        "    bs.BLAT_ID = br.BLAT_ID (+)" &_
46
        "    AND br.rtag_id(+) = :RTAG_ID" &_
47
        "    AND bs.BLAT_ID = aa.BLAT_ID (+)" &_
48
        " ORDER BY" &_
49
        "    upper(blat_display_name) ASC"
50
 
51
End Function
52
%>
53
<html>
54
<head>
55
<title>Release Manager</title>
56
<link rel="shortcut icon" href="<%=FavIcon%>"/>
57
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
58
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
59
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
60
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
61
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
62
<!--#include file="_jquery_includes.asp"-->
63
<!-- TIPS -->
64
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
65
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
66
<script language="javascript">
67
$(document).ready(function () {
68
 
69
    //  Add operation to all the ADD buttons
70
    $('.btn_add').on('click', function(){
71
        var el = $(this);
72
        var trel = el.closest("tr");
73
        var rtag_id = <%=DB_RTAG_ID%>;
74
        var server_id = trel.data("server_id");
75
 
76
        var colData = new Array();
77
        trel.each(function(){
78
            $(this).find('td').each(function(){
79
                colData.push($(this));
80
            })
81
        });
82
        var replicaName = colData[1].text();
83
 
84
        vixConfirm("Add replication to '"+replicaName+"' of this Release", 
85
            {
86
                deferred : true,  
87
            }).done(function(){
88
                $.ajax({
89
                    type : 'POST',
90
                    url : '_json_Replication.asp',
91
                    data : {Opr : 'AddRelease', server_id : server_id, user_id : <%=objAccessControl.UserId%>, rtag_id : rtag_id },
92
                    dataType : 'json',
93
                }).fail(function( jqXHR, textStatus, errorThrown ){
94
                    vixAlert('Ajax Error. Unexpected result.<p>' + errorThrown);
95
                }).done(function( data, textStatus, jqXHR ){
96
                    if (typeof data.result === undefined){
97
                        vixAlert('Ajax Error. Unexpected result');
98
                    } else if (data.result != 0){
99
                        vixAlert('Error Adding item.<p>' + data.emsgDetails);
100
                    } else {
101
                        // Process individual items to show that an action has been taken
102
                        colData[0].empty().append('<input checked disabled title="Replication Enabled" type="checkbox">');
103
                    }
104
                });
105
            });
106
    });
107
});
108
</script>
109
<script language="JavaScript" type="text/javascript">
110
formTips.tips.activeReplica   = stdTip(200, 'Active Replica', 'This package replica has been marked as active.');
111
formTips.tips.replicaMode  = stdTip(200, 'Replication Mode','Indicates if the Release is already being replicated and the mode by which the replication is occuring.');
112
</script>
113
</head>
114
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
115
  <table width="100%" border="0" cellspacing="0" cellpadding="2">
116
    <tr>
117
      <td valign="top" nowrap colspan="3" class="wform_ttl">
118
        <table width="100%" border="0" cellspacing="1" cellpadding="2">
119
          <tr>
120
            <td colspan="2" width="1%" nowrap class="form_field">
121
              <div style="min-height:300px;max-height:500px;overflow:auto;">
122
              <table width="100%" border="0" cellspacing="1" cellpadding="2">
123
                <tr>
124
                  <td nowrap width="1%" class="form_field_hdr form_align">Opr</td>
125
                  <td nowrap width="100%" class="form_field_hdr form_align">Target Server</td>
126
                  <td nowrap width="1%" class="form_field_hdr form_align">Active<%=Quick_Help("activeReplica")%></td>
127
                  <td nowrap width="1%" class="form_field_hdr form_align">Replicate Mode<%=Quick_Help("replicaMode")%></td>
128
                </tr>
129
                <%
130
                OraDatabase.Parameters.Add "RTAG_ID", DB_RTAG_ID, ORAPARM_INPUT, ORATYPE_NUMBER
131
                Set rsQry = OraDatabase.DbCreateDynaset( Get_All_Server_Names, cint(0))
132
                OraDatabase.Parameters.Remove "RTAG_ID"
133
				While ((NOT rsQry.BOF) AND (NOT rsQry.EOF))
134
                    Dim canAdd
135
                    canAdd = rsQry("InRelease") = 0
136
 
137
                    Dim replicationMode
138
 
139
                    replicationMode = ""
6774 dpurdie 140
                    If rsQry("blat_full") = "E" Then
141
                        replicationMode = "Entire Repository"
142
                    ElseIf  rsQry("blat_full") = "P" Then
143
                        replicationMode = "All Projects"
6770 dpurdie 144
                    ElseIf  rsQry("inProject") > 0 Then
145
                        replicationMode = "Project"
146
                    ElseIf  rsQry("inRelease") > 0 Then
147
                        replicationMode = "Release"
148
                    End If                        
149
                %>
150
                <tr data-server_id="<%=rsQry("BLAT_ID")%>">
151
                  <td nowrap class="form_item form_field_grey_bg">
152
                  <%If canAdd Then%>
153
                        <img class="btn_add" src="icons/btn_add.gif" width="13" height="13" align="absmiddle" border="0" hspace="3" title="Replicate to this server">
154
                  <%Else%>
155
                        <input checked disabled title="Replication Enabled" type="checkbox">
156
                  <%End If%>
157
                  </td>
158
                  <td class="form_item form_field_grey_bg"><%=rsQry.Fields("blat_display_name")%></td>
159
                  <td class="form_item form_field_grey_bg"><input disabled type="checkbox" <%=Iif(rsQry.Fields("blat_enable") = "Y", "checked","")%>></td>
160
                  <td class="form_item form_field_grey_bg"><%=replicationMode%></td>
161
                </tr>
162
                <%rsQry.MoveNext
163
			  	WEnd%>
164
				<%If rsQry.RecordCount < 1 Then%>
165
				<tr>
166
                  <td nowrap class="form_item form_field_grey_bg"></td>
167
                  <td class="err_alert form_field_grey_bg">No Replica servers found!</td>
168
                </tr>
169
				<%End If%>
170
              </table>
171
              </div>
172
            </td>
173
          </tr>
174
        </table>
175
      </td>
176
    </tr>
177
    <tr>
178
      <td align="right">
179
        <input type="reset" name="btn" value="Done" class="form_btn_comp" onclick="window.parent.location.reload(false);">
180
      </td>
181
    </tr>
182
  </table>
183
</body>
184
</html>
185
<%
186
Call Destroy_All_Objects
187
%>