* @author Unit: School of Medicine * @author Developer: Josh Dillon <*****@*****.**> * @copyright Copyright 2013 Queen's University. All Rights Reserved. * */ if (!defined("PARENT_INCLUDED")) { exit; } if (!$ENTRADA_ACL->amIAllowed("dashboard", "read")) { add_error("Your account does not have the permissions required to use this module.<br /><br />If you believe you are receiving this message in error please contact <a href=\"mailto:" . html_encode($AGENT_CONTACTS["administrator"]["email"]) . "\">" . html_encode($AGENT_CONTACTS["administrator"]["name"]) . "</a> for assistance."); echo display_error(); application_log("error", "Group [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["group"] . "] and role [" . $_SESSION["permissions"][$ENTRADA_USER->getAccessId()]["role"] . "] does not have access to this module [" . $MODULE . "]"); } else { if (isset($_GET["notice_id"]) && ($tmp_input = clean_input($_GET["notice_id"], array("int")))) { $PROCESSED["notice_id"] = $tmp_input; $notice = Models_Notice::fetchNotice($PROCESSED["notice_id"]); } $BREADCRUMB[] = array("url" => ENTRADA_RELATIVE . "/dashboard/notices?section=view", "title" => $notice ? date(DEFAULT_DATE_FORMAT, $notice["updated_date"]) : ""); ?> <?php if ($notice) { echo "<div id=\"notice_box_" . (int) $notice["notice_id"] . "\" class=\"space-below\">"; echo "<strong>" . date(DEFAULT_DATE_FORMAT, $notice["updated_date"]) . "</strong>"; echo "<div class=\"space-left\">" . trim(clean_input($notice["notice_summary"], "html")) . "</div>"; echo "</div>"; add_statistic("notices", "read", "notice_id", $notice["notice_id"]); } else { ?> <div class="alert alert-info"> <strong>No message found.</strong> </div>
$result["updated_date"] = date(DEFAULT_DATE_FORMAT, $result["updated_date"]); $output[] = $result; } else { $result['notice_status'] = 'read'; $result["updated_date"] = date(DEFAULT_DATE_FORMAT, $result["updated_date"]); $output[] = $result; } $rows++; } echo json_encode(array("status" => "success", "data" => $output, "max_notice_id" => $max_notice_id["max_notice_id"], "rows" => $rows)); } else { echo json_encode(array("status" => "error", "data" => "No notices to display")); } break; case "notice": $notice = Models_Notice::fetchNotice($message_id); if ($notice) { echo json_encode(array("status" => "success", "data" => $notice)); } else { echo json_encode(array("status" => "error")); } break; case "evaluations": $evaluations_list = array(); $evaluations = Models_Evaluation::getEvaluatorEvaluations($ENTRADA_USER->getID(), $ENTRADA_USER->getActiveOrganisation()); if ($evaluations) { if (count($evaluations)) { foreach ($evaluations as $evaluation) { if ($evaluation["max_submittable"] > $evaluation["completed_attempts"]) { $evaluations_list[] = $evaluation; }