Added code to handle projects field in tt_clients on project deletion.
[timetracker.git] / WEB-INF / lib / ttProjectHelper.class.php
index 31a88cc..1bd363f 100644 (file)
@@ -28,6 +28,7 @@
 
 import('ttUserHelper');
 import('ttGroupHelper');
+import('ttClientHelper');
 
 // Class ttProjectHelper is used to help with project related tasks.
 class ttProjectHelper {
@@ -194,7 +195,9 @@ class ttProjectHelper {
     if (is_a($affected, 'PEAR_Error'))
       return false;
 
-    return true;
+    // Finally, delete the project from the projects field in tt_clients table.
+    $result = ttClientHelper::deleteProject($id);
+    return $result;
   }
   
   // insert function inserts a new project into database.