$template->assign("title", $title); $template->assign("redir", $redir); $template->assign("user", $user); $template->assign("project", $proj); $template->assign("members", $members); $template->display("deassignuserform.tpl"); } elseif ($action == "deassign") { if (!$userpermissions["projects"]["edit"]) { $errtxt = $langfile["nopermission"]; $noperm = $langfile["accessdenied"]; $template->assign("errortext", "{$errtxt}<br>{$noperm}"); $template->display("error.tpl"); die; } $task = new task(); $tasks = $task->getAllMyProjectTasks($id, 100, $usr); if ($id > 0 and $assignto > 0) { if (!empty($tasks)) { foreach ($tasks as $mytask) { if ($task->deassign($mytask["ID"], $usr)) { $task->assign($mytask["ID"], $assignto); } } } } else { if (!empty($tasks)) { foreach ($tasks as $mytask) { $task->del($mytask["ID"]); } } }
} } if ($action == "rss-tasks") { $thetask = new task(); $tit = $langfile["mytasks"]; $rss->title = $tit; $rss->description = ""; $rss->descriptionHtmlSyndicated = true; $loc = $url . "/manageproject.php?action=showproject&id={$project}"; $rss->link = $loc; $rss->syndicationURL = $loc; $project = new project(); $myprojects = $project->getMyProjects($user); $tasks = array(); foreach ($myprojects as $proj) { $task = $thetask->getAllMyProjectTasks($proj["ID"], 10000, $user); if (!empty($task)) { array_push($tasks, $task); } } $etasks = reduceArray($tasks); foreach ($etasks as $mytask) { $item = new FeedItem(); $item->title = $mytask["title"]; $loc = $url . "managetask.php?action=showtask&tid={$mytask['ID']}&id={$mytask['project']}"; $item->link = $loc; $item->source = $loc; $item->description = $mytask["text"]; // optional $item->descriptionTruncSize = 500; $item->descriptionHtmlSyndicated = true;
$project = new project(); $customer = new company(); $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"]) {
header("Location: admin.php?action=users&mode=deleted"); } } } elseif ($action == "deleteuser") { $id = getArrayVal($_POST, "id"); $uprojects = getArrayVal($_POST, "uprojects"); $proarr = array(); foreach ($uprojects as $upro) { $dat = explode("#", $upro); $todo = array("project" => $dat[0], "user" => $dat[1]); array_push($proarr, $todo); } if (!empty($proarr)) { $task = new task(); foreach ($proarr as $proj) { $tasks = $task->getAllMyProjectTasks($proj["project"], 100, $id); if ($proj["project"] > 0 and $proj["user"] > 0) { if (!empty($tasks)) { foreach ($tasks as $mytask) { if ($task->deassign($mytask["ID"], $id)) { $task->assign($mytask["ID"], $proj["user"]); } } } } else { if (!empty($tasks)) { foreach ($tasks as $mytask) { $task->del($mytask["ID"]); } } }