1
0
mirror of https://github.com/e107inc/e107.git synced 2025-01-17 20:58:30 +01:00

Fix for getUsersInClass() query. Chart class experiment (commented out)

This commit is contained in:
Cameron 2019-05-01 17:08:33 -07:00
parent 65f1a46fcf
commit 95b336dea3
3 changed files with 91 additions and 3 deletions

View File

@ -453,6 +453,92 @@ class e_chart
}
// Toggle Data from clicking on Legend. //FIXME
/* $js .= "
// create columns array
var columns".$id." = [];
// display these data series by default
var defaultSeries = [1, 3];
var series".$id." = {};
for (var i = 0; i < data.getNumberOfColumns(); i++) {
if (i == 0 || defaultSeries.indexOf(i) > -1) {
// if the column is the domain column or in the default list, display the series
columns".$id.".push(i);
}
else {
// otherwise, hide it
columns".$id.".push({
label: data.getColumnLabel(i),
type: data.getColumnType(i),
sourceColumn: i,
calc: function () {
return null;
}
});
}
if (i > 0) {
columns".$id.".push({
calc: 'stringify',
sourceColumn: i,
type: 'string',
role: 'annotation'
});
// set the default series option
series".$id."[i - 1] = {};
if (defaultSeries.indexOf(i) == -1) {
// backup the default color (if set)
if (typeof(series".$id."[i - 1].color) !== 'undefined') {
series".$id."[i - 1].backupColor = series".$id."[i - 1].color;
}
series".$id."[i - 1].color = '#CCCCCC';
}
}
}
function showHideSeries".$id." () {
var sel = chart.getSelection();
// if selection length is 0, we deselected an element
if (sel.length > 0) {
// if row is undefined, we clicked on the legend
if (sel[0].row == null) {
var col = sel[0].column;
if (typeof(columns".$id."[col]) == 'number') {
var src = columns".$id."[col];
// hide the data series
columns".$id."[col] = {
label: data.getColumnLabel(src),
type: data.getColumnType(src),
sourceColumn: src,
calc: function () {
return null;
}
};
// grey out the legend entry
series".$id."[src - 1].color = '#CCCCCC';
}
else {
var src = columns".$id."[col].sourceColumn;
// show the data series
columns".$id."[col] = src;
series".$id."[src - 1].color = null;
}
var view = new google.visualization.DataView(data);
view.setColumns(columns".$id.");
chart.draw(view, options);
}
}
}
google.visualization.events.addListener(chart, 'select', showHideSeries".$id.");
";
*/
$js .= "
chart.draw(data, options);
}

View File

@ -268,11 +268,13 @@ class user_class
$blockers = array(e_UC_PUBLIC => 1, e_UC_READONLY => 1, e_UC_MEMBER => 1, e_UC_NOBODY => 1, e_UC_GUEST => 1, e_UC_NEWUSER => 1, e_UC_BOTS => 1);
$possibles = array_flip(explode(',',$classList));
unset($possibles[e_UC_READONLY]);
foreach ($this->class_tree as $uc => $uv)
{
if (!isset($blockers[$uc]))
{
$ec = $uv['userclass_editclass'];
// $ec = $uv['userclass_visibility'];
if (isset($possibles[$ec]))
{
$ret[] = $uc;
@ -1189,7 +1191,7 @@ class user_class
{
$class_regex = implode('|', array_flip($classList));
$regex = "(^|,)(".e107::getParser()->toDB($class_regex).")(,|$)";
$qry[] = "user_class REGEXP '{$regex}' ORDER BY '{$orderBy}'";
$qry[] = "user_class REGEXP '{$regex}' ";
}
if(empty($qry))