X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=project_add.php;h=b7bef62a33996f76c49c68d14a26b8061096c722;hb=c46106d305d91e93fb63c0d601a5a006a02bb63a;hp=2bdb77bbc6b854868ee8e49df631996d2a1395b5;hpb=098a79f0819ebb89b7d48df4a6b154af4560f68e;p=timetracker.git diff --git a/project_add.php b/project_add.php index 2bdb77bb..b7bef62a 100644 --- a/project_add.php +++ b/project_add.php @@ -69,9 +69,9 @@ if ($request->getMethod() == 'POST') { // 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 ($errors->isEmpty()) { - if (!ttProjectHelper::getProjectByName($cl_name)) { + + if ($errors->no()) { + if (!ttProjectHelper::getProjectByName($cl_name)) { if (ttProjectHelper::insert(array( 'team_id' => $user->team_id, 'name' => $cl_name, @@ -86,11 +86,10 @@ if ($request->getMethod() == 'POST') { } else $errors->add($i18n->getKey('error.project_exists')); } -} // post +} // POST $smarty->assign('forms', array($form->getName()=>$form->toArray())); $smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"'); $smarty->assign('title', $i18n->getKey('title.add_project')); $smarty->assign('content_page_name', 'project_add.tpl'); $smarty->display('index.tpl'); -?> \ No newline at end of file