Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'   View Deplayable State Information
'       form_view_deployable_state.asp
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.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"-->
<!--#include file="_action_buttons.asp"-->

<!--#include file="class/classActionButtonControl.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login_optional.asp"-->
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim parRtagId
Dim modifyState
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parRtagId = Request("rtag_id")
objPMod.PersistInQryString("rtag_id")
ReleaseMode = GetReleaseMode( Request("rtag_id") )
modifyState = "disabled"

If releaseIsWritable(ReleaseMode) Then
    If canActionControlInProject("ConfigureRelease") OR canActionControlInProject("EditNonCriticalInfoForLockedPackage") Then modifyState = ""
End If
'----------------------------------------------
Sub ShowSidePanel
End Sub
'----------------------------------------------
Sub ShowMainPanel
 %>
        <div id='ds_progressBar' class='vixSpinner' style='visibility:hidden;position:fixed'></div>
    <table class="embedded_table" style="margin-bottom:10px; width:50%">
      <tr>
         <td>
            <span nowrap class="form_ttl">VIEW DEPLOYMENT STATE</span>
            <!-- Section Top Border ---->
            <div class="rounded_box" style="background: white;">
                <!-- Section Body Header ---->
                <!-- Main Pane -->
                <table id="deploymentstatetable" width="100%" class="stripe">
                    <thead class="body_col">
                        <tr>
                          <th>PV_ID
                          <th>Package Name
                          <th>Package Version
                          <th>Package Extension
                          <th>Short Description
                          <th><%=Quick_Help("h_deployable")%>Deployable
                        </tr>
                    </thead>
                    <tbody>
                    </tbody>
                </table>
                <!-- Info / Ajax Progress bar -->
                <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
                    <div id='ds_info'  style='position: absolute;'></div>
                    <div>
                          <button id='ds_refresh'  class='rmbutton' style="display:inline; float:right;">Refresh</button>
                          <button id='ds_show'     class='rmbutton' style="display:inline; float:right;">Show Deployable</button>
                          <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear All</button>
                    </div>
                </div>
            </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>
        <%bJqueryDataTables = TRUE%>
        <!--#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" type="text/javascript">
        formTips.tips.h_deployable       = stdTip(300, 'Deployable', 'Show packages that are marked as Deployable' +
                                                                  '<p>These packages may be processed by deployment tools and the package contents ' + 
                                                                  'may be processed into a deployment BOM' 
                                                                  );
        </script>
        <script type="text/javascript" charset="utf-8">
        var table;
        var showHide = false;
        $(document).ready(function() {
                /* Init DataTables */
        table = $("#deploymentstatetable").DataTable({
            processing: true,
            deferRender: true,
            dom: "frtiS",
            sScrollY: $( document ).height() - 45 - 200 - 15,
            scrollCollapse: true,
            retrieve:true,
            serverSide: true,
            ajax : {
                url : "deployable_state_json.asp",
                data : function (o){
                    o.rtag_id = <%=parRtagId%>;
                    o.show = showHide;
                },
                dataSrc : function (json){
                    //  Process the raw Ajax data
                    //      Create a checkbox for the state
                    //      Add a data item to the entry - to allow traceback when saving
                    $.each(json.data, function(idx,row){
                            var checked = row[5] == "Y" ? 'checked' : '';
                        row[5] = '<div><input type="checkbox" class=clickable <%=modifyState%> '+ checked + ' data-pvid='+ row[0] +'></div>' 
                    });
                    return json.data;
                }
            },
            ordering: true,
            order: [[ 1, "asc" ]],
            lengthChange : false,

            scroller : {
                            loadingIndicator : true,
                displayBuffer: 3,
                    },
            columns: [
               { visible : false },
               { width: "20%", className: "dt-nowrap"  },
               { width: "20%", className: "dt-nowrap"  },
               { width: "1%", className: "dt-nowrap"  },
               { orderable: false },
               { className: "dt-nowrap" }
           ]
        });

    // Wire Up buttons
    $('#ds_refresh').on("click", function(){
        table.ajax.reload(null, false);        
    });

    $('#ds_show').on("click", function(){
        $(this).text( showHide ? 'Show Deployable' : 'Show All');
        showHide = !showHide;
        table.ajax.reload();        
    });

    $('#ds_clearAll').on("click", function(){
        var msg  = 'Are you sure you want to reset the "Deployable" flag on all packages in this Release?' +
                   '<p>There may be side effects.<p>The flag is a function of the package-version, not the release.' +
                   '<p>Resetting all the flags may affect other Releases and Projects.';

        vixConfirm (msg,{
            title:'Reset All Deploy Flags', 
            button: 'Reset All Flags',
            ok : function(){
                getAjaxData (
                    "_json_UpdateVersion.asp",
                    { opr : 'clearAllDeployable',
                      rtag_id : <%=parRtagId%>   
                    },
                    null,
                    function() {table.ajax.reload();}
                    );
                }});
    });


    // Process click on checkboxes within the datatable
    //      this - a DOM node
    //      $(this) - The jquery wrapped node
    //
    $('#deploymentstatetable').on( 'click', 'tbody td :checkbox', function () {
        getAjaxData (
            "_json_UpdateVersion.asp",
            { opr : 'setDeployable', 
              pv_id : $(this).data('pvid'), 
              deployment_state : this.checked ? 'Y' : '-' 
            });
        });

        } );

//  getAjaxData - with error processing
//      url - url to fetch
//      data    - additional data to pass to ajax request
//      success - function to call on success
//      always -  function to call at completion
function getAjaxData( url, data, success, always )
{
    clearInfo();
    $("#ds_progressBar").css('visibility', 'visible');
    $(document.body).css({ 'cursor': 'progress' })
    $.ajax(
    {
        url : url,
        type: "POST",
        data : data,
        dataType : "json",
        cache: false,
        success:function(data, textStatus, jqXHR) {
            //data: return data from server
            //console.log ("UpdateData", data);
            if (data.result != 0) {
                setInfo("Error:" + ((data.error != 0) ? data.emsgSummary : "Reason not given"));
                return;
            }
            //  call user success function
            if (jQuery.isFunction(success)) {
                success(data);
            }
        },
        error: function(jqXHR, textStatus, errorThrown) {
            setInfo("Error:" + errorThrown);
            //if fails
        },
        complete : function() {
            $("#ds_progressBar").css('visibility', 'hidden');
            $(document.body).css({ 'cursor': 'auto' });
            //  call user always function
            if (jQuery.isFunction(always)) {
                always();
            }
        }
    });

function setInfo(txt) {
    $("#ds_info").text( txt);
}

function clearInfo(txt) {
    $("#ds_info").text(" ");
}

}
</script>

      <!-- DROPDOWN MENUS -->
      <!--#include file="_menu_def.asp"-->
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
   </head>
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
      <!-- HEADER -->
      <!--#include file="_header.asp"-->
      <!-- BODY ---->
      <table class="full_table">
         <tr>
            <td class="bg_panel" valign="top" style="min-width:146px">
                <%Call ShowSidePanel%>
            </td>
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
                <%Call ShowMainPanel%>
            </td>
         </tr>
         <tr>
            <td class="bg_panel_btm" height="350"></td>
         </tr>
      </table>
      <!-- FOOTER -->
      <!--#include file="_footer.asp"-->
   </body>
</html>