posaune
[timetracker.git] / project_edit.php
index 1402eb1..e1792e4 100644 (file)
@@ -94,18 +94,18 @@ if ($request->isPost()) {
     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'));
     }
@@ -128,7 +128,7 @@ if ($request->isPost()) {
 } // 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'));