You are here

function theme_support_pm_user_client_hours_details in Support Ticketing System 7

Same name and namespace in other branches
  1. 6 support_pm/support_pm.module \theme_support_pm_user_client_hours_details()

Bar graph details.

2 theme calls to theme_support_pm_user_client_hours_details()
support_pm_admin_reports in support_pm/support_pm.admin.inc
support_pm_plan_overview_weekly in support_pm/support_pm.module

File

support_pm/support_pm.module, line 775
Support Project Management. @author Jeremy Andrews <jeremy@tag1consulting.com> @package Support

Code

function theme_support_pm_user_client_hours_details($variables) {
  $day = $variables['day'];
  $scale = $variables['scale'];
  static $comment;
  $clients = array();
  $chart = array();
  $hours = array();
  $colors = array();
  foreach ($day as $clid => $data) {
    $hours[$clid] = $data->hours;
    $colors[$clid] = support_pm_chartapi_color($clid);
  }
  if (empty($hours)) {
    $hours[] = 0;
    $colors[] = support_pm_chartapi_color(0);
  }

  // TODO: Allow attribute overrides
  $attributes = array(
    'class' => 'chart',
  );
  $output = support_pm_chartapi_render(array(
    'cht' => 'bvs',
    'chd' => 't:' . implode('|', $hours),
    'chco' => implode(',', $colors),
    'chs' => '45x70',
    'chl' => format_plural(array_sum($hours), '1 hr', '@count hrs'),
    'chma' => '7,0,7',
    'chds' => "0,{$scale}",
  ), $attributes);
  return $output;
}