Improved the script that shows the Totals only checkbox.
[timetracker.git] / cf_dropdown_options.php
index 3ee5294..1afce73 100644 (file)
@@ -30,22 +30,26 @@ require_once('initialize.php');
 require_once('plugins/CustomFields.class.php');
 import('form.Form');
 
-// Access check.
-if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
+// Access checks.
+if (!ttAccessAllowed('manage_custom_fields')) {
   header('Location: access_denied.php');
   exit();
 }
+if (!$user->isPluginEnabled('cf')) {
+  header('Location: feature_disabled.php');
+  exit();
+}
 
 $field_id = $request->getParameter('field_id');
 $options = CustomFields::getOptions($field_id);
 if (false === $options)
-  $err->add($i18n->getKey('error.db'));
+  $err->add($i18n->get('error.db'));
 
 $form = new Form('dropdownOptionsForm');
 
 $smarty->assign('forms', array($form->getName()=>$form->toArray()));
 $smarty->assign('field_id', $field_id);
 $smarty->assign('options', $options);
-$smarty->assign('title', $i18n->getKey('title.cf_dropdown_options'));
+$smarty->assign('title', $i18n->get('title.cf_dropdown_options'));
 $smarty->assign('content_page_name', 'cf_dropdown_options.tpl');
 $smarty->display('index.tpl');