if ($request->getParameter('btn_save')) {
$existing_project = ttProjectHelper::getProjectByName($cl_name);
if (!$existing_project || ($cl_project_id == $existing_project['id'])) {
- // Update project information.
- if (ttProjectHelper::update(array(
- 'id' => $cl_project_id,
- 'name' => $cl_name,
- 'description' => $cl_description,
- 'status' => $cl_status,
- 'users' => $cl_users,
- 'tasks' => $cl_tasks))) {
- header('Location: projects.php');
- exit();
+ // Update project information.
+ if (ttProjectHelper::update(array(
+ 'id' => $cl_project_id,
+ 'name' => $cl_name,
+ 'description' => $cl_description,
+ 'status' => $cl_status,
+ 'users' => $cl_users,
+ 'tasks' => $cl_tasks))) {
+ header('Location: projects.php');
+ exit();
} else
- $err->add($i18n->get('error.db'));
+ $err->add($i18n->get('error.db'));
} else
$err->add($i18n->get('error.object_exists'));
}
} // isPost
$smarty->assign('forms', array($form->getName()=>$form->toArray()));
-$smarty->assign('onload', 'onLoad="document.projectForm.name.focus()"');
+$smarty->assign('onload', 'onLoad="document.projectForm.project_name.focus()"');
$smarty->assign('show_users', count($users) > 0);
$smarty->assign('show_tasks', $show_tasks);
$smarty->assign('title', $i18n->get('title.edit_project'));