$cl_name = trim($request->getParameter('project_name'));
$cl_description = trim($request->getParameter('description'));
$cl_status = $request->getParameter('status');
$cl_name = trim($request->getParameter('project_name'));
$cl_description = trim($request->getParameter('description'));
$cl_status = $request->getParameter('status');
$cl_name = $project['name'];
$cl_description = $project['description'];
$cl_status = $project['status'];
$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);
$mdb2 = getConnection();
$sql = "select user_id from tt_user_project_binds where status = 1 and project_id = $cl_project_id";
$res = $mdb2->query($sql);
$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'=>'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 (!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 (!ttValidString($cl_name)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->getKey('error.field'), $i18n->getKey('label.description'));
+
+ if ($err->no()) {
if ($request->getParameter('btn_save')) {
$existing_project = ttProjectHelper::getProjectByName($cl_name);
if (!$existing_project || ($cl_project_id == $existing_project['id'])) {
if ($request->getParameter('btn_save')) {
$existing_project = ttProjectHelper::getProjectByName($cl_name);
if (!$existing_project || ($cl_project_id == $existing_project['id'])) {
$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');
$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');