Started to work on ttRegistrator class to encapsulate restration related tasks.
[timetracker.git] / cf_custom_field_edit.php
index 196d85f..295e407 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();
 }
@@ -45,7 +45,7 @@ $form = new Form('fieldForm');
 if ($err->no()) {
   $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'name','value'=>$field['label']));
   $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_id));
-  $form->addInput(array('type'=>'checkbox','name'=>'required','data'=>1,'value'=>$field['required']));
+  $form->addInput(array('type'=>'checkbox','name'=>'required','value'=>$field['required']));
   $form->addInput(array('type'=>'combobox','name'=>'type','value'=>$field['type'],
     'data'=>array(CustomFields::TYPE_TEXT=>$i18n->getKey('label.type_text'),
                   CustomFields::TYPE_DROPDOWN=>$i18n->getKey('label.type_dropdown'))));