Rev 6827 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'=====================================================' View Project Level replication' form_project_replication.asp'=====================================================Option explicit' Good idea to set when using redirectResponse.Expires = 0 ' always load the page, dont store%><!--#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"--><%' Make sure proj_id is always presentIf Request("proj_id") = "" ThenCall Destroy_All_ObjectsResponse.Redirect("index.asp")End If'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_login.asp"--><!--#include file="_access_control_general.asp"--><%'------------ Variable Definition -------------Dim parProjIdDim canModify'------------ Constants Declaration -----------'------------ Variable Init -------------------canModify = canActionControl("ConfigureReplication")parProjId = Request("proj_id")'--------------------------------------------------------------------------------------------------------------------------' GenerateTableBody'' DESCRIPTION' Constructs the HTML to render the rows of package names, and other information'Function GenerateTableBodyDim rsQryDim html_stringDim sQrySQry = _"SELECT" &_" bs.*,bp.bp_enabled," &_" 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(+) = :PROJ_ID" &_" AND (bp.BLAT_ID is NOT NULL OR bs.blat_mode in ('P', 'E'))" &_" ORDER BY" &_" upper(blat_display_name) ASC"OraDatabase.Parameters.Add "PROJ_ID", parProjId, ORAPARM_INPUT, ORATYPE_NUMBERSet rsQry = OraDatabase.DbCreateDynaset( sQry, cint(0) )OraDatabase.Parameters.Remove "PROJ_ID"'--- Render rows ---Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)Dim btnText, btnClass, btnDisable, inUse, replicationModeinUse = rsQry("INUSE") > 0replicationMode = "Unknown"If rsQry("blat_mode") = "P" ThenreplicationMode = "All Projects"ElseIf rsQry("blat_mode") = "E" ThenreplicationMode = "Entire Archive"ElseIf rsQry("inUse") > 0 ThenreplicationMode = "Project"End If' BEGIN ROWhtml_string = html_string & "<tr data-server_id=""" & rsQry("BLAT_ID") & """>"' Server ActiveDim activeCheckedactiveChecked = IIF(rsQry("BLAT_ENABLE") = "Y", "checked", "" )html_string = html_string & "<td nowrap class='body_row'><input type='checkbox' disabled "& activeChecked &" ></td>"' Server Namehtml_string = html_string & "<td nowrap class='body_row'>" & rsQry("BLAT_DISPLAY_NAME") & "</td>"' Project ActiveactiveChecked = IIF(rsQry("BP_ENABLED") = "Y", "checked", "" )btnText = "Operation not available"btnClass = ""btnDisable = "disabled"If canModify AND inUse ThenbtnText = "Toggle Replication State"btnClass = "class=btn_enable"btnDisable = ""End Ifhtml_string = html_string & "<td nowrap class='body_row' title='" & btnText & "'><input " & btnClass & " type='checkbox' " &btnDisable & " "& activeChecked &" ></td>"' Replication Modehtml_string = html_string & "<td nowrap class='body_row'>" & replicationMode & "</td>"' Delete OperationDim DelUserImage : DelUserImage = LIMG_NDEL_DISABLEDbtnText = "Operation not available"btnClass = ""If canModify AND inUse ThenDelUserImage = LIMG_NDELbtnText = "Remove this replica"btnClass = "class=btn_delete"End Ifhtml_string = html_string & "<td nowrap valign='top' " & btnClass & " title='" & btnText & "'>" & DelUserImage & "</td>"' END ROWhtml_string = html_string & "</tr>"rsQry.MoveNext' ROW SEPERATOR'If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Thenhtml_string = html_string & "<tr><td colspan='8' class=body_line></td></tr>"'End IfLoop' destroy objectsrsQry.Close()Set rsQry = nothing' return resultGenerateTableBody = html_stringEnd Function'----------------------------------------------------' Insert Includes and scripts associated with TIPSSub InsertTips%><!-- TIPS --><script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script><script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script><script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script><script language="JavaScript" type="text/JavaScript">formTips.tips.activeReplica = stdTip(200, 'Active Replica', 'This package replica has been marked as active.');formTips.tips.enabledProject = stdTip(200, 'Enabled Project','Replication of this project has been enabled. This will only ' +'be effective if the replica is active');</script><%End Sub'----------------------------------------------------' Insert scripts into the header section of the generated documentSub InsertUserScripts%><!-- JQUERY SCRIPTS --><script language="javascript">$(document).ready(function () {// Add operation to all the delete buttons$('.btn_delete').on('click', function(){var el = $(this);var trel = el.closest("tr");var proj_id = <%=parProjId%>;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("Remove replication to '"+replicaName+"' of all Releases in this Project",{deferred : true,}).done(function(){$.ajax({type : 'POST',url : '_json_Replication.asp',data : {Opr : 'RemoveProject', 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 Deleting item.<p>' + data.emsgDetails);} else {// Process individual items to show that an action has been taken//colData[1].addClass("strike");colData[0].empty();colData[2].empty();colData[3].empty();}});});});// Add operation to all the enable buttons$('.btn_enable').on('click', function(e){var el = $(this);var trel = el.closest("tr");var proj_id = <%=parProjId%>;var server_id = trel.data("server_id");var state = $(this).prop("checked");var stateChanged = false;var colData = new Array();trel.each(function(){$(this).find('td').each(function(){colData.push($(this));})});var replicaName = colData[1].text();var stateText = state ? 'Enable' : 'Disable';vixConfirm(stateText + " replication to '"+replicaName+"' of all Releases in this Project",{deferred : true,}).done(function(){$.ajax({type : 'POST',url : '_json_Replication.asp',data : {Opr : 'EnableProject', server_id : server_id, user_id : <%=objAccessControl.UserId%>, proj_id : proj_id, new_state : state ? 'Y' : 'N' },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 setting state.<p>' + data.emsgDetails);} else {stateChanged = true;}}).always(function(){if ( !stateChanged ) {el.prop("checked", !state);}});}).fail(function(){el.prop("checked", !state);});});});</script><%End Sub'--------------------------------------------------------------------------------------------------------------------------'--------------------------------------------------------------------------------------------------------------------------'------------ RUN BEFORE PAGE RENDER ----------''----------------------------------------------------Sub LeftPanelContentEnd Sub'----------------------------------------------------Sub MainPanelContent%><table class="rounded_box embedded_table"><caption nowrap class="form_ttl tleft">Project Replication Details</caption><tr><td><div class='rounded_box_pad'><!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ --><!--#include file="messages/_msg_inline.asp"--><!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ --><table width="100%" border="0" cellspacing="2" cellpadding="0"><tr><td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Active<%=Quick_Help("activeReplica")%></td><td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Replica</td><td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Enabled<%=Quick_Help("enabledProject")%></td><td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Relication Mode</td><td width="1%" valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Opr</td></tr><%=GenerateTableBody()%></table><table class="full_table"><tr><%BuildActionButtonClick canModify, "Add Project Replica", "Add New Replication Target", true, _"src='icons/btn_add.gif' width='13' height='13' align='absmiddle' border='0' hspace='3'", _"MM_openVixIFrame('wAddProjReplica.asp?proj_id=" & parProjId &"','Add Project Replication')"%></td></tr></table></div></td></tr></table><%End Sub%><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><!-- DROPDOWN MENUS --><!--#include file="_jquery_includes.asp"--><!--#include file="_menu_def.asp"--><%Call InsertUserScripts%><%Call InsertTips%></head><body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0"><!-- HEADER --><!--#include file="_header.asp"--><!-- BODY ----><table class="full_table"><tr><td width="146px" class="panel_bg" valign="top"><%Call LeftPanelContent%></td><td width="90%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF"><%Call MainPanelContent%></td></tr><tr><td class="panel_bg" valign="bottom" align="center" height="350"></td></tr></table><!-- FOOTER --><!--#include file="_footer.asp"--></body></html>