Subversion Repositories DevTools

Rev

Rev 6624 | Rev 6876 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6624 Rev 6625
Line 58... Line 58...
58
                          <th>Package Version
58
                          <th>Package Version
59
                          <th>Base View
59
                          <th>Base View
60
                          <th>Short Description
60
                          <th>Short Description
61
                          <th>Package Owner
61
                          <th>Package Owner
62
                          <th>Select
62
                          <th>Select
63
                          <th>Hide1
-
 
64
                          <th>Hide2
63
                          <th>SdkId
65
                        </tr>
64
                        </tr>
66
                    </thead>
65
                    </thead>
67
                    <tbody>
66
                    <tbody>
68
                    </tbody>
67
                    </tbody>
69
                </table>
68
                </table>
-
 
69
                <div id='iframeTxData' style='visibility:hidden;display:none'></div>
70
                <!-- Info / Ajax Progress bar -->
70
                <!-- Info / Ajax Progress bar -->
71
                <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
71
                <div class='bg_dialog body_txt' style='position:relative;min-height:19px;' >
72
                    <img id='ds_progressBar' style='visibility:hidden;position: absolute;display: block' src='icons/i_processing.gif' width='79' height='14'>
72
                    <img id='ds_progressBar' style='visibility:hidden;position: absolute;display: block' src='icons/i_processing.gif' width='79' height='14'>
73
                    <div id='ds_info'  style='position: absolute;'></div>
73
                    <div id='ds_info'  style='position: absolute;'></div>
74
                    <div>
74
                    <div>
75
                          <button id='ds_refresh'  class='rmbutton' style="display:inline; float:right;">Refresh</button>
75
                          <button id='ds_refresh'  class='rmbutton' style="display:inline; float:right;">Refresh</button>
76
                          <button id='ds_setOwner' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Set Owner</button>
76
                          <button id='ds_setOwner' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Set Owner</button>
-
 
77
                          <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear All</button>
77
                          <button id='ds_clearAll' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear Visible</button>
78
                          <button id='ds_clearVis' class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Clear Visible</button>
78
                          <button id='ds_setAll'   class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Set Visible</button>
79
                          <button id='ds_setVis'   class='rmbutton' style="display:inline; float:right;" <%=modifyState%>>Set Visible</button>
79
                    </div>
80
                    </div>
80
                </div>
81
                </div>
81
            </div>
82
            </div>
82
            </td>
83
            </td>
83
        </tr>
84
        </tr>
Line 115... Line 116...
115
            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
116
            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
116
                return $('input', td).prop('checked') ? '1' : '0';
117
                return $('input', td).prop('checked') ? '1' : '0';
117
            } );
118
            } );
118
        }
119
        }
119
 
120
 
-
 
121
        /* Create an array with the values of all the innerText in a column */
-
 
122
        $.fn.dataTable.ext.order['dom-innerText'] = function  ( settings, col )
-
 
123
        {
-
 
124
            return this.api().column( col, {order:'index'} ).nodes().map( function ( td, i ) {
-
 
125
                return $(td).text();
-
 
126
            } );
-
 
127
        }
-
 
128
 
