A bit more progress on getting rid of canManageTeam.
[timetracker.git] / cf_dropdown_option_delete.php
index 270d56f..f4e4420 100644 (file)
@@ -31,7 +31,7 @@ require_once('plugins/CustomFields.class.php');
 import('form.Form');
 
 // Access check.
-if (!ttAccessCheck(right_manage_team)) {
+if (!ttAccessAllowed('manage_custom_fields') || !$user->isPluginEnabled('cf')) {
   header('Location: access_denied.php');
   exit();
 }
@@ -50,7 +50,7 @@ if ($request->isPost()) {
       header("Location: cf_dropdown_options.php?field_id=$field_id");
       exit();
     } else
-      $errors->add($i18n->getKey('error.db'));
+      $err->add($i18n->getKey('error.db'));
   }
   if ($request->getParameter('btn_cancel')) {
     // Cancel button pressed.
@@ -60,9 +60,9 @@ if ($request->isPost()) {
 } else {
   $option = CustomFields::getOptionName($cl_id);
   if (false === $option)
-    $errors->add($i18n->getKey('error.db'));
+    $err->add($i18n->getKey('error.db'));
 
-  if ($errors->no()) {
+  if ($err->no()) {
     $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
     $form->addInput(array('type'=>'submit','name'=>'btn_delete','value'=>$i18n->getKey('label.delete')));
     $form->addInput(array('type'=>'submit','name'=>'btn_cancel','value'=>$i18n->getKey('button.cancel')));