diff --git a/admin/batch_manager_global.php b/admin/batch_manager_global.php index 7c3078a82..dd56fa8e4 100644 --- a/admin/batch_manager_global.php +++ b/admin/batch_manager_global.php @@ -453,6 +453,11 @@ if ($conf['enable_synchronization']) $prefilters[] = array('ID' => 'no_sync_md5sum', 'NAME' => l10n('With no checksum')); } +function UC_name_compare($a, $b) +{ + return strcmp(strtolower($a['NAME']), strtolower($b['NAME'])); +} + $prefilters = trigger_change('get_batch_manager_prefilters', $prefilters); usort($prefilters, 'UC_name_compare'); diff --git a/admin/intro.php b/admin/intro.php index a2109ec4f..ad08f0a06 100644 --- a/admin/intro.php +++ b/admin/intro.php @@ -205,13 +205,13 @@ $temp_data = array(); //Get data from $nb_weeks last weeks while ($mondays < $nb_weeks) { - $date->sub(new DateInterval('P1D')); - if ($date->format('D') == 'Mon') { $week_number[] = $date->format('W'); $mondays += 1; } + + $date->sub(new DateInterval('P1D')); } $week_number = array_reverse($week_number); @@ -284,10 +284,13 @@ for ($i=1; $i < count($temp_data); $i++) $split = 0; //Split (split represented by -1) -while (max($diff_x) > 120) +if (count($diff_x) > 0) { - $diff_x[array_search(max($diff_x), $diff_x)] = -1; - $split++; + while (max($diff_x) > 120) + { + $diff_x[array_search(max($diff_x), $diff_x)] = -1; + $split++; + } } //Fill empty chart data for the template diff --git a/admin/stats.php b/admin/stats.php index 93a857ba4..46efafd63 100644 --- a/admin/stats.php +++ b/admin/stats.php @@ -216,7 +216,7 @@ check_status(ACCESS_ADMINISTRATOR); // | Refresh summary from details | // +-----------------------------------------------------------------------+ -//history_summarize(); +history_summarize(); // +-----------------------------------------------------------------------+ // | Display statistics header | @@ -242,6 +242,11 @@ $template->assign( function set_missing_values($unit, $data, $keep_size=true, $firstDate = null, $lastDate = null) { + if (count($data) <= 1) + { + return $data; + } + $limit = count($data); $result = array(); if ($firstDate == null) diff --git a/include/dblayer/functions_mysqli.inc.php b/include/dblayer/functions_mysqli.inc.php index 6474d0bab..f63837ebf 100644 --- a/include/dblayer/functions_mysqli.inc.php +++ b/include/dblayer/functions_mysqli.inc.php @@ -137,6 +137,14 @@ function pwg_query($query) $query = preg_replace('/\brank\b/', '`rank`', $query); } + if (preg_match('/\bgroups\b/', $query)) + { + // first we unescape what's already escaped (to avoid double escaping) + $query = preg_replace('/`groups`/', 'rank', $query); + // then we escape the keyword + $query = preg_replace('/\bgroups\b/', '`rank`', $query); + } + $start = microtime(true); ($result = $mysqli->query($query)) or my_error($query, $conf['die_on_sql_error']);