Lines 1376-1381
Link Here
|
1376 |
} |
1376 |
} |
1377 |
|
1377 |
|
1378 |
$(document).ready(function(){ |
1378 |
$(document).ready(function(){ |
|
|
1379 |
|
1380 |
var activeTab = Cookies.get("sql_reports_activetab"); |
1381 |
|
1379 |
$("body").on('click',".fetch_chart_data",function(){ |
1382 |
$("body").on('click',".fetch_chart_data",function(){ |
1380 |
if( [% unlimited_total || 0 | $raw %] > 1000 ){ |
1383 |
if( [% unlimited_total || 0 | $raw %] > 1000 ){ |
1381 |
if( confirm("Fetching full chart data for reports with many rows can cause performance issues. Are you sure you with to chart this report?") ){ |
1384 |
if( confirm("Fetching full chart data for reports with many rows can cause performance issues. Are you sure you with to chart this report?") ){ |
Lines 1563-1601
Link Here
|
1563 |
}, |
1566 |
}, |
1564 |
}, columns_settings); |
1567 |
}, columns_settings); |
1565 |
|
1568 |
|
1566 |
var rtabs = $("#tabs").tabs(); |
1569 |
var rtabs = $("#tabs").tabs({ |
1567 |
rtabs.on("tabsactivate", function(e, ui) { |
1570 |
create: function( e, ui ){ |
1568 |
$("#subgroup_filter option").each(function() { |
1571 |
tabsInit( ui, rtable ); |
1569 |
if($(this).val().length > 0) { |
1572 |
}, |
1570 |
$(this).remove(); |
1573 |
activate: function( e, ui ){ |
1571 |
} |
1574 |
tabsInit( ui, rtable ); |
1572 |
}); |
|
|
1573 |
rtable.fnFilter('', 4); |
1574 |
rtable.fnFilter('', 5); |
1575 |
rtable.fnSetColumnVis(4, true); |
1576 |
rtable.fnSetColumnVis(5, true); |
1577 |
|
1578 |
var g_id = $(ui.newTab).children().attr('id'); |
1579 |
var g_name = $(ui.newTab).text(); |
1580 |
if ( g_name == _("All") ) { |
1581 |
g_id = ""; |
1582 |
g_name = ""; |
1583 |
} |
1584 |
|
1585 |
if (g_id && g_id.length > 0) { |
1586 |
rtable.fnFilter('^' + g_name + '$', 4, true, true, true, false); |
1587 |
rtable.fnSetColumnVis(4, false); |
1588 |
for(var i in group_subgroups[g_id]) { |
1589 |
$("#subgroup_filter").append( |
1590 |
'<option value="' + group_subgroups[g_id][i][0] + '">' |
1591 |
+ group_subgroups[g_id][i][1] + '</option>' |
1592 |
); |
1593 |
} |
1594 |
$("#subgroup_filter_block").show(); |
1595 |
} else { |
1596 |
$("#subgroup_filter_block").hide(); |
1597 |
} |
1575 |
} |
1598 |
}); |
1576 |
}); |
|
|
1577 |
if( activeTab ){ |
1578 |
$("#tabs").tabs("option","active", activeTab ); |
1579 |
} |
1599 |
$("#subgroup_filter_block").hide(); |
1580 |
$("#subgroup_filter_block").hide(); |
1600 |
|
1581 |
|
1601 |
$("#subgroup_filter").change(function() { |
1582 |
$("#subgroup_filter").change(function() { |
Lines 1808-1813
Link Here
|
1808 |
}); |
1789 |
}); |
1809 |
}); |
1790 |
}); |
1810 |
|
1791 |
|
|
|
1792 |
function tabsInit( ui, rtable ){ |
1793 |
var thisTab = ui.newTab ? ui.newTab : ui.tab; |
1794 |
var activeTab = thisTab.index(); |
1795 |
Cookies.set("sql_reports_activetab", activeTab ); |
1796 |
|
1797 |
$("#subgroup_filter option").each(function() { |
1798 |
if($(this).val().length > 0) { |
1799 |
$(this).remove(); |
1800 |
} |
1801 |
}); |
1802 |
rtable.fnFilter('', 4); |
1803 |
rtable.fnFilter('', 5); |
1804 |
rtable.fnSetColumnVis(4, true); |
1805 |
rtable.fnSetColumnVis(5, true); |
1806 |
|
1807 |
var g_id = $(ui.newTab).children().attr('id'); |
1808 |
var g_name = $(ui.newTab).text(); |
1809 |
if ( g_name == _("All") ) { |
1810 |
g_id = ""; |
1811 |
g_name = ""; |
1812 |
} |
1813 |
|
1814 |
if (g_id && g_id.length > 0) { |
1815 |
rtable.fnFilter('^' + g_name + '$', 4, true, true, true, false); |
1816 |
rtable.fnSetColumnVis(4, false); |
1817 |
for(var i in group_subgroups[g_id]) { |
1818 |
$("#subgroup_filter").append( |
1819 |
'<option value="' + group_subgroups[g_id][i][0] + '">' |
1820 |
+ group_subgroups[g_id][i][1] + '</option>' |
1821 |
); |
1822 |
} |
1823 |
$("#subgroup_filter_block").show(); |
1824 |
} else { |
1825 |
$("#subgroup_filter_block").hide(); |
1826 |
} |
1827 |
} |
1828 |
|
1811 |
function addColumn() { |
1829 |
function addColumn() { |
1812 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1830 |
$("#availableColumns option:selected").clone().appendTo("#selectedColumns").attr("selected", "selected"); |
1813 |
} |
1831 |
} |
1814 |
- |
|
|