X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=project_edit.php;h=be0e90fa93efc1407a6a2b42badd8c13e6800c5f;hb=dd3a0ade5b3c342fb4352b00dac4f654409fd3e5;hp=cb62d205ee354432d749e6b0520fb520926edf01;hpb=a7ba11adfecf6cb906749efe5abce688363aef07;p=timetracker.git diff --git a/project_edit.php b/project_edit.php index cb62d205..be0e90fa 100644 --- a/project_edit.php +++ b/project_edit.php @@ -32,7 +32,7 @@ import('ttProjectHelper'); import('ttTeamHelper'); // Access check. -if (!ttAccessCheck(right_manage_team)) { +if (!ttAccessAllowed('manage_projects') || (MODE_PROJECTS != $user->tracking_mode && MODE_PROJECTS_AND_TASKS != $user->tracking_mode)) { header('Location: access_denied.php'); exit(); } @@ -75,19 +75,19 @@ $form->addInput(array('type'=>'hidden','name'=>'id','value'=>$cl_project_id)); $form->addInput(array('type'=>'text','maxlength'=>'100','name'=>'project_name','style'=>'width: 250px;','value'=>$cl_name)); $form->addInput(array('type'=>'textarea','name'=>'description','style'=>'width: 250px; height: 40px;','value'=>$cl_description)); $form->addInput(array('type'=>'combobox','name'=>'status','value'=>$cl_status, - 'data'=>array(ACTIVE=>$i18n->getKey('dropdown.status_active'),INACTIVE=>$i18n->getKey('dropdown.status_inactive')))); + 'data'=>array(ACTIVE=>$i18n->get('dropdown.status_active'),INACTIVE=>$i18n->get('dropdown.status_inactive')))); $form->addInput(array('type'=>'checkboxgroup','name'=>'users','data'=>$all_users,'layout'=>'H','value'=>$cl_users)); if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode) $form->addInput(array('type'=>'checkboxgroup','name'=>'tasks','data'=>$all_tasks,'layout'=>'H','value'=>$cl_tasks)); -$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->getKey('button.save'))); -$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->getKey('button.copy'))); +$form->addInput(array('type'=>'submit','name'=>'btn_save','value'=>$i18n->get('button.save'))); +$form->addInput(array('type'=>'submit','name'=>'btn_copy','value'=>$i18n->get('button.copy'))); if ($request->isPost()) { // Validate user input. - if (!ttValidString($cl_name)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name')); - if (!ttValidString($cl_description, true)) $errors->add($i18n->getKey('error.field'), $i18n->getKey('label.description')); + if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name')); + if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description')); - if ($errors->no()) { + if ($err->no()) { if ($request->getParameter('btn_save')) { $existing_project = ttProjectHelper::getProjectByName($cl_name); if (!$existing_project || ($cl_project_id == $existing_project['id'])) { @@ -102,9 +102,9 @@ if ($request->isPost()) { header('Location: projects.php'); exit(); } else - $errors->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } else - $errors->add($i18n->getKey('error.project_exists')); + $err->add($i18n->get('error.project_exists')); } if ($request->getParameter('btn_copy')) { @@ -119,15 +119,15 @@ if ($request->isPost()) { header('Location: projects.php'); exit(); } else - $errors->add($i18n->getKey('error.db')); + $err->add($i18n->get('error.db')); } else - $errors->add($i18n->getKey('error.project_exists')); + $err->add($i18n->get('error.project_exists')); } } -} // POST +} // isPost $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.projectForm.name.focus()"'); -$smarty->assign('title', $i18n->getKey('title.edit_project')); +$smarty->assign('title', $i18n->get('title.edit_project')); $smarty->assign('content_page_name', 'project_edit.tpl'); $smarty->display('index.tpl');