Subversion Repositories DevTools

Rev

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