Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
6624 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'   View Package Owner Information
5
'       form_view_package_owners.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_optional.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
ReleaseMode = GetReleaseMode( Request("rtag_id") )
36
 
37
modifyState = "disabled"
38
If canActionControl("BulkChangePackageOwner") Then modifyState = ""
39
'----------------------------------------------
40
Sub ShowSidePanel
41
End Sub
42
'----------------------------------------------
43
Sub ShowMainPanel
44
 %>
45
    <table class="embedded_table" style="margin-bottom:10px; width:50%">
46
      <tr>
47
         <td>
48
            <span nowrap class="form_ttl">VIEW PACKAGE OWNER</span>
49
            <!-- Section Top Border ---->
50
            <div class="rounded_box" style="background: white;">
51
                <!-- Section Body Header ---->
52
                <!-- Main Pane -->
53
                <table id="deploymentstatetable" width="100%" class="stripe">
54
                    <thead class="body_col">
55
                        <tr>
56
                          <th>PV_ID
57
                          <th>Package Name
58
                          <th>Package Version
59
                          <th>Base View
60
                          <th>Short Description
61
                          <th>Package Owner
62
                          <th>Select
6625 dpurdie 63
                          <th>SdkId
6624 dpurdie 64
                        </tr>
65
                    </thead>
66
                    <tbody>
67
                    </tbody>
68
                </table>
6625 dpurdie 69
                <div id='iframeTxData' style='visibility:hidden;display:none'></div>
6624 dpurdie 70
                <!-- Info / Ajax Progress bar -->
71
                <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
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_setOwner' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Set Owner</button>
6625 dpurdie 76
                          <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear All</button>
77
                          <button id='ds_clearVis' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear Visible</button>
78
                          <button id='ds_setVis'   class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Set Visible</button>
6624 dpurdie 79
                    </div>
80
                </div>
81
            </div>
82
            </td>
83
        </tr>
84
    </table>
85
<%
86
End Sub
87
'----------------------------------------------
88
%>
89
<html>
90
   <head>
91
        <title>Release Manager</title>
92
        <link rel="shortcut icon" href="<%=FavIcon%>"/>
93
        <meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
94
        <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
95
        <link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
96
        <link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
97
        <script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
98
        <%bJqueryDataTables = TRUE%>
99
        <!--#include file="_jquery_includes.asp"-->
100
        <!-- TIPS -->
101
        <script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
102
        <script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
103
        <script language="JavaScript" type="text/javascript">
104
        formTips.tips.h       = stdTip(300, 'Title', 'Text');
105
        </script>
106
        <script type="text/javascript" charset="utf-8">
107
        var table;
108
 
109
        // Suppress errros about badly formatted data
110
        $.fn.dataTable.ext.errMode = 'none';
111
 
112
        /* Create an array with the values of all the checkboxes in a column */
113
        $.fn.dataTable.ext.order['dom-checkbox'] = function  ( settings, col )
114
        {
115
            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
116
                return $('input', td).prop('checked') ? '1' : '0';
117
            } );
118
        }
119
 
6625 dpurdie 120
        /* Create an array with the values of all the innerText in a column */
121
        $.fn.dataTable.ext.order['dom-innerText'] = function  ( settings, col )
122
        {
123
            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
124
                return $(td).text();
125
            } );
126
        }
127
 
