Soem refactoring to keep things a bit more consistent.
[timetracker.git] / cf_dropdown_options.php
index e12900b..544eefd 100644 (file)
@@ -31,7 +31,7 @@ require_once('plugins/CustomFields.class.php');
 import('form.Form');
 
 // Access check.
-if (!ttAccessCheck(right_manage_team)) {
+if (!ttAccessCheck(right_manage_team) || !$user->isPluginEnabled('cf')) {
   header('Location: access_denied.php');
   exit();
 }
@@ -39,7 +39,7 @@ if (!ttAccessCheck(right_manage_team)) {
 $field_id = $request->getParameter('field_id');
 $options = CustomFields::getOptions($field_id);
 if (false === $options)
-  $errors->add($i18n->getKey('error.db'));
+  $err->add($i18n->getKey('error.db'));
 
 $form = new Form('dropdownOptionsForm');