Merge pull request #66 from radiorabe/feature/fix-listenerstat-page

Problem: sad tape error on /listenerstats
This commit is contained in:
Robb 2017-03-12 14:57:35 -04:00 committed by GitHub
commit 0d025f86ea
2 changed files with 5 additions and 12 deletions

View File

@ -1576,17 +1576,8 @@ class Application_Model_Preference
/**
* Accessors for station bandwidth limit.
*/
public static function getBandwidthLimit() {
$val = self::getValue("bandwidth_limit");
if (empty($val)) {
// Set and return the plan defaults
// TODO: remove this once all existing customers have this pref set
$planType = self::GetPlanLevel();
$val = Billing::$PLAN_TYPE_DEFAULTS[$planType]["bandwidth_limit"];
self::setBandwidthLimit($val);
}
return $val;
return self::getValue("bandwidth_limit");
}
public static function setBandwidthLimit($value) {

View File

@ -15,8 +15,9 @@
</fieldset>
</div>
<div style="clear: both;"></div>
<?php $bandwidthUsage = Application_Model_Preference::getBandwidthLimitCounter(); ?>
<?php $bandwidthLimit = Application_Model_Preference::getBandwidthLimit(); ?>
<?php if ($bandwidthLimit): ?>
<?php $bandwidthUsage = Application_Model_Preference::getBandwidthLimitCounter(); ?>
<?php $percentInUse = sprintf("%01.1f%% ", $bandwidthUsage/$bandwidthLimit*100); ?>
<div id="bandwidth_usage">
<div style="padding-bottom: 2px;"><?php echo _("Monthly Listener Bandwidth Usage") ?></div>
@ -26,4 +27,5 @@
<div style="margin-top: 17px; font-size: 12px;"><?php echo sprintf("%01.1fGB of %01.1fGB", $bandwidthUsage/pow(2, 30), $bandwidthLimit/pow(2, 30)); ?></div>
</div>
</div>
<?php endif; ?>
</div>