-// Initialize chart interval.
-$cl_interval = $_SESSION['chart_interval'];
-if (!$cl_interval) {
- $sc = new ttSysConfig($user->id);
- $cl_interval = $sc->getValue(SYSC_CHART_INTERVAL);
-}
-if (!$cl_interval) $cl_interval = INTERVAL_THIS_MONTH;
-$_SESSION['chart_interval'] = $cl_interval;
-
-// Initialize chart type.
-$cl_type = $_SESSION['chart_type'];
-if (!$cl_type) {
- $sc = new ttSysConfig($user->id);
- $cl_type = $sc->getValue(SYSC_CHART_TYPE);
-}
-if (MODE_TIME == $user->tracking_mode) {
- if (in_array('cl', explode(',', $user->plugins)))
- $cl_type = CHART_CLIENTS;
-} else {
- if ($cl_type == CHART_CLIENTS) {
- if (!in_array('cl', explode(',', $user->plugins)))
- $cl_type = CHART_PROJECTS;
- } elseif ($cl_type == CHART_TASKS) {
- if (MODE_PROJECTS_AND_TASKS != $user->tracking_mode)
- $cl_type = CHART_PROJECTS;
- }
-}
-if (!$cl_type) $cl_type = CHART_PROJECTS;
-$_SESSION['chart_type'] = $cl_type;
-
-// Who do we draw charts for?
-$on_behalf_id = $request->getParameter('onBehalfUser', (isset($_SESSION['behalf_id'])? $_SESSION['behalf_id'] : $user->id));
-
-if ($request->getMethod( )== 'POST') {
- // If chart interval changed - save it.