DotProject - Details
 
This mod was developed by Christian Kien (c.kien@eif.org) for the EIF (www.eif.org) in cooperation with Jos Grincho (j.grincho@eif.org).
 
Details was made to have some additional information on projects. In detail, we've added Business Project Manager, Business Case,											
Constraints and Success factors, Milestones, Governance, Team, Budget, AAP, AAPUrl, a Creation Date and a Last Update Date.

As we need an update on the new table detail_project, which is in a 1 to 1 relation onto the project's table itself, we need to put 
3 lines (8 with comments) into the original dotProjects do_project_aed.php file (in projects folder), to achieve a storage of the 
date on each update, even if only the "normal" projects fields are altered. This is only optional.

Edit ".../dotproject/modules/projects/do_project_aed.php" as follows:

After Line 37 change the original
******************************************************************************************
				if (($msg = $obj->delete())) {
					$AppUI->setMsg( $msg, UI_MSG_ERROR );
					$AppUI->redirect();
				} else {

					$AppUI->setMsg( "Project deleted", UI_MSG_ALERT);
					$AppUI->redirect( "m=projects" );
				}
			} 
******************************************************************************************
To
******************************************************************************************
				if (($msg = $obj->delete())) {
					$AppUI->setMsg( $msg, UI_MSG_ERROR );
					$AppUI->redirect();
				} else {

					// Mod by cK for the "new" details module -
					// deleteing a project will delete the details, also
						if (db_loadResult('SELECT detail_id FROM details WHERE detail_project='.$obj->project_id)) db_loadResult('DELETE FROM details WHERE detail_project='.$obj->project_id);

					$AppUI->setMsg( "Project deleted", UI_MSG_ALERT);
					$AppUI->redirect( "m=projects" );
				}
			}
******************************************************************************************
And After Line 72 (at the very end) :
	After
******************************************************************************************
				$custom_fields = New CustomFields( $m, 'addedit', $obj->project_id, "edit" );
		 		$custom_fields->bind( $_POST );
		 		$sql = $custom_fields->store( $obj->project_id ); // Store Custom Fields
			}
			$AppUI->redirect();
		}
		?>
******************************************************************************************
	Insert (into the else statement)
******************************************************************************************
				$custom_fields = New CustomFields( $m, 'addedit', $obj->project_id, "edit" );
		 		$custom_fields->bind( $_POST );
		 		$sql = $custom_fields->store( $obj->project_id ); // Store Custom Fields
				
				//Mod by cK for the "new" details module -
				// Each time a project is updated (or created) update the dates in detail mod:
					// If we want to insert a new project --> insert a new detail with the actual date as creation date, otherwise simply update the id with itself to have a new "ON UPDATE current_time_stamp"
					if (!db_loadResult('SELECT detail_id FROM details WHERE detail_project='.$obj->project_id)) db_loadResult('INSERT INTO details (detail_id,detail_project,detail_cdate) VALUES ("",'.$obj->project_id.','.date(Ymd).')');
					$result=db_loadResult('UPDATE details SET detail_project='.$obj->project_id.' WHERE detail_project='.$obj->project_id);  // On update current timestamp will update the current "Last modified" date
			}
			$AppUI->redirect();
		}
		?>
******************************************************************************************

It does NOT touch the existing dotProject or modules in any way, so there is NO danger of loosing any data!
If you uninstall the details-mod, it will drop the table "details" with the stored information.

NOTE: When you uninstall the mod, PLEASE ENSURE TO REMOVE THE MODIFICATION FROM do_project_aed.php OF projects AS DESCRIBED ABOVE.

After installation, the information can be entered/updated through the link "Details" or through a tab in project view.
 
Installation:
As all the other modules for DotProject. Unzip the file to ".../dotProject/modules/details", 
head to the "System Admin" view of DotProject and click install, disable (to enable) and, last but not least, 
change its status from hidden to visible. That's all.