function theme_support_pm_plan_diff in Support Ticketing System 7
Same name and namespace in other branches
- 6 support_pm/support_pm.module \theme_support_pm_plan_diff()
1 theme call to theme_support_pm_plan_diff()
- support_pm_plan_overview_weekly in support_pm/
support_pm.module
File
- support_pm/
support_pm.module, line 916 - Support Project Management. @author Jeremy Andrews <jeremy@tag1consulting.com> @package Support
Code
function theme_support_pm_plan_diff($variables) {
$diff = $variables['diff'];
$plan = $variables['plan'];
$diff = number_format($diff, 2);
$percent = $plan ? number_format($diff / $plan * 100, 2) : 0;
if ($diff < 0) {
return "<font color='red'>{$diff} ({$percent}%)</font>";
}
else {
if ($diff > 0) {
if ($plan) {
return "<font color='green'>{$diff} (+{$percent}%)</font>";
}
else {
return "<font color='brown'>{$diff}</font>";
}
}
}
return $diff;
}