[Openfirst-cvscommit] projects groups.php,1.4,1.5 index.php,1.5,1.6 meetings.php,1.1,1.2 mytask.php,
Brought to you by:
xtimg
Update of /cvsroot/openfirst/projects In directory sc8-pr-cvs1:/tmp/cvs-serv4859 Modified Files: groups.php index.php meetings.php mytask.php notes.php preferences.php projects.php tasks.php today.php viewmeeting.php Log Message: Minor audit commits. Some bugs/suggestions from Tim have also been changed. Index: groups.php =================================================================== RCS file: /cvsroot/openfirst/projects/groups.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** groups.php 27 Aug 2003 12:58:06 -0000 1.4 --- groups.php 29 Aug 2003 15:50:35 -0000 1.5 *************** *** 27,36 **** --- 27,45 ---- */ + // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); + + // Check if user is a member + if(! ISSET($user->user)){ + showLogin(); + }else{ + + // Create button process if(ISSET($_POST['create'])){ + // Check if any assigned members have been added if(! ISSET($_POST['members'])){ echo "<br><br>You must assign users to this task! Click back to continue.<br><br><br>"; *************** *** 38,41 **** --- 47,51 ---- } + // Check if any assigned moderators have been added if(! ISSET($_POST['moderators'])){ echo "<br><br>You must assign users to this task! Click back to continue.<br><br><br>"; *************** *** 43,58 **** } ! if(is_array($_POST['moderators'])){ ! $modera = implode(",",$_POST['moderators']); ! }else{ ! $modera = $_POST['moderators']; ! } ! if(is_array($_POST['members'])){ ! $mem = implode(",",$_POST['members']); ! }else{ ! $mem = $_POST['members']; ! } mysql_query("INSERT INTO ofirst_projects_groups SET GroupName = '".$_POST['groupname']."', --- 53,71 ---- } ! // Check if the value has come as a single value or array then use appropriate value in modera variable ! if(is_array($_POST['moderators'])){ ! $modera = implode(",",$_POST['moderators']); ! }else{ ! $modera = $_POST['moderators']; ! } ! // Check if the value has come as a single value or array then use appropriate value in mem variable ! if(is_array($_POST['members'])){ ! $mem = implode(",",$_POST['members']); ! }else{ ! $mem = $_POST['members']; ! } + // Insert data into the database mysql_query("INSERT INTO ofirst_projects_groups SET GroupName = '".$_POST['groupname']."', *************** *** 65,70 **** --- 78,85 ---- } + // Remove button process if(ISSET($_POST['remove'])){ + // If the confirmation button is selected then remove all group data if(! ISSET($_POST['confirm'])){ echo "<br><br>Your request to remove the group was denied because you have not confirmed! [ <a href='groups.php'>Groups</a> ]<br><br>"; *************** *** 72,75 **** --- 87,91 ---- } + // Remove data from every table that is related mysql_query("DELETE FROM ofirst_projects_groups WHERE ID = '".$_POST['group']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_notes WHERE GroupID = '".$_POST['group']."'") or die(mysql_error()); *************** *** 107,113 **** </tr> <?php - $query = mysql_query("SELECT * FROM ofirst_projects_groups"); - while($groups = mysql_fetch_object($query)){ ?> <tr <?php if(date("F j, Y",time()) == date("F j, Y",$groups->Dates)){ echo "bgColor='#CCCCCC'"; } ?> onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> --- 123,131 ---- </tr> <?php + + // Query the current group values and loop through them + $query = mysql_query("SELECT * FROM ofirst_projects_groups"); + while($groups = mysql_fetch_object($query)){ ?> <tr <?php if(date("F j, Y",time()) == date("F j, Y",$groups->Dates)){ echo "bgColor='#CCCCCC'"; } ?> onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#ffffff"> *************** *** 135,141 **** </table> <br> - <?php - if(ISSET($user->user)){ - ?> <form action='groups.php' method='POST'> <table width="39%"> --- 153,156 ---- Index: index.php =================================================================== RCS file: /cvsroot/openfirst/projects/index.php,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** index.php 27 Aug 2003 12:58:07 -0000 1.5 --- index.php 29 Aug 2003 15:50:35 -0000 1.6 *************** *** 26,30 **** * */ ! ! header("Location:groups.php"); ?> --- 26,47 ---- * */ ! ! // Include globals and set header condense (not coded yet) ! include("../config/globals.php"); ! $header_condense = true; ! include($header); ! ! if(! ISSET($user->user)){ ! ?> ! <p> </p> ! <p>Welcome to the projects module! Only team members are able to access the projects ! module.<br> ! Please use the login form below this:</p> ! <?php ! showLogin(); ! }else{ ! echo "<p> </p><p>Welcome ".$user->user.", thank you for loggin in!<br><br>"; ! } ! include($footer); ! ?> Index: meetings.php =================================================================== RCS file: /cvsroot/openfirst/projects/meetings.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** meetings.php 27 Aug 2003 12:58:07 -0000 1.1 --- meetings.php 29 Aug 2003 15:50:35 -0000 1.2 *************** *** 26,41 **** * */ ! include("../config/globals.php"); $header_condense = true; include($header); ! if(ISSET($_POST['create'])){ ! if(! ISSET($_POST['assign'])){ ! echo "<br><br>You must assign an arranged for field to this meeting! Click back to continue.<br><br><br>"; ! die(include($footer)); ! } if(is_array($_POST['assign'])){ $assign = implode(",",$_POST['assign']); --- 26,50 ---- * */ ! ! // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); ! // Check if user is a member ! if(! ISSET($user->user)){ ! showLogin(); ! }else{ ! // Create button process ! if(ISSET($_POST['create'])){ + // Check if members have been assigned to the meeting + if(! ISSET($_POST['assign'])){ + echo "<br><br>You must assign an arranged for field to this meeting! Click back to continue.<br><br><br>"; + die(include($footer)); + } + + // Check if assign is a single value or array then give variable a value if(is_array($_POST['assign'])){ $assign = implode(",",$_POST['assign']); *************** *** 43,49 **** $assign = $_POST['assign']; } ! $fordate = strtotime($_POST['month']." ".$_POST['day'].",".$_POST['year']." ".$_POST['hour'].":".$_POST['minute']." ".$_POST['ampm']); mysql_query("INSERT INTO ofirst_projects_meetings SET ForDate = '".$fordate."', --- 52,60 ---- $assign = $_POST['assign']; } ! ! // Collect date and combine it $fordate = strtotime($_POST['month']." ".$_POST['day'].",".$_POST['year']." ".$_POST['hour'].":".$_POST['minute']." ".$_POST['ampm']); + // Put value into database mysql_query("INSERT INTO ofirst_projects_meetings SET ForDate = '".$fordate."', *************** *** 57,67 **** } if(ISSET($_POST['remove'])){ if(! ISSET($_POST['confirm'])){ echo "<br><br>Your request to remove the project was denied because you have not confirmed! [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Projects</a> ]<br><br>"; die(include($footer)); } ! mysql_query("DELETE FROM ofirst_projects_meetings WHERE ID = '".$_POST['project']."'") or die(mysql_error()); echo "<br><br>Meetings removed! [ <a href='meetings.php'>Meetings</a> ]<br><br>"; --- 68,81 ---- } + // Remove button process if(ISSET($_POST['remove'])){ + // If remove process is confirmed if(! ISSET($_POST['confirm'])){ echo "<br><br>Your request to remove the project was denied because you have not confirmed! [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Projects</a> ]<br><br>"; die(include($footer)); } ! ! // Remove meeting information mysql_query("DELETE FROM ofirst_projects_meetings WHERE ID = '".$_POST['project']."'") or die(mysql_error()); echo "<br><br>Meetings removed! [ <a href='meetings.php'>Meetings</a> ]<br><br>"; *************** *** 85,90 **** --- 99,107 ---- </tr> <?php + + // Check for meetings that have not passed yet $meetquery = mysql_query("SELECT * FROM ofirst_projects_meetings WHERE Status='wait'"); while($meeting = mysql_fetch_object($meetquery)){ + ?> <tr> *************** *** 100,103 **** --- 117,121 ---- echo "<br>".$group->GroupName; } + ?> </td> *************** *** 105,111 **** --- 123,132 ---- <?php } + + // If there are no values then output a no value message if(mysql_num_rows($meetquery) == 0){ echo "<tr><td> </td><td> </td><td>There are no planned meetings!</td><td> </td></tr>"; } + ?> </table> *************** *** 123,128 **** --- 144,152 ---- </tr> <?php + + // Check for passed meetings and preview them $query = mysql_query("SELECT * FROM ofirst_projects_meetings WHERE Status='done'"); while($meeting = mysql_fetch_object($query)){ + ?> <tr> *************** *** 138,141 **** --- 162,166 ---- echo $group->GroupName; } + ?> </td> *************** *** 143,149 **** --- 168,177 ---- <?php } + + // If there are no values then output a message if(mysql_num_rows($query) == 0){ echo "<tr><td> </td><td> </td><td>There are no past meetings!</td><td> </td></tr>"; } + ?> </table> *************** *** 159,163 **** <div align="right">Description:</div></td> <td> ! <?php if (function_exists("make_wysiwyg")) { make_wysiwyg("description",500,255,""); --- 187,193 ---- <div align="right">Description:</div></td> <td> ! <?php ! ! // If the WYSIWYG function is set then use the WYSIWYG module if (function_exists("make_wysiwyg")) { make_wysiwyg("description",500,255,""); *************** *** 165,168 **** --- 195,199 ---- echo "<textarea name='description'></textarea>"; } + ?> </td> *************** *** 246,253 **** --- 277,287 ---- <select name="assign[]" width='40' size="6" multiple id="assign"> <?php + + // Output a list of current groups $query = mysql_query("SELECT * FROM ofirst_projects_groups"); while($group = mysql_fetch_object($query)){ echo "<option value='".$group->ID."'>".$group->GroupName."</option>"; } + ?> </select> *************** *** 266,273 **** <td><div align="right">Meeting Date:</div></td> <td><select name="project" id="project"> ! <?php $query = mysql_query("SELECT * FROM ofirst_projects_meetings"); - while($meeting = mysql_fetch_object($query)){ echo "<option value='".$meeting->ID."'>".date("F j, Y h:i a",$meeting->ForDate)."</option>"; --- 300,307 ---- <td><div align="right">Meeting Date:</div></td> <td><select name="project" id="project"> ! <?php + // Output a list of meetings by date $query = mysql_query("SELECT * FROM ofirst_projects_meetings"); while($meeting = mysql_fetch_object($query)){ echo "<option value='".$meeting->ID."'>".date("F j, Y h:i a",$meeting->ForDate)."</option>"; *************** *** 290,292 **** </table> <br> ! <?php include($footer); ?> --- 324,330 ---- </table> <br> ! <?php ! ! } ! include($footer); ! ?> \ No newline at end of file Index: mytask.php =================================================================== RCS file: /cvsroot/openfirst/projects/mytask.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** mytask.php 27 Aug 2003 12:58:07 -0000 1.1 --- mytask.php 29 Aug 2003 15:50:35 -0000 1.2 *************** *** 27,33 **** --- 27,40 ---- */ + // // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); + + // Check if user is a member + if(! ISSET($user->user)){ + showLogin(); + }else{ + ?> <h2>My Tasks Summarized</h2> *************** *** 50,55 **** <?php ! ! $query = mysql_query("SELECT * FROM ofirst_projects_tasks"); while($tasks = mysql_fetch_object($query)){ --- 57,61 ---- <?php ! // Run through the current tasks $query = mysql_query("SELECT * FROM ofirst_projects_tasks"); while($tasks = mysql_fetch_object($query)){ *************** *** 65,69 **** if($showtask){ ! if($tasks->Pend == "none"){ $pend = false; --- 71,76 ---- if($showtask){ ! ! // If value is pending then select the proper information if($tasks->Pend == "none"){ $pend = false; *************** *** 84,87 **** --- 91,96 ---- <td><a href="notes.php?GroupID=<?php echo $_GET['GroupID']; ?>&TaskID=<?php echo $tasks->ID; ?>&ProjectID=<?php echo $_GET['ProjectID']; ?>"> <?php + + // If value is pending then show pend graphics if($pend){ echo "<img src='../members/icons/actions/encrypted.png' border='0'>"; *************** *** 89,92 **** --- 98,102 ---- echo "<a href='notes.php?GroupID=".$tasks->GroupID."&TaskID=".$tasks->ID."&ProjectID=".$tasks->ProjectID."'><img src='../members/icons/filesystems/desktop.png' border='0'></a>"; } + ?> </a></td> *************** *** 120,122 **** </table> <br> ! <?php include($footer); ?> --- 130,136 ---- </table> <br> ! <?php ! ! } ! include($footer); ! ?> \ No newline at end of file Index: notes.php =================================================================== RCS file: /cvsroot/openfirst/projects/notes.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** notes.php 27 Aug 2003 12:58:07 -0000 1.4 --- notes.php 29 Aug 2003 15:50:35 -0000 1.5 *************** *** 27,34 **** --- 27,39 ---- */ + // include("../config/globals.php"); $header_condense = true; include($header); + // If the user is logged in + if(ISSET($user->user)){ + + // Create button process if(ISSET($_POST['create'])){ mysql_query("INSERT INTO ofirst_projects_notes SET *************** *** 44,47 **** --- 49,53 ---- } + // Addcompletion button process if(ISSET($_POST['addcompletion'])){ mysql_query("INSERT INTO ofirst_projects_notes SET *************** *** 59,62 **** --- 65,69 ---- } + // Get information related to these notes $query = mysql_query("SELECT * FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."'"); $group = mysql_fetch_object($query); *************** *** 91,96 **** <td width="15%">Commiter</td> </tr> ! <?php $query = mysql_query("SELECT * FROM ofirst_projects_notes WHERE GroupID = '".$_GET['GroupID']."' AND ProjectID = '".$_GET['ProjectID']."' AND TaskID = '".$_GET['TaskID']."'"); while($notes = mysql_fetch_object($query)){ --- 98,104 ---- <td width="15%">Commiter</td> </tr> ! <?php + // List the notes $query = mysql_query("SELECT * FROM ofirst_projects_notes WHERE GroupID = '".$_GET['GroupID']."' AND ProjectID = '".$_GET['ProjectID']."' AND TaskID = '".$_GET['TaskID']."'"); while($notes = mysql_fetch_object($query)){ *************** *** 107,110 **** --- 115,119 ---- } + // If no notes are present then display message if(mysql_num_rows($query) == 0){ echo "\n <tr>\n <td> </td>\n <td> </td>\n <td>There are no notes for this task!</td>\n <td> </td>\n </tr>\n"; *************** *** 113,117 **** </table> <?php ! if(ISSET($user->user)){ $allowed = explode(",",$task->Assigned); $show = false; --- 122,127 ---- </table> <?php ! ! // If current user is a member of this task then allow him to add/edit a note $allowed = explode(",",$task->Assigned); $show = false; *************** *** 134,138 **** <td valign="top"> <div align="right">Description: </div></td> <td> ! <?php if (function_exists("make_wysiwyg")) { make_wysiwyg("description",500,255,""); --- 144,150 ---- <td valign="top"> <div align="right">Description: </div></td> <td> ! <?php ! ! // If the WYSIWYG function is set then display the WYSIWYG box if (function_exists("make_wysiwyg")) { make_wysiwyg("description",500,255,""); *************** *** 140,143 **** --- 152,156 ---- echo "<textarea name='description'></textarea>"; } + ?> </td> *************** *** 188,194 **** </table> </form> ! <?php } } ?> ! <br> ! <br> ! <?php include($footer); ?> ! <p> </p> \ No newline at end of file --- 201,208 ---- </table> </form> ! <?php ! ! } ! } ! include($footer); ! ?> \ No newline at end of file Index: preferences.php =================================================================== RCS file: /cvsroot/openfirst/projects/preferences.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** preferences.php 27 Aug 2003 12:58:07 -0000 1.4 --- preferences.php 29 Aug 2003 15:50:35 -0000 1.5 *************** *** 27,34 **** --- 27,41 ---- */ + // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); + // Check if user is a member + if(! ISSET($user->user)){ + showLogin(); + }else{ + + // Save button process if(ISSET($_POST['save'])){ mysql_query("UPDATE ofirst_members SET *************** *** 39,48 **** die(include($footer)); } ?> <h2><font face="Verdana, Arial, Helvetica, sans-serif">Preferences</font><br> </h2> <form action='preferences.php' method='POST'> ! <table width="470" align="center"> ! <tr> <th>Update Mailer</th> </tr> --- 46,56 ---- die(include($footer)); } + ?> <h2><font face="Verdana, Arial, Helvetica, sans-serif">Preferences</font><br> </h2> <form action='preferences.php' method='POST'> ! <table width="527" align="center"> ! <tr> <th>Update Mailer</th> </tr> *************** *** 60,89 **** </select> </font></p> ! <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">What ! data would you like to be updated on? ! <select name="select" id="select"> ! <option selected><?php echo $user->ProjectsCommitSelect; ?></option> ! <option>-----</option> ! <option>Related</option> ! <option>All</option> ! </select> </font></p> ! <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">When ! would you like them to be sent? ! <select name="template" id="template"> ! <option selected><?php echo $user->ProjectsSendTemplate; ?></option> ! <option>-----</option> ! <option value="Basic" >Basic Updates</option> ! <option value="Detailed">Detailed Updates</option> ! </select> </font></p> ! <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> ! <input name="save" type="submit" id="save" value="Save Preferences"> ! <br> ! </font></p></td> </tr> </table> </form> ! <p> ! <?php include($footer); ?> ! </p> --- 68,100 ---- </select> </font></p> ! <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">What ! kind of updates would you like to be sent? ! <select name="template" id="template"> ! <option selected><?php echo $user->ProjectsSendTemplate; ?></option> ! <option>-----</option> ! <option value="Basic" >Basic Updates</option> ! <option value="Detailed">Detailed Updates</option> ! </select> </font></p> ! <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">What ! kind of updates would you like to be sent? ! <select name="select" id="select"> ! <option selected><?php echo $user->ProjectsCommitSelect; ?></option> ! <option>-----</option> ! <option>Related</option> ! <option>All</option> ! </select> </font></p> ! <p align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"> ! <input name="save" type="submit" id="save" value="Save Preferences"> ! <br> ! </font></p></td> </tr> </table> </form> ! <?php ! ! } ! include($footer); ! ! ?> \ No newline at end of file Index: projects.php =================================================================== RCS file: /cvsroot/openfirst/projects/projects.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** projects.php 27 Aug 2003 12:58:07 -0000 1.4 --- projects.php 29 Aug 2003 15:50:35 -0000 1.5 *************** *** 27,36 **** --- 27,44 ---- */ + // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); + // Check if user is a member + if(! ISSET($user->user)){ + showLogin(); + }else{ + + // Create project button process if(ISSET($_POST['create'])){ + // Check if members are assigned if(! ISSET($_POST['assign'])){ echo "<br><br>You must assign users to this task! Click back to continue.<br><br><br>"; *************** *** 38,41 **** --- 46,50 ---- } + // Check if value is single or array then give it a value for the database insert if(is_array($_POST['assign'])){ $assign = implode(",",$_POST['assign']); *************** *** 44,47 **** --- 53,57 ---- } + // Create database record mysql_query("INSERT INTO ofirst_projects_projects SET ProjectName = '".$_POST['projectname']."', *************** *** 58,62 **** ! if(ISSET($_POST['remove'])){ --- 68,72 ---- ! // Remove button process if(ISSET($_POST['remove'])){ *************** *** 66,69 **** --- 76,80 ---- } + // Remove all values related to this project mysql_query("DELETE FROM ofirst_projects_projects WHERE ID = '".$_POST['project']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_notes WHERE ProjectID = '".$_POST['project']."'") or die(mysql_error()); *************** *** 74,77 **** --- 85,89 ---- } + // Collect information about projects $query = mysql_query("SELECT * FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."'"); $group = mysql_fetch_object($query); *************** *** 101,111 **** --- 113,126 ---- <?php + // List current projects in database $query = mysql_query("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."'"); while($projects = mysql_fetch_object($query)){ + // If record is not pending then set pend value false if($projects->Pend == "none"){ $pend = false; }else{ + // If pend value of the pend project is 100 then set as false or else pend is true $projquery = mysql_query("SELECT * FROM ofirst_projects_projects WHERE ID = '".$projects->Pend."'"); $pendproj = mysql_fetch_object($projquery); *************** *** 123,132 **** --- 138,151 ---- <?php + // If project completion is 100 then display completion graphic if($projects->Completion == "100"){ echo "<a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$projects->ID."'><img src='../members/icons/actions/button_ok.png' border='0'></a>"; + + // If project is closed then display closed graphic }elseif($projects->Completion == "CLOSE"){ echo "<a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$projects->ID."'><img src='../members/icons/actions/button_cancel.png' border='0'></a>"; }else{ + // Decide on graphic depending on the value of pend if($pend){ echo "<img src='../members/icons/actions/encrypted.png' border='0'>"; *************** *** 134,139 **** echo "<a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$projects->ID."'><img src='../members/icons/actions/project_open.png' border='0'></a>"; } ! } ! ?> </td> <td> --- 153,159 ---- echo "<a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$projects->ID."'><img src='../members/icons/actions/project_open.png' border='0'></a>"; } ! } ! ! ?> </td> <td> *************** *** 155,158 **** --- 175,179 ---- } + // Display no record response if(mysql_num_rows($query) == 0){ echo "\n <tr>\n <td> </td>\n <td> </td>\n <td> </td>\n <td>No new projects!</td>\n <td> </td>\n </tr>"; *************** *** 163,167 **** <br> <?php ! if(ISSET($user->user)){ $allowed = explode(",",$group->Members); $show = false; --- 184,189 ---- <br> <?php ! ! // Check if the current use is apart of this particular group then allow him to add/edit the project $allowed = explode(",",$group->Members); $show = false; *************** *** 192,196 **** <td><select name="pend" id="pend"> <option selected>none</option> ! <?php $query = mysql_query("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."'"); --- 214,218 ---- <td><select name="pend" id="pend"> <option selected>none</option> ! <?php $query = mysql_query("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."'"); *************** *** 268,277 **** <td><div align="right">Assign:</div></td> <td><p> ! <select name="assign[]" width='40' size="6" multiple id="assign"> ! <?php $assigned = explode(",",$group->Members); foreach($assigned as $assign){ echo "<option>".$assign."</option>"; } ?> </select> --- 290,302 ---- <td><div align="right">Assign:</div></td> <td><p> ! <select name="assign[]" width='40' size="6" multiple id="assign"> ! <?php ! ! // Explode members and display the names $assigned = explode(",",$group->Members); foreach($assigned as $assign){ echo "<option>".$assign."</option>"; } + ?> </select> *************** *** 293,300 **** <td><div align="right">Project Name:</div></td> <td><select name="project" id="project"> ! <?php $query = mysql_query("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."'"); - while($projects = mysql_fetch_object($query)){ echo "<option value='".$projects->ID."'>".$projects->ProjectName."</option>"; --- 318,325 ---- <td><div align="right">Project Name:</div></td> <td><select name="project" id="project"> ! <?php + // Display current member list from the assigned values $query = mysql_query("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$_GET['GroupID']."'"); while($projects = mysql_fetch_object($query)){ echo "<option value='".$projects->ID."'>".$projects->ProjectName."</option>"; *************** *** 317,322 **** </table> </form> ! <?php } } ?> ! <p> ! <?php include($footer); ?> ! </p> --- 342,351 ---- </table> </form> ! <?php ! ! } ! } ! ! include($footer); ! ! ?> Index: tasks.php =================================================================== RCS file: /cvsroot/openfirst/projects/tasks.php,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** tasks.php 27 Aug 2003 12:58:07 -0000 1.4 --- tasks.php 29 Aug 2003 15:50:35 -0000 1.5 *************** *** 27,41 **** */ include("../config/globals.php"); $header_condense = true; include($header); if(ISSET($_POST['create'])){ ! if(! ISSET($_POST['assign'])){ ! echo "<br><br>You must assign users to this project! Click back to continue.<br><br><br>"; ! die(include($footer)); ! } if(is_array($_POST['assign'])){ $assign = implode(",",$_POST['assign']); --- 27,48 ---- */ + // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); + // If the user is logged in + if(ISSET($user->user)){ + + // Create button process if(ISSET($_POST['create'])){ ! // Check if users have been assigned to the task ! if(! ISSET($_POST['assign'])){ ! echo "<br><br>You must assign users to this project! Click back to continue.<br><br><br>"; ! die(include($footer)); ! } + // Check if value is single or array then give assign a value for the database insert if(is_array($_POST['assign'])){ $assign = implode(",",$_POST['assign']); *************** *** 44,50 **** --- 51,59 ---- } + // Combine the date that the user selected to put in the database $strdate = $_POST['month']." ".$_POST['day'].",".$_POST['year']; $strdate = strtotime($strdate); + // Insert record into database mysql_query("INSERT INTO ofirst_projects_tasks SET TaskName = '".$_POST['taskname']."', *************** *** 62,84 **** } if(ISSET($_POST['addcompletion'])){ mysql_query("UPDATE ofirst_projects_projects SET Completion = '".$_POST['completion']."' WHERE ID = '".$_GET['ProjectID']."'") or die(mysql_error()); echo "<br><br>Project completion changed to: ".$_POST['completion']."% [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Notes</a> ]<br><br>"; die(include($footer)); ! } if(ISSET($_POST['remove'])){ ! if(! ISSET($_POST['confirm'])){ ! echo "<br><br>Your request to remove the task was denied because you have not confirmed! [ <a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."'>Tasks</a> ]<br><br>"; ! die(include($footer)); ! } mysql_query("DELETE FROM ofirst_projects_tasks WHERE ID = '".$_POST['task']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_notes WHERE TaskID = '".$_POST['task']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_tasks WHERE TaskID = '".$_POST['task']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_projects WHERE TaskID = '".$_POST['task']."'") or die(mysql_error()); echo "<br><br>Task removed! [ <a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."'>Projects</a> ]<br><br>"; die(include($footer)); --- 71,99 ---- } + // Add completion button (adds the completion of the project this task is apart of) if(ISSET($_POST['addcompletion'])){ + // Update completion value in databaes mysql_query("UPDATE ofirst_projects_projects SET Completion = '".$_POST['completion']."' WHERE ID = '".$_GET['ProjectID']."'") or die(mysql_error()); echo "<br><br>Project completion changed to: ".$_POST['completion']."% [ <a href='projects.php?GroupID=".$_GET['GroupID']."'>Notes</a> ]<br><br>"; die(include($footer)); ! } + // Remove button process if(ISSET($_POST['remove'])){ ! // If a remove confirm is selected then allow the process to continue ! if(! ISSET($_POST['confirm'])){ ! echo "<br><br>Your request to remove the task was denied because you have not confirmed! [ <a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."'>Tasks</a> ]<br><br>"; ! die(include($footer)); ! } + // Remove every task related value in the database mysql_query("DELETE FROM ofirst_projects_tasks WHERE ID = '".$_POST['task']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_notes WHERE TaskID = '".$_POST['task']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_tasks WHERE TaskID = '".$_POST['task']."'") or die(mysql_error()); mysql_query("DELETE FROM ofirst_projects_projects WHERE TaskID = '".$_POST['task']."'") or die(mysql_error()); + echo "<br><br>Task removed! [ <a href='tasks.php?GroupID=".$_GET['GroupID']."&ProjectID=".$_GET['ProjectID']."'>Projects</a> ]<br><br>"; die(include($footer)); *************** *** 86,89 **** --- 101,105 ---- } + // Gather information to show the following tasks $query = mysql_query("SELECT * FROM ofirst_projects_groups WHERE ID = '".$_GET['GroupID']."'"); $group = mysql_fetch_object($query); *************** *** 117,130 **** --- 133,150 ---- <?php + // Run through the current tasks in the database related to this project and group $query = mysql_query("SELECT * FROM ofirst_projects_tasks WHERE ProjectID = '".$_GET['ProjectID']."' AND GroupID = '".$_GET['GroupID']."'"); while($tasks = mysql_fetch_object($query)){ + // If a pend is not set then make value false if($tasks->Pend == "none"){ $pend = false; }else{ + // If the value is true then find the value of the task its pending on $taskquery = mysql_query("SELECT * FROM ofirst_projects_tasks WHERE ID = '".$tasks->Pend."'"); $pendtask = mysql_fetch_object($taskquery); + // If the pend task is 100% then dont continue pend value if($pendtask->Completion == 100){ $pend = false; *************** *** 137,148 **** <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" <?php if(date("F j, Y",time()) == date("F j, Y",$tasks->Dates)){ echo "bgColor='#CCCCCC'"; } ?>> <td> ! <?php if($tasks->Completion == "100"){ echo "<a href='notes.php?GroupID=".$_GET['GroupID']."&TaskID=".$tasks->ID."&ProjectID=".$_GET['ProjectID']."'><img src='../members/icons/actions/button_ok.png' border='0'></a>"; ! }elseif($tasks->Completion == "CLOSE"){ echo "<a href='notes.php?GroupID=".$_GET['GroupID']."&TaskID=".$tasks->ID."&ProjectID=".$_GET['ProjectID']."'><img src='../members/icons/actions/button_cancel.png' border='0'></a>"; }else{ if($pend){ echo "<img src='../members/icons/actions/encrypted.png' border='0'>"; --- 157,172 ---- <tr onMouseOver="this.style.backgroundColor='#cccccc'" onMouseOut="this.style.backgroundColor='#ffffff'" <?php if(date("F j, Y",time()) == date("F j, Y",$tasks->Dates)){ echo "bgColor='#CCCCCC'"; } ?>> <td> ! <?php + // If the task comletion is 100% then display the completion graphic if($tasks->Completion == "100"){ echo "<a href='notes.php?GroupID=".$_GET['GroupID']."&TaskID=".$tasks->ID."&ProjectID=".$_GET['ProjectID']."'><img src='../members/icons/actions/button_ok.png' border='0'></a>"; ! ! // If the task is closed then display the close value ! }elseif($tasks->Completion == "CLOSE"){ echo "<a href='notes.php?GroupID=".$_GET['GroupID']."&TaskID=".$tasks->ID."&ProjectID=".$_GET['ProjectID']."'><img src='../members/icons/actions/button_cancel.png' border='0'></a>"; }else{ + // If the value is still pending then display the pend value if($pend){ echo "<img src='../members/icons/actions/encrypted.png' border='0'>"; *************** *** 156,166 **** <td> <?php echo $tasks->TaskName." ("; if(! $pend){ ! echo $tasks->Completion."%"; }else{ echo "PEND ON: ".$pendtask->TaskName; } echo ")"; ?> </td> --- 180,193 ---- <td> <?php + + // Decide between pend, close and completion value to display echo $tasks->TaskName." ("; if(! $pend){ ! if($tasks->Completion == "CLOSE"){ echo "CLOSED"; }else{ echo $tasks->Completion."%"; } }else{ echo "PEND ON: ".$pendtask->TaskName; } echo ")"; + ?> </td> *************** *** 174,177 **** --- 201,205 ---- } + // If no values are found then output a response if(mysql_num_rows($query) == 0){ echo "\n <tr>\n <td> </td>\n <td> </td>\n <td> </td>\n <td>There are no tasks for this project!</td>\n <td> </td>"; *************** *** 182,187 **** <?php ! if(ISSET($user->user)){ ! $allowed = explode(",",$project->Assigned); $show = false; --- 210,214 ---- <?php ! // Loop through members assigned to this current task, check if the user is any of those names then allow the to add/edit $allowed = explode(",",$project->Assigned); $show = false; *************** *** 290,297 **** --- 317,327 ---- <td><select name="assign[]" width='40' size="6" multiple id="assign"> <?php + + // View assigned members to related project $assigned = explode(",",$project->Assigned); foreach($assigned as $assign){ echo "<option>".$assign."</option>"; } + ?> </select></td> *************** *** 309,316 **** <td><div align="right">Task Name:</div></td> <td><select name="task" id="task"> ! <?php $query = mysql_query("SELECT * FROM ofirst_projects_tasks WHERE GroupID = '".$_GET['GroupID']."' AND ProjectID = '".$_GET['ProjectID']."'"); - while($tasks = mysql_fetch_object($query)){ echo "<option value='".$tasks->ID."'>".$tasks->TaskName."</option>"; --- 339,346 ---- <td><div align="right">Task Name:</div></td> <td><select name="task" id="task"> ! <?php + // View a list of tasks $query = mysql_query("SELECT * FROM ofirst_projects_tasks WHERE GroupID = '".$_GET['GroupID']."' AND ProjectID = '".$_GET['ProjectID']."'"); while($tasks = mysql_fetch_object($query)){ echo "<option value='".$tasks->ID."'>".$tasks->TaskName."</option>"; *************** *** 371,380 **** </table> </form> ! <?php } } ?> ! <br> ! <table width="102%"> ! <tr> ! <td bgcolor="#CCCCCC">Highlighted Cell = New Commit</td> ! </tr> ! </table> ! <?php include($footer); ?> --- 401,408 ---- </table> </form> ! <?php ! ! } ! } ! include($footer); ! ?> \ No newline at end of file Index: today.php =================================================================== RCS file: /cvsroot/openfirst/projects/today.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** today.php 27 Aug 2003 12:58:07 -0000 1.1 --- today.php 29 Aug 2003 15:50:35 -0000 1.2 *************** *** 27,34 **** --- 27,41 ---- */ + // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); + // Check if user is a member + if(! ISSET($user->user)){ + showLogin(); + }else{ + + // Select value of date to view for the page if(ISSET($_POST['viewdate'])){ $selectdate = $_POST['month']." ".$_POST['day'].", ".$_POST['year']; *************** *** 114,117 **** --- 121,125 ---- <?php + // Run through the current list of groups to preview there related information $groupquery = mysql_query("SELECT * FROM ofirst_projects_groups"); while($group = mysql_fetch_object($groupquery)){ *************** *** 134,137 **** --- 142,146 ---- <?php + // Listed the newly added projects for this day $projectquery = mysql_query("SELECT * FROM ofirst_projects_projects WHERE GroupID = '".$group->ID."'"); while($project = mysql_fetch_object($projectquery)){ *************** *** 153,156 **** --- 162,166 ---- } + // List the newly added tasks for this day $taskquery = mysql_query("SELECT * FROM ofirst_projects_tasks WHERE GroupID = '".$group->ID."'"); while($task = mysql_fetch_object($taskquery)){ *************** *** 175,178 **** --- 185,189 ---- } + // List the newly added notes for this day $notequery = mysql_query("SELECT * FROM ofirst_projects_notes WHERE GroupID = '".$group->ID."'"); while($note = mysql_fetch_object($notequery)){ *************** *** 202,205 **** ?> </table> ! <?php } ?> ! <br><br> <?php include($footer); ?> \ No newline at end of file --- 213,219 ---- ?> </table> ! <?php ! } ! } ! include($footer); ! ?> \ No newline at end of file Index: viewmeeting.php =================================================================== RCS file: /cvsroot/openfirst/projects/viewmeeting.php,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** viewmeeting.php 27 Aug 2003 12:58:07 -0000 1.1 --- viewmeeting.php 29 Aug 2003 15:50:35 -0000 1.2 *************** *** 27,41 **** */ include("../config/globals.php"); $header_condense = true; include($header); if(ISSET($_POST['update'])){ ! if(! ISSET($_POST['absent'])){ ! echo "<br><br>You must select users who were absent of click none! Click back to continue.<br><br><br>"; ! die(include($footer)); ! } if(is_array($_POST['absent'])){ $absentlist = implode(",",$_POST['absent']); --- 27,50 ---- */ + // Include globals and set header condense (not coded yet) include("../config/globals.php"); $header_condense = true; include($header); + // Check if user is a member + if(! ISSET($user->user)){ + showLogin(); + }else{ + + // Update buttin process if(ISSET($_POST['update'])){ ! // Check if absent values were set ! if(! ISSET($_POST['absent'])){ ! echo "<br><br>You must select users who were absent of click none! Click back to continue.<br><br><br>"; ! die(include($footer)); ! } + // Check if absent was a single string or array then add it to a variable if(is_array($_POST['absent'])){ $absentlist = implode(",",$_POST['absent']); *************** *** 44,47 **** --- 53,57 ---- } + // Update information in the database mysql_query("UPDATE ofirst_projects_meetings SET Notes = '".$_POST['notes']."', *************** *** 52,55 **** --- 62,66 ---- } + // Collect information for the current meeting $query = mysql_query("SELECT * FROM ofirst_projects_meetings WHERE ID = '".$_GET['ID']."'"); $meeting = mysql_fetch_object($query); *************** *** 70,73 **** --- 81,86 ---- <td><p> <?php + + // List people who meeting was arranged for $assign = explode(",",$meeting->ArrangedFor); foreach($assign as $assign){ *************** *** 76,83 **** --- 89,98 ---- echo "<br>".$group->GroupName; } + ?> </p></td> </tr> <?php + // View extra features if the meeting is done if($meeting->Status == "done"){ ?> *************** *** 104,108 **** <div align="right">Notes:</div></td> <td> ! <?php if (function_exists("make_wysiwyg")) { make_wysiwyg("description",500,255,""); --- 119,125 ---- <div align="right">Notes:</div></td> <td> ! <?php ! ! // If WYSIWYG function is set then view the WYSIWYG function module if (function_exists("make_wysiwyg")) { make_wysiwyg("description",500,255,""); *************** *** 110,113 **** --- 127,131 ---- echo "<textarea name='description'></textarea>"; } + ?> </td> *************** *** 115,137 **** <tr> <td><div align="right">Please list the people who were <strong>NOT</strong> ! present::</div></td> <td><p> <select name="absent[]" width='60' size="6"> ! <option>none</option><?php $assign = explode(",",$meeting->ArrangedFor); foreach($assign as $assign){ $query = mysql_query("SELECT * FROM ofirst_projects_groups WHERE ID = '".$assign."'"); $group = mysql_fetch_object($query); - $people = explode(",",$group->Members); $people = array_unique($people); } ! foreach($people as $people){ echo "\n <option>$people</option>"; } ! ?> </select> <font size="2"></font></p></td> --- 133,162 ---- <tr> <td><div align="right">Please list the people who were <strong>NOT</strong> ! present:</div></td> <td><p> <select name="absent[]" width='60' size="6"> ! <option>none</option> ! <?php ! ! // Make a list of people who were present at the meeting $assign = explode(",",$meeting->ArrangedFor); foreach($assign as $assign){ + + // Run through the groups and find values $query = mysql_query("SELECT * FROM ofirst_projects_groups WHERE ID = '".$assign."'"); $group = mysql_fetch_object($query); + $people = explode(",",$group->Members); + + // Remove any duplicated names in the array $people = array_unique($people); } ! // List the people currently in the array foreach($people as $people){ echo "\n <option>$people</option>"; } ! ?> </select> <font size="2"></font></p></td> *************** *** 143,147 **** </tr> </table></form> ! <p><br> ! <?php } include($footer); ?> ! </p> --- 168,175 ---- </tr> </table></form> ! <br> ! <?php ! ! } ! include($footer); ! ?> |