6624 dpurdie 128
	$(document).ready(function() {
129
		/* Init DataTables */
130
        table = $("#deploymentstatetable").DataTable({
131
            dom: "frtiS",
7250 dpurdie 132
            paging: true,
133
			scrollY: $( document ).height() - 45 - 200 - 15,
6624 dpurdie 134
            scrollCollapse: true,
7250 dpurdie 135
            scroller : {
136
			    loadingIndicator : true,
137
                displayBuffer: 3,
138
		    },
6624 dpurdie 139
            ajax : {
140
                url : "view_package_owner_json.asp",
141
                data : function (o){
142
                    o.rtag_id = <%=parRtagId%>;
143
                },
144
                dataSrc : function (json){
145
                    // Detect errors
146
                     if (json.result != 0) {
147
                         $('#ds_info').text("Error:" + ((json.error != 0) ? json.emsgSummary : "Reason not given"));
148
                         return { data: {}};
149
                     }
150
 
151
                    //  Process the raw Ajax data
152
                    $.each(json.data, function(idx,row){
153
                        //      Create nice email fields
154
                        row[5] = "<span title='Select Email Options' class='mailto txt_linked' data-email='" + row[7] + "' data-uname='" + row[6] + "'>" + row[5] + "</span>"
155
 
156
                        // Create a check box
157
                        //  Not for packages imported via SDK
6625 dpurdie 158
                        var cbClass = row[8] ? '' : 'clickable';
159
                        var cbDis = (row[8] || "<%=modifyState%>") ? ' disabled ' : '';
6624 dpurdie 160
                        row[6] = '<div><input type="checkbox" class='+cbClass+' data-pvid=' + row[0] + ' '+ cbDis + '></div>'
161
 
162
                    });
163
                    return json.data;
164
                },
165
                beforeSend: function (){
7292 dpurdie 166
                     $("#progressSpinner").css('visibility', 'visible');
6624 dpurdie 167
                     $(document.body).css({ 'cursor': 'progress' });
168
                     $('#ds_info').empty();
169
                },
170
                complete: function (){
7292 dpurdie 171
                     $("#progressSpinner").css('visibility', 'hidden');
6624 dpurdie 172
                     $(document.body).css({ 'cursor': 'auto' });
173
                },
174
                error: function(jqXHR, textStatus, errorThrown) {
175
                    $('#ds_info').text("Error:" + errorThrown);
176
                    //if fails
177
                },
178
            },
179
            ordering: true,
180
            order: [[ 1, "asc" ]],
181
            lengthChange : false,
182
 
183
            columns: [
184
               { visible : false },
6625 dpurdie 185
               { width: "20%", className: "dt-nowrap", orderDataType : 'dom-innerText'},
186
               { width: "20%", className: "dt-nowrap", orderDataType : 'dom-innerText'},
6624 dpurdie 187
               { width: "1%", className: "dt-nowrap"  },
6625 dpurdie 188
               { orderable: false, searchable: false },
6624 dpurdie 189
               { className: "dt-nowrap" },
190
               { width: "1%", orderable: true, className: "dt-nowrap", orderDataType : 'dom-checkbox' },
191
               { visible: false },
192
           ],
193
        });
194
 
195
        // Wire Up buttons
196
        $('#ds_refresh').on("click", function(){
197
            table.ajax.reload(null, false);
198
        });
199
 
200
        $('#ds_clearAll').on("click", function(){
6625 dpurdie 201
            $(table.column(6).nodes()).find('.clickable').removeAttr('checked');
6624 dpurdie 202
            updateCounts();        
203
        });
204
 
6625 dpurdie 205
        $('#ds_clearVis').on("click", function(){
206
            $(table.column(6,{filter:'applied'}).nodes()).find('.clickable').removeAttr('checked');
6624 dpurdie 207
            updateCounts();        
208
        });
209
 
6625 dpurdie 210
        $('#ds_setVis').on("click", function(){
211
            $(table.column(6,{filter:'applied'}).nodes()).find('.clickable').prop('checked', true);
212
            updateCounts();        
213
        });
214
 
6624 dpurdie 215
        $('#ds_setOwner').on("click", function(){
216
            var selList = new Array();
6625 dpurdie 217
             $(table.column(6).nodes()).find('.clickable:checked').each(function(){
6624 dpurdie 218
                 var pvid = $(this).data("pvid");
219
                 selList.push(pvid);
220
             });
221
 
222
            //console.log('Data', selList);
6625 dpurdie 223
            // Save the pv_id list in a hidden element so that the iFrame can extract it
224
            // Overcome url length issues
6624 dpurdie 225
            if ( selList.length > 0 ) {
6625 dpurdie 226
                $('#iframeTxData').text(selList.join(','));
227
                MM_openVixIFrame('_wform_change_owner_bulk.asp','Bulk Change Owner');
6624 dpurdie 228
            }
229
        });
230
 
6625 dpurdie 231
        $('#deploymentstatetable').on('click', '.clickable', updateCounts);
6624 dpurdie 232
 
233
        function updateCounts() {
6625 dpurdie 234
            var checkCount = $(table.column(6).nodes()).find('.clickable:checked').length;
6624 dpurdie 235
            $('#ds_info').text(checkCount + " packages selected");
236
        }
237
    });
238
</script>
239
 
240
      <!-- DROPDOWN MENUS -->
241
      <!--#include file="_menu_def.asp"-->
242
      <script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
243
   </head>
244
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
245
      <!-- HEADER -->
246
      <!--#include file="_header.asp"-->
247
      <!-- BODY ---->
248
      <table class="full_table">
249
         <tr>
6876 dpurdie 250
            <td class="bg_panel" valign="top" style="min-width:146px">
6624 dpurdie 251
                <%Call ShowSidePanel%>
252
            </td>
253
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
254
                <%Call ShowMainPanel%>
255
            </td>
256
         </tr>
257
         <tr>
6877 dpurdie 258
            <td class="bg_panel_btm" height="350"></td>
6624 dpurdie 259
         </tr>
260
      </table>
261
      <!-- FOOTER -->
262
      <!--#include file="_footer.asp"-->
263
   </body>
264
</html>