- 'status' => ACTIVE))) {
- header('Location: projects.php');
- exit();
- } else
- $errors->add($i18n->getKey('error.db'));
+ 'status' => ACTIVE));
+
+ // Put a new file in storage if we have it.
+ if ($id && $showFiles && $_FILES['newfile']['name']) {
+ $fileHelper = new ttFileHelper($err);
+ $fields = array('entity_type'=>'project',
+ 'entity_id' => $id,
+ 'file_name' => $_FILES['newfile']['name']);
+ $fileHelper->putFile($fields);
+ }
+ if ($id) {
+ header('Location: projects.php');
+ exit();
+ } else
+ $err->add($i18n->get('error.db'));