Subversion Repositories DevTools

Rev

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