Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
6122 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'   View Deplayable State Information
5
'       form_view_deployable_state.asp
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
11
Response.Expires = 0   ' always load the page, dont store
12
%>
13
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
19
<!--#include file="_action_buttons.asp"-->
20
 
21
<!--#include file="class/classActionButtonControl.asp"-->
22
<%
23
'------------ ACCESS CONTROL ------------------
24
%>
25
<!--#include file="_access_control_login.asp"-->
26
<!--#include file="_access_control_general.asp"-->
27
<%
28
'------------ Variable Definition -------------
29
Dim parRtagId
30
dim modifyState
31
'------------ Constants Declaration -----------
32
'------------ Variable Init -------------------
33
parRtagId = Request("rtag_id")
34
objPMod.PersistInQryString("rtag_id")
35
modifyState = "disabled"
36
If canActionControlInProject("ConfigureRelease") OR canActionControlInProject("EditNonCriticalInfoForLockedPackage") Then modifyState = ""
37
'----------------------------------------------
38
%>
39
<html>
40
   <head>
41
        <title>Release Manager</title>
42
        <link rel="shortcut icon" href="<%=FavIcon%>"/>
43
        <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
44
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
45
        <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
46
        <link rel="stylesheet" href="images/navigation.css" type="text/css">
47
        <script language="JavaScript" src="images/common.js"></script>
48
        <%bJqueryDataTables = TRUE%>
49
        <!--#include file="_jquery_includes.asp"-->
50
        <!-- TIPS -->
51
        <script language="JavaScript" src="images/tipster.js"></script>
52
        <script language="JavaScript" src="images/_help_tips.js"></script>
53
        <script language="JavaScript" type="text/javascript">
54
        formTips.tips.h_deployable       = stdTip(300, 'Deployable', 'Show packages that are marked as Deployable' +
55
                                                                  '<p>These packages may be processed by deployment tools and the package contents ' + 
56
                                                                  'may be processed into a deployment BOM' 
57
                                                                  );
58
        </script>
59
        <script type="text/javascript" charset="utf-8">
60
        var table;
61
        var showHide = false;
62
	$(document).ready(function() {
63
		/* Init DataTables */
64
        table = $("#deploymentstatetable").DataTable({
65
            processing: true,
66
            deferRender: true,
67
            dom: "frtiS",
68
            sScrollY: $( document ).height() - 45 - 200,
69
            scrollCollapse: true,
70
            retrieve:true,
71
            serverSide: true,
72
            ajax : {
73
                url : "deployable_state_json.asp",
74
                data : function (o){
75
                    o.rtag_id = <%=parRtagId%>;
76
                    o.show = showHide;
77
                },
78
                dataSrc : function (json){
79
                    //  Process the raw Ajax data
80
                    //      Create a checkbox for the state
81
                    //      Add a data item to the entry - to allow traceback when saving
82
                    $.each(json.data, function(idx,row){
83
                            var checked = row[5] == "Y" ? 'checked' : '';
84
                        row[5] = '<div><input type="checkbox" class=clickable <%=modifyState%> '+ checked + ' data-pvid='+ row[0] +'></div>' 
85
                    });
86
                    return json.data;
87
                }
88
            },
89
            ordering: true,
90
            order: [[ 1, "asc" ]],
91
            lengthChange : false,
92
 
93
            Scroller : {
94
			    loadingIndicator : true,
95
                displayBuffer: 3,
96
		    },
97
            columns: [
98
               { visible : false },
99
               { width: "20%", className: "dt-nowrap"  },
100
               { width: "20%", className: "dt-nowrap"  },
101
               { width: "1%", className: "dt-nowrap"  },
102
               { orderable: false },
103
               { className: "dt-nowrap" }
104
           ]
105
        });
106
 
107
    // Wire Up buttons
108
    $('#ds_refresh').on("click", function(){
109
        table.ajax.reload(null, false);        
110
    });
111
 
112
    $('#ds_show').on("click", function(){
113
        $(this).text( showHide ? 'Show Deployable' : 'Show All');
114
        showHide = !showHide;
115
        table.ajax.reload();        
116
    });
117
 
6123 dpurdie 118
    $('#ds_clearAll').on("click", function(){
119
        var msg  = 'Are you sure you want to reset the "Deployable" flag on all packages in this Release?' +
120
                   '<p>There may be side effects.<p>The flag is a function of the package-version, not the release.' +
121
                   '<p>Resetting all the flags may affect other Releases and Projects.';
122
 
123
        vixConfirm (msg,{
124
            title:'Reset All Deploy Flags', 
125
            button: 'Reset All Flags',
126
            ok : function(){
127
                getAjaxData (
128
                    "_json_UpdateVersion.asp",
129
                    { opr : 'clearAllDeployable',
130
                      rtag_id : <%=parRtagId%>   
131
                    },
132
                    null,
133
                    function() {table.ajax.reload();}
134
                    );
135
                }});
136
    });
137
 
138
 
6122 dpurdie 139
    // Process click on checkboxes within the datatable
140
    //      this - a DOM node
141
    //      $(this) - The jquery wrapped node
142
    //
143
    $('#deploymentstatetable').on( 'click', 'tbody td :checkbox', function () {
144
        getAjaxData (
145
            "_json_UpdateVersion.asp",
146
            { opr : 'setDeployable', 
147
              pv_id : $(this).data('pvid'), 
148
              deployment_state : this.checked ? 'Y' : '-' 
149
            });
150
        });
151
 
152
	} );
