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