public static function tasks($projectID = null) { if ($projectID == null) { return null; } return self::oneCrumb("Tasks", Url::tasks($projectID)); }
<script type="text/javascript"> $(document).ready(function(){ $('#selTaskFilesPages').change(function(){ var url = '<?php echo $thisURL; ?> '; var pageNum = $(this).val(); window.location = url+'/'+pageNum; }); }); </script> <?php if (empty($uploads)) { echo '<p>None yet. To upload files, <a href="' . Url::taskNew($project->getID()) . '">create a task</a> or contribute to an <a href="' . Url::tasks($project->getID()) . '">existing task</a>.</p>'; } else { $SOUP->render('site/partial/newUploads', array('showParent' => true)); } ?> <?php $fork->endBlockSet(); // pagination, if necessary if ($numPages > 1) { $fork->startBlockSet('footer'); if ($page != 1) { $olderURL = $thisURL; $olderURL .= '/' . ($page - 1); echo '<a href="' . $olderURL . '">« Previous</a> '; }
$logEvent->save(); // send us back Session::setMessage('You joined the task. Good luck!'); $json = array('success' => '1', 'successUrl' => Url::task($taskID)); echo json_encode($json); } elseif ($action == 'release') { $accepted = Accepted::getByUserID(Session::getUserID(), $taskID); if (!empty($accepted)) { $accepted->setStatus(Accepted::STATUS_RELEASED); $accepted->save(); // log it $logEvent = new Event(array('event_type_id' => 'release_task', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $accepted->getID(), 'item_2_id' => $taskID)); $logEvent->save(); // send us back Session::setMessage('You left the task.'); $json = array('success' => '1', 'successUrl' => Url::tasks($project->getID())); echo json_encode($json); } else { $json = array('error' => 'You never joined that task.'); exit(json_encode($json)); } } elseif ($action == 'comment') { $message = Filter::formattedText($_POST['message']); if ($message == '') { $json = array('error' => 'Your comment cannot be empty.'); exit(json_encode($json)); } else { // post the comment $comment = new Comment(array('creator_id' => Session::getUserID(), 'project_id' => $project->getID(), 'task_id' => $taskID, 'message' => $message)); $comment->save(); // re-save now that we have an ID
$task = new Task(array('creator_id' => Session::getUserID(), 'leader_id' => $leaderId, 'project_id' => $projectId, 'title' => $title, 'description' => $description, 'status' => 1, 'deadline' => $deadline, 'num_needed' => $numberOfPeople)); array_push($taskArray, $task); //Increment row in file $row++; } fclose($handle); } //Save each task to the database if no errors are found if ($errorFound == 1) { $errorString = "<strong><span class='bad'>Your CSV file was not uploaded.</span></strong><br/>" . $errorString; $json = array("error" => $errorString); exit(json_encode($json)); } else { foreach ($taskArray as $task) { $task->save(); } //Send back success message Session::setMessage("File successfully uploaded."); //header('Location: '.Url::tasks($projectId)); $json = array('success' => '1', 'url' => Url::tasks($projectId)); exit(json_encode($json)); } if (empty($json)) { $json = array('success' => '1'); } exit(json_encode($json)); } else { header('Location: ' . Url::error()); exit; } }
function formatSectionLink($sectionID = null, $projectID = null) { if ($sectionID == null || $projectID == null) { return null; } switch ($sectionID) { case ACTIVITY_ID: $url = Url::activity($projectID); $name = "Activity"; break; case BASICS_ID: $url = Url::details($projectID); $name = "Basics"; break; case TASKS_ID: $url = Url::tasks($projectID); $name = "Tasks"; break; case DISCUSSIONS_ID: $url = Url::discussions($projectID); $name = "Discussions"; break; case PEOPLE_ID: $url = Url::people($projectID); $name = "People"; break; } $formatted = '<a href="' . $url . '">' . $name . '</a>'; return $formatted; }
// Upload::TYPE_DISCUSSION, // $discussion->getID(), // $project->getID() // ); // log it $logEvent = new Event(array('event_type_id' => 'create_discussion', 'project_id' => $project->getID(), 'user_1_id' => Session::getUserID(), 'item_1_id' => $discussion->getID(), 'data_1' => $title, 'data_2' => $message)); $logEvent->save(); // we're done here Session::setMessage('You created a new discussion.'); // if category is set, redirect back to other section switch ($cat) { case BASICS_ID: $successURL = Url::details($project->getID()); break; case TASKS_ID: $successURL = Url::tasks($project->getID()); break; case PEOPLE_ID: $successURL = Url::people($project->getID()); break; case ACTIVITY_ID: $successURL = Url::activity($project->getID()); break; default: $successURL = Url::discussion($discussion->getID()); } $json = array('success' => '1', 'successUrl' => $successURL); echo json_encode($json); } elseif ($action == 'reply') { $discussionID = Filter::numeric($_POST['discussionID']); $message = Filter::formattedText($_POST['message']);
<ul> <?php if ($project != null) { ?> <li><a <?php echo $selected == "details" ? 'class="selected"' : ''; ?> href="<?php echo Url::details($project->getID()); ?> ">Basics</a></li> <li><a <?php echo $selected == "tasks" ? 'class="selected"' : ''; ?> href="<?php echo Url::tasks($project->getID()); ?> ">Tasks</a></li> <li><a <?php echo $selected == "people" ? 'class="selected"' : ''; ?> href="<?php echo Url::people($project->getID()); ?> ">People</a></li> <li><a <?php echo $selected == "discussions" ? 'class="selected"' : ''; ?> href="<?php echo Url::discussions($project->getID()); ?>