Wednesday, March 12, 2008

Notifications

Finally, the notification module is ready.

But to make it work completely you have to call the addNotification function everytime you want to send a notification.

Description about addNotification is as follows:

addNotification($userID,$projectID,$fileID,$type);

This function takes four arguments viz:$userID, $projectID, $fileID, $type

There are four cases when a notification will be send:

  1. upload :(When a new file is uploaded a notification will be send to all the members of that project) So, Once a file is uploaded, you need to call addNotification. Useage: addNotification($userID,$projectID,$fileID,"upload");

  2. join: (When a new user has joined a project a notification will be send to all the members of that project) So, Once the user is approved by the system administrator, you need to call addNotification. Useage:addNotification($userID,$projectID,0,"join");

  3. request: (When a user requests to join a project a notification will be send to the owner of the project) So, once a user submits the request to join the project, call addNotification. Useage:addNotification($userID,$projectID,0,"request");

  4. invite: (When a user is invited to join a project) So, once a user is invited by the owner of the project to join the project call addNotification($userID,$projectID,0,"invite");

Sunday, March 2, 2008

Exception Handling

Here is how you need to make exception handling on your pages.
Displaying error message
displayError("sorry there is an error in data");
result: sorry there is an error in data
Query errors
errorHandler("sorry error in query");

Eg: $conn->query($query) or errorHandler("error message");
result: error message
Display success message
displayMessage("success in uploading file");

result : success in uploading file