$course_id = $tmp_input;
 } else {
     add_error("No course ID provided.");
 }
 if (isset(${$request_var}["audience"]) && ($tmp_input = clean_input(${$request_var}["audience"], array("trim", "int")))) {
     $audience = $tmp_input;
 } else {
     add_error("No audience ID provided.");
 }
 if (!$ERROR) {
     $ca = new Models_Course_Audience();
     $course_audience = $ca->fetchRowByCourseIDAudienceTypeAudienceValue($course_id, "group_id", $audience);
     if ($course_audience) {
         $curriculum_period = $course_audience->getCurriculumPeriod($course_audience->getCperiodID());
     }
     $e = new Models_Event();
     if ($curriculum_period) {
         $events = $e->fetchAllByCourseIdTitleDates($course_id, $title, $curriculum_period->getStartDate(), $curriculum_period->getFinishDate());
     } else {
         $events = $e->fetchAllByCourseIdTitle($course_id, $title);
     }
     if ($events) {
         $events_array = array();
         foreach ($events as $event) {
             $events_array[] = array("event_id" => $event->getID(), "event_title" => $event->getEventTitle(), "event_start" => date("D M d/y g:ia", $event->getEventStart()));
         }
         echo json_encode(array("status" => "success", "data" => $events_array));
     } else {
         echo json_encode(array("status" => "error", "data" => array("No events found with a title containing <strong>" . $title . "</strong>")));
     }
 } else {
예제 #2
0
 public static function getEvent($event_id = null)
 {
     return Models_Event::get($event_id);
 }
예제 #3
0
  * Check to see if they are trying to view an event using an event_id.
  */
 if (isset($_GET["rid"]) && ($tmp_input = clean_input($_GET["rid"], array("nows", "int")))) {
     $EVENT_ID = $tmp_input;
     $transverse = true;
     if (isset($_GET["community"]) && (int) $_GET["community"]) {
         $community_id = (int) $_GET["community"];
     }
 } elseif (isset($_GET["drid"]) && ($tmp_input = clean_input($_GET["drid"], array("nows", "int")))) {
     $EVENT_ID = $tmp_input;
     $transverse = true;
 } elseif (isset($_GET["id"]) && ($tmp_input = clean_input($_GET["id"], array("nows", "int")))) {
     $EVENT_ID = $tmp_input;
     $transverse = false;
 }
 $event = Models_Event::get($EVENT_ID);
 /**
  * Check for groups which have access to the administrative side of this module
  * and add the appropriate toggle sidebar item.
  */
 if ($ENTRADA_ACL->amIAllowed("eventcontent", "update", false)) {
     switch ($_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"]) {
         case "admin":
             $admin_wording = "Administrator View";
             $admin_url = ENTRADA_RELATIVE . "/admin/events" . ($EVENT_ID ? "?" . replace_query(array("section" => "edit", "id" => $EVENT_ID)) : "");
             break;
         case "pcoordinator":
             $admin_wording = "Coordinator View";
             $admin_url = ENTRADA_RELATIVE . "/admin/events" . ($EVENT_ID ? "?" . replace_query(array("section" => "edit", "id" => $EVENT_ID)) : "");
             break;
         case "director":
예제 #4
0
             }
             break;
         default:
             $PROCESSED["show_learner"] = 0;
             break;
     }
 }
 //narrative check
 if (isset($_POST["narrative_assessment"]) && ($narrative = clean_input($_POST["narrative_assessment"], array("trim", "int")))) {
     $PROCESSED["narrative"] = $narrative;
 } else {
     $PROCESSED["narrative"] = 0;
 }
 if (isset($_POST["event_id"]) && ($tmp_input = clean_input($_POST["event_id"], array("trim", "int")))) {
     $PROCESSED["event_id"] = $tmp_input;
     $event = Models_Event::get($PROCESSED["event_id"]);
 } else {
     $event = false;
 }
 //optional/required check
 if (isset($_POST["assessment_required"])) {
     switch (clean_input($_POST["assessment_required"], array("trim", "int"))) {
         case 0:
             $PROCESSED["required"] = 0;
             break;
         case 1:
             $PROCESSED["required"] = 1;
             break;
         default:
             break;
     }