Repository: vcl Updated Branches: refs/heads/develop d318bc08f -> 4e9e37c79
VCL-1100 - block allocation usage graph does not work correctly for allocations with a single time slot blockallocations.php: modified AJviewBlockAllocationUsage: moved "if(is_null($row['blockStart']))" to start of while loop because next conditional was checking for it not being null; now, always set $laststart (the bug was that $laststart was not getting set for single timeslot block allocations) Project: http://git-wip-us.apache.org/repos/asf/vcl/repo Commit: http://git-wip-us.apache.org/repos/asf/vcl/commit/4e9e37c7 Tree: http://git-wip-us.apache.org/repos/asf/vcl/tree/4e9e37c7 Diff: http://git-wip-us.apache.org/repos/asf/vcl/diff/4e9e37c7 Branch: refs/heads/develop Commit: 4e9e37c791abf23ba0d50c3d683a8625f468dac6 Parents: d318bc0 Author: Josh Thompson <[email protected]> Authored: Tue Jun 12 09:36:34 2018 -0400 Committer: Josh Thompson <[email protected]> Committed: Tue Jun 12 09:36:34 2018 -0400 ---------------------------------------------------------------------- web/.ht-inc/blockallocations.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/vcl/blob/4e9e37c7/web/.ht-inc/blockallocations.php ---------------------------------------------------------------------- diff --git a/web/.ht-inc/blockallocations.php b/web/.ht-inc/blockallocations.php index 66ee16f..9e7f7f2 100644 --- a/web/.ht-inc/blockallocations.php +++ b/web/.ht-inc/blockallocations.php @@ -3870,14 +3870,13 @@ function AJviewBlockAllocationUsage() { $firststart = ''; $laststart = ''; while($row = mysql_fetch_assoc($qh)) { - if($first && ! is_null($row['blockStart'])) { + if(is_null($row['blockStart'])) + continue; + if($first) { $firststart = datetimeToUnix($row['blockStart']); $first = 0; } - elseif(! is_null($row['blockStart'])) - $laststart = datetimeToUnix($row['blockStart']); - if(is_null($row['blockStart'])) - continue; + $laststart = datetimeToUnix($row['blockStart']); $percent = (int)($row['used'] / $row['allocated'] * 100); $startts = datetimeToUnix($row['blockStart']); $usage[$startts] = array('percent' => $percent,