120
	$(document).ready(function() {
129
	$(document).ready(function() {
121
		/* Init DataTables */
130
		/* Init DataTables */
122
        table = $("#deploymentstatetable").DataTable({
131
        table = $("#deploymentstatetable").DataTable({
123
            processing: true,
-
 
124
            deferRender: false,
-
 
125
            dom: "frtiS",
132
            dom: "frtiS",
126
            sScrollY: $( document ).height() - 45 - 200 - 15,
133
            sScrollY: $( document ).height() - 45 - 200 - 15,
127
            scrollCollapse: true,
134
            scrollCollapse: true,
128
            retrieve:true,
-
 
129
            serverSide: false,
-
 
130
            ajax : {
135
            ajax : {
131
                url : "view_package_owner_json.asp",
136
                url : "view_package_owner_json.asp",
132
                data : function (o){
137
                data : function (o){
133
                    o.rtag_id = <%=parRtagId%>;
138
                    o.rtag_id = <%=parRtagId%>;
134
                },
139
                },
Line 144... Line 149...
144
                        //      Create nice email fields
149
                        //      Create nice email fields
145
                        row[5] = "<span title='Select Email Options' class='mailto txt_linked' data-email='" + row[7] + "' data-uname='" + row[6] + "'>" + row[5] + "</span>"
150
                        row[5] = "<span title='Select Email Options' class='mailto txt_linked' data-email='" + row[7] + "' data-uname='" + row[6] + "'>" + row[5] + "</span>"
146
 
151
 
147
                        // Create a check box
152
                        // Create a check box
148
                        //  Not for packages imported via SDK
153
                        //  Not for packages imported via SDK
149
                        var cbClass = row[9] ? '' : 'clickable';
154
                        var cbClass = row[8] ? '' : 'clickable';
150
                        var cbDis = row[9] || "<%=modifyState%>" ? ' disabled ' : '';
155
                        var cbDis = (row[8] || "<%=modifyState%>") ? ' disabled ' : '';
151
                        row[6] = '<div><input type="checkbox" class='+cbClass+' data-pvid=' + row[0] + ' '+ cbDis + '></div>'
156
                        row[6] = '<div><input type="checkbox" class='+cbClass+' data-pvid=' + row[0] + ' '+ cbDis + '></div>'
152
 
157
 
153
                    });
158
                    });
154
                    return json.data;
159
                    return json.data;
155
                },
160
                },
Line 171... Line 176...
171
            order: [[ 1, "asc" ]],
176
            order: [[ 1, "asc" ]],
172
            lengthChange : false,
177
            lengthChange : false,
173
 
178
 
174
            columns: [
179
            columns: [
175
               { visible : false },
180
               { visible : false },
176
               { width: "20%", className: "dt-nowrap",},
181
               { width: "20%", className: "dt-nowrap", orderDataType : 'dom-innerText'},
177
               { width: "20%", className: "dt-nowrap"  },
182
               { width: "20%", className: "dt-nowrap", orderDataType : 'dom-innerText'},
178
               { width: "1%", className: "dt-nowrap"  },
183
               { width: "1%", className: "dt-nowrap"  },
179
               { orderable: false },
184
               { orderable: false, searchable: false },
180
               { className: "dt-nowrap" },
185
               { className: "dt-nowrap" },
181
               { width: "1%", orderable: true, className: "dt-nowrap", orderDataType : 'dom-checkbox' },
186
               { width: "1%", orderable: true, className: "dt-nowrap", orderDataType : 'dom-checkbox' },
182
               { visible: false },
187
               { visible: false },
183
               { visible: false },
-
 
184
           ],
188
           ],
185
          columnDefs: [
-
 
186
                { "orderData": [ 8 ],    "targets": 1 },
-
 
187
            ]
-
 
188
        });
189
        });
189
 
190
 
190
        // Wire Up buttons
191
        // Wire Up buttons
191
        $('#ds_refresh').on("click", function(){
192
        $('#ds_refresh').on("click", function(){
192
            table.ajax.reload(null, false);
193
            table.ajax.reload(null, false);
193
        });
194
        });
194
 
195
 
195
        $('#ds_clearAll').on("click", function(){
196
        $('#ds_clearAll').on("click", function(){
196
            $('.clickable').removeAttr('checked');
197
            $(table.column(6).nodes()).find('.clickable').removeAttr('checked');
-
 
198
            updateCounts();        
-
 
199
        });
-
 
200
 
-
 
201
        $('#ds_clearVis').on("click", function(){
-
 
202
            $(table.column(6,{filter:'applied'}).nodes()).find('.clickable').removeAttr('checked');
197
            updateCounts();        
203
            updateCounts();        
198
        });
204
        });
199
 
205
 
200
        $('#ds_setAll').on("click", function(){
206
        $('#ds_setVis').on("click", function(){
201
            $('.clickable').prop('checked', true);
207
            $(table.column(6,{filter:'applied'}).nodes()).find('.clickable').prop('checked', true);
202
            updateCounts();        
208
            updateCounts();        
203
        });
209
        });
204
 
210
 
205
        $('#ds_setOwner').on("click", function(){
211
        $('#ds_setOwner').on("click", function(){
206
            var selList = new Array();
212
            var selList = new Array();
207
             $('.clickable:checked').each(function(){
213
             $(table.column(6).nodes()).find('.clickable:checked').each(function(){
208
                 var pvid = $(this).data("pvid");
214
                 var pvid = $(this).data("pvid");
209
                 selList.push(pvid);
215
                 selList.push(pvid);
210
             });
216
             });
211
 
217
 
212
            //console.log('Data', selList);
218
            //console.log('Data', selList);
-
 
219
            // Save the pv_id list in a hidden element so that the iFrame can extract it
-
 
220
            // Overcome url length issues
213
            if ( selList.length > 0 ) {
221
            if ( selList.length > 0 ) {
-
 
222
                $('#iframeTxData').text(selList.join(','));
214
                MM_openVixIFrame('_wform_change_owner_bulk.asp?pvidList=' + selList.join(','),'Bulk Change Owner');
223
                MM_openVixIFrame('_wform_change_owner_bulk.asp','Bulk Change Owner');
215
            }
224
            }
216
        });
225
        });
217
 
226
 
218
        $('#deploymentstatetable').click(updateCounts);
227
        $('#deploymentstatetable').on('click', '.clickable', updateCounts);
219
 
228
 
220
        function updateCounts() {
229
        function updateCounts() {
221
            console.log("CheckCounts");
-
 
222
            var checkCount = $('.clickable:checked').length;
230
            var checkCount = $(table.column(6).nodes()).find('.clickable:checked').length;
223
            $('#ds_info').text(checkCount + " packages selected");
231
            $('#ds_info').text(checkCount + " packages selected");
224
        }
232
        }
225
    });
233
    });
226
</script>
234
</script>
227
 
235