- 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 (ttProjectHelper::insert(array(
- 'team_id' => $user->team_id,
- 'name' => $cl_name,
+ if (!ttValidString($cl_name)) $err->add($i18n->get('error.field'), $i18n->get('label.thing_name'));
+ if (!ttValidString($cl_description, true)) $err->add($i18n->get('error.field'), $i18n->get('label.description'));
+ if (!ttGroupHelper::validateCheckboxGroupInput($cl_users, 'tt_users')) $err->add($i18n->get('error.field'), $i18n->get('label.users'));
+ if (!ttGroupHelper::validateCheckboxGroupInput($cl_tasks, 'tt_tasks')) $err->add($i18n->get('error.field'), $i18n->get('label.tasks'));
+
+ if ($err->no()) {
+ if (!ttProjectHelper::getProjectByName($cl_name)) {
+ $id = ttProjectHelper::insert(array('name' => $cl_name,