Subversion Repositories DevTools

Rev

Rev 7292 | Details | Compare with Previous | Last modification | View Log | RSS feed

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