$item->author = $message["username"]; $rss->addItem($item); } echo $rss->saveFeed("RSS2.0", CL_ROOT . "/files/" . CL_CONFIG . "/ics/mymsgs-{$user}.xml"); } elseif ($action == "projectmessages") { // check if the user is allowed to edit messages if (!$userpermissions["messages"]["add"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}"); $template->display("error.tpl"); die; } $msg = new message(); // get all messages of this project $messages = $msg->getProjectMessages($project); // get project's name $myproject = new project(); $pro = $myproject->getProject($project); $projectname = $pro['name']; $template->assign("projectname", $projectname); // get the page title $title = $langfile['messages']; if (!empty($messages)) { $mcount = count($messages); } else { $mcount = 0; } $strpro = $langfile["project"]; $tit = $langfile["messages"]; $rss->title = $projectname . " / " . $tit;
$milestone = new milestone(); $mtask = new task(); $msg = new message(); // create arrays to hold data $messages = array(); $milestones = array(); $tasks = array(); // create a counter for the foreach loop $cou = 0; // If user has projects, loop through them and get the messages and tasks belonging to those projects if (!empty($myOpenProjects)) { foreach ($myOpenProjects as $proj) { // get all the tasks in this project that are assigned to the current user $task = $mtask->getAllMyProjectTasks($proj["ID"], 100); // get all messages in the project $msgs = $msg->getProjectMessages($proj["ID"]); // write those to arrays if (!empty($msgs)) { array_push($messages, $msgs); } if (!empty($task)) { array_push($tasks, $task); } $cou = $cou + 1; } } $myClosedProjects = $project->getMyProjects($userid, 0); // If the user is allowed to add projects, also get all users to assign to those projects if ($userpermissions["projects"]["add"]) { $user = new user(); $users = $user->getAllUsers(1000000);
if (!$userpermissions["messages"]["view"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "{$errtxt}<br>{$noperm}"); $template->display("error.tpl"); die; } if (!chkproject($userid, $id)) { $errtxt = $langfile["notyourproject"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "{$errtxt}<br>{$noperm}"); $template->display("error.tpl"); die; } // get all messages of this project $messages = $msg->getProjectMessages($id); // get project's name $myproject = new project(); $pro = $myproject->getProject($id); $members = $myproject->getProjectMembers($id, 10000); $projectname = $pro['name']; $template->assign("projectname", $projectname); // get the page title $title = $langfile['messages']; $template->assign("title", $title); if (!empty($messages)) { $mcount = count($messages); } else { $mcount = 0; } // get files of the project