X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=project_edit.php;h=25bafcbbbbc50d2436ec39d1fba1c17ad3362bbb;hb=c46106d305d91e93fb63c0d601a5a006a02bb63a;hp=2726005c280f2c5a24477649c9f9356331d62a43;hpb=098a79f0819ebb89b7d48df4a6b154af4560f68e;p=timetracker.git diff --git a/project_edit.php b/project_edit.php index 2726005c..25bafcbb 100644 --- a/project_edit.php +++ b/project_edit.php @@ -58,7 +58,7 @@ if ($request->getMethod() == 'POST') { $cl_name = $project['name']; $cl_description = $project['description']; $cl_status = $project['status']; - + $mdb2 = getConnection(); $sql = "select user_id from tt_user_project_binds where status = 1 and project_id = $cl_project_id"; $res = $mdb2->query($sql); @@ -66,7 +66,7 @@ if ($request->getMethod() == 'POST') { die($res->getMessage()); while ($row = $res->fetchRow()) $cl_users[] = $row['user_id']; - + $cl_tasks = explode(',', $project['tasks']); } @@ -81,13 +81,13 @@ 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'))); - + 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 ($errors->no()) { if ($request->getParameter('btn_save')) { $existing_project = ttProjectHelper::getProjectByName($cl_name); if (!$existing_project || ($cl_project_id == $existing_project['id'])) { @@ -124,11 +124,10 @@ if ($request->getMethod() == 'POST') { $errors->add($i18n->getKey('error.project_exists')); } } -} // post +} // POST $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('content_page_name', 'project_edit.tpl'); $smarty->display('index.tpl'); -?> \ No newline at end of file