import('ttTeamHelper');
// Access check.
-if (!ttAccessCheck(right_view_charts)) {
+if (!ttAccessCheck(right_view_charts) || !$user->isPluginEnabled('ch')) {
header('Location: access_denied.php');
exit();
}
$cl_type = $sc->getValue(SYSC_CHART_TYPE);
}
if (MODE_TIME == $user->tracking_mode) {
- if (in_array('cl', explode(',', $user->plugins)))
+ if ($user->isPluginEnabled('cl'))
$cl_type = CHART_CLIENTS;
} else {
if ($cl_type == CHART_CLIENTS) {
- if (!in_array('cl', explode(',', $user->plugins)))
+ if (!$user->isPluginEnabled('cl'))
$cl_type = CHART_PROJECTS;
- } else if ($cl_type == CHART_TASKS) {
+ } elseif ($cl_type == CHART_TASKS) {
if (MODE_PROJECTS_AND_TASKS != $user->tracking_mode)
$cl_type = CHART_PROJECTS;
}
));
// Chart type options.
-$chart_selector = (MODE_PROJECTS_AND_TASKS == $user->tracking_mode
- || in_array('cl', explode(',', $user->plugins)));
+$chart_selector = (MODE_PROJECTS_AND_TASKS == $user->tracking_mode || $user->isPluginEnabled('cl'));
if ($chart_selector) {
$types = array();
if (MODE_PROJECTS == $user->tracking_mode || MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$types[CHART_PROJECTS] = $i18n->getKey('dropdown.projects');
if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$types[CHART_TASKS] = $i18n->getKey('dropdown.tasks');
- if (in_array('cl', explode(',', $user->plugins)))
+ if ($user->isPluginEnabled('cl'))
$types[CHART_CLIENTS] = $i18n->getKey('dropdown.clients');
// Add chart type dropdown.