[Openfirst-cvscommit] projects groups.php,1.15,1.16 notes.php,1.15,1.16 projects.php,1.14,1.15 tasks
Brought to you by:
xtimg
From: <dav...@us...> - 2003-11-23 22:01:41
|
Update of /cvsroot/openfirst/projects In directory sc8-pr-cvs1:/tmp/cvs-serv29861 Modified Files: groups.php notes.php projects.php tasks.php Log Message: Added commit e-mail notification to each script. Index: groups.php =================================================================== RCS file: /cvsroot/openfirst/projects/groups.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** groups.php 1 Nov 2003 16:23:29 -0000 1.15 --- groups.php 23 Nov 2003 22:01:37 -0000 1.16 *************** *** 75,78 **** --- 75,102 ---- Dates = '".time()."'") or die(ofirst_dberror()); echo "<br><br>Group created! [ <a href='groups.php'>Groups</a> ]<br><br>"; + + // ---------------- SEND E-MAIL NOTICE OUT ---------------- + // Prepare e-mail headers without using the multipartmail function + $headers = "MIME-Version: 1.0\r\n"; + $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; + $headers .= "X-Priority: 1\r\n"; + $headers .= "X-MSMail-Priority: High\r\n"; + + // Prepare message for email + $message = "<b>$title</b> Action Register System<br>----------------------------------------------------<br> + <i>".$user->user."</i> has assigned you to a new group on the $title action system called <b>".$_POST['groupname']."</b>. + Here is the group description: <br><blockquote>".$_POST['description']."</blockquote><br><br> + <a href='$home/projects/groups.php'>Click here for more info</a>"; + + // Query members who have been added to this group + $assigned = explode(",",$mem); + foreach($assigned as $assign){ + $member_query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user = '$assign'"); + $member = ofirst_dbfetch_object($member_query); + mail($member->email,"$title Action Register: New Group",$message,$headers); + } + + // -------------------------------------------------------- + die(include_once($footer)); } Index: notes.php =================================================================== RCS file: /cvsroot/openfirst/projects/notes.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** notes.php 1 Nov 2003 21:42:41 -0000 1.15 --- notes.php 23 Nov 2003 22:01:38 -0000 1.16 *************** *** 62,65 **** --- 62,97 ---- echo "<br><br>Note created! [ <a href='notes.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."&TaskID=".$_GET['TaskID']."'>Notes</a> ]<br><br>"; + + // ---------------- SEND E-MAIL NOTICE OUT ---------------- + $query = ofirst_dbquery("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."' AND ID = '".$_GET['ProjectID']."'"); + $project = ofirst_dbfetch_object($query); + + $query = ofirst_dbquery("SELECT * FROM ofirst_projects_tasks WHERE GroupID = '".$_GET['GroupID']."' AND ProjectID = '".$_GET['ProjectID']."' AND ID = '".$_GET['TaskID']."'"); + $task = ofirst_dbfetch_object($query); + + // Prepare e-mail headers without using the multipartmail function + $headers = "MIME-Version: 1.0\r\n"; + $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; + $headers .= "X-Priority: 1\r\n"; + $headers .= "X-MSMail-Priority: High\r\n"; + + // Prepare message for email + $message = "<b>$title</b> Action Register System<br>----------------------------------------------------<br> + <i>".$user->user."</i> has created a new note on the $title action system + under the <b>".$task->TaskName."</b> task. The following is the information + commited:<br><blockquote>".$_POST['description']."</blackquote><br><br> + <a href='$home/projects/groups.php'>Click here for more info!</a>"; + + // Since these are projects relating to this group then only send to the required persons + $assigned = explode(",",$task->Assigned); + foreach($assigned as $assign){ + $member_query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user = '$assign'"); + $member = ofirst_dbfetch_object($member_query); + + mail($member->email,"$title Action Register: New Note",$message,$headers); + + } + // ------------------------------------------------------ + die(include_once($footer)); } *************** *** 77,81 **** ofirst_dbquery("UPDATE ofirst_projects_tasks SET Completion = '".$_POST['completion']."' WHERE ID = '".$_GET['TaskID']."'") or die(ofirst_dberror()); - echo "<br><br>Task completion changed to: ".$_POST['completion']."% [ <a href='notes.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."&TaskID=".$_GET['TaskID']."'>Current Notes</a> ]<br><br>"; die(include_once($footer)); --- 109,112 ---- Index: projects.php =================================================================== RCS file: /cvsroot/openfirst/projects/projects.php,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** projects.php 1 Nov 2003 16:23:29 -0000 1.14 --- projects.php 23 Nov 2003 22:01:38 -0000 1.15 *************** *** 63,67 **** TarDate = 'date', Dates = '".time()."'") or die(ofirst_dberror()); ! echo "<br><br>Project created! [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Projects</a> ]<br><br>"; die(include_once($footer)); } --- 63,98 ---- TarDate = 'date', Dates = '".time()."'") or die(ofirst_dberror()); ! ! echo "<br><br>Project created! [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Projects</a> ]<br><br>"; ! ! // ---------------- SEND E-MAIL NOTICE OUT ---------------- ! $query = ofirst_dbquery("SELECT * FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."' ORDER BY GroupName;"); ! $group = ofirst_dbfetch_object($query); ! ! // Prepare e-mail headers without using the multipartmail function ! $headers = "MIME-Version: 1.0\r\n"; ! $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; ! $headers .= "X-Priority: 1\r\n"; ! $headers .= "X-MSMail-Priority: High\r\n"; ! ! // Prepare message for email ! $message = "<b>$title</b> Action Register system<br>----------------------------------------------------<br> ! <i>".$user->user."</i> has assigned you to a new project on the $title action system called ! <b>".$_POST['projectname']."</b> within the <b>".$group->GroupName."</b> group. Here is the project ! description:<br><blockquote>".$_POST['description']."</blockquote><br><br> ! <a href='$home/projects/groups.php'>Click here for more info</a>"; ! ! // Since these are projects relating to this group then only send to the required persons ! $assigned = explode(",",$group->Members); ! foreach($assigned as $assign){ ! ! $member_query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user = '$assign'"); ! $member = ofirst_dbfetch_object($member_query); ! ! mail($member->email,"$title Action Register: New Project",$message,$headers); ! ! } ! // -------------------------------------------------------- ! die(include_once($footer)); } Index: tasks.php =================================================================== RCS file: /cvsroot/openfirst/projects/tasks.php,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** tasks.php 1 Nov 2003 16:23:29 -0000 1.15 --- tasks.php 23 Nov 2003 22:01:38 -0000 1.16 *************** *** 66,70 **** --- 66,103 ---- TarDate = '".$strdate."', Dates = '".time()."'") or die(ofirst_dberror()); + + // ---------------- SEND E-MAIL NOTICE OUT ---------------- + // Gather information to show the following tasks + $query = ofirst_dbquery("SELECT * FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."'"); + $group = ofirst_dbfetch_object($query); + + $query = ofirst_dbquery("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."' AND ID = '".$_GET['ProjectID']."' ORDER BY ProjectName;"); + $project = ofirst_dbfetch_object($query); + + // Prepare e-mail headers without using the multipartmail function + $headers = "MIME-Version: 1.0\r\n"; + $headers .= "Content-type: text/html; charset=iso-8859-1\r\n"; + $headers .= "X-Priority: 1\r\n"; + $headers .= "X-MSMail-Priority: High\r\n"; + // Prepare message for email + $message = "<b>$title</b> Action Register system<br>----------------------------------------------------<br> + <i>".$user->user."</i> has assigned you to a new task on the $title action system called + <b>".$_POST['taskname']."</b> under the <b>".$project->ProjectName."</b> project. Here is a + description:<br><blockquote>".$_POST['description']."</blockquote><br><br> + <a href='$home/projects/groups.php'>Click here for more info!</a>"; + + // Since these are projects relating to this group then only send to the required persons + $assigned = explode(",",$assign); + foreach($assigned as $assis){ + + $member_query = ofirst_dbquery("SELECT * FROM ofirst_members WHERE user = '$assis'"); + $member = ofirst_dbfetch_object($member_query); + + mail($member->email,"$title Action Register: New Task",$message,$headers); + + } + // ------------------------------------------------------- + echo "<br><br>Task created! [ <a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."'>Tasks</a> ]<br><br>"; die(include_once($footer)); *************** *** 78,82 **** echo "<br><br>Project completion changed to: ".$_POST['completion']."% [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Projects</a> ]<br><br>"; ! die(include_once($footer)); } --- 111,115 ---- echo "<br><br>Project completion changed to: ".$_POST['completion']."% [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Projects</a> ]<br><br>"; ! die(include_once($footer)); } |