Added a capability to add attachment on project_add.php.
[timetracker.git] / time.php
index 7b6376c..f6c8475 100644 (file)
--- a/time.php
+++ b/time.php
@@ -395,7 +395,7 @@ if ($request->isPost()) {
       }
 
       // Put a new file in storage if we have it.
-      if ($showFiles && $_FILES['newfile']['name']) {
+      if ($id && $showFiles && $_FILES['newfile']['name']) {
         $fileHelper = new ttFileHelper($err);
         $fields = array('entity_type'=>'time',
           'entity_id' => $id,