153
 
154
//  getAjaxData - with error processing
155
//      url - url to fetch
156
//      data    - additional data to pass to ajax request
157
//      success - function to call on success
6123 dpurdie 158
//      always -  function to call at completion
159
function getAjaxData( url, data, success, always )
6122 dpurdie 160
{
161
    clearInfo();
162
    $("#ds_progressBar").css('visibility', 'visible');
163
    $(document.body).css({ 'cursor': 'progress' })
164
    $.ajax(
165
    {
166
        url : url,
167
        type: "POST",
168
        data : data,
169
        dataType : "json",
170
        cache: false,
6123 dpurdie 171
        success:function(data, textStatus, jqXHR) {
6122 dpurdie 172
            //data: return data from server
173
            //console.log ("UpdateData", data);
6123 dpurdie 174
            if (data.result != 0) {
6122 dpurdie 175
                setInfo("Error:" + ((data.error != 0) ? data.emsgSummary : "Reason not given"));
176
                return;
177
            }
178
            //  call user success function
6123 dpurdie 179
            if (jQuery.isFunction(success)) {
6122 dpurdie 180
                success(data);
181
            }
182
        },
6123 dpurdie 183
        error: function(jqXHR, textStatus, errorThrown) {
6122 dpurdie 184
            setInfo("Error:" + errorThrown);
185
            //if fails
186
        },
6123 dpurdie 187
        complete : function() {
6122 dpurdie 188
            $("#ds_progressBar").css('visibility', 'hidden');
6123 dpurdie 189
            $(document.body).css({ 'cursor': 'auto' });
190
            //  call user always function
191
            if (jQuery.isFunction(always)) {
192
                always();
193
            }
6122 dpurdie 194
        }
195
    });
196
 
197
function setInfo(txt) {
198
    $("#ds_info").text( txt);
199
}
200
 
201
function clearInfo(txt) {
202
    $("#ds_info").text(" ");
203
}
204
 
205
}
206
</script>
207
 
208
      <!-- DROPDOWN MENUS -->
209
      <!--#include file="_menu_def.asp"-->
210
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
211
   </head>
212
   <body>
213
      <!-- HEADER -->
214
      <!--#include file="_header.asp"-->
215
      <!-- BODY ---->
216
        <table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed;">
217
            <tr>
218
                <td width="146px" class="panel_bg" valign="top">&nbsp;</td>
219
                <td width="100%" valign="top" align="center"  bgcolor="#EEEFEF">
220
                    <table width="50%" border="0" cellspacing="0" cellpadding="0">
221
                        <tr>
222
                            <td width="1%"></td>
223
                            <td width="100%">
224
                                <span nowrap class="form_ttl">VIEW DEPLOYMENT STATE</span>
225
                                <!-- Section Top Border ---->
226
                                <div class="rounded_box" style="background: white;">
227
                                    <!-- Section Body Header ---->
228
                                    <!-- Main Pane -->
229
                                    <table id="deploymentstatetable" width=100% class="stripe">
230
                                        <thead class="body_col">
231
                                            <tr>
232
                                              <th>PV_ID
233
                                              <th>Package Name
234
                                              <th>Package Version
235
                                              <th>Package Extension
236
                                              <th>Short Description
237
                                              <th><%=Quick_Help("h_deployable")%>Deployable
238
                                            </tr>
239
                                        </thead>
240
                                        <tbody>
241
                                        </tbody>
242
                                    </table>
243
                                    <!-- Info / Ajax Progress bar -->
6123 dpurdie 244
                                    <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
6122 dpurdie 245
                                        <img id='ds_progressBar' style='visibility:hidden;position: absolute;display: block' src='icons/i_processing.gif' width='79' height='14'>
246
                                        <div id='ds_info'  style='position: absolute;'></div>
247
                                        <div>
6123 dpurdie 248
                                              <button id='ds_refresh'  class='rmbutton' style="display:inline; float:right;">Refresh</button>
249
                                              <button id='ds_show'     class='rmbutton' style="display:inline; float:right;">Show Deployable</button>
250
                                              <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;">Clear All</button>
6122 dpurdie 251
                                        </div>
252
                                    </div>
253
                                </div>
254
                            </td>
255
                        </tr>
256
                    </table>
257
                </td>
258
            </tr>
259
        </table>
260
        <!-- FOOTER -->
261
        <!--#include file="_footer.asp"-->
262
    </body>
263
</html>