コード例 #1
0
ファイル: Logbook.php プロジェクト: nadeemshafique/entrada-1x
 public function __construct($course_id = NULL, $logbook_entries = NULL, $logged_objectives = NULL, $required_objectives = NULL)
 {
     global $ENTRADA_USER, $db;
     $this->course_id = $course_id;
     if ($logbook_entries) {
         $this->logbook_entries = $logbook_entries;
     } else {
         $this->logbook_entries = Models_Logbook_Entry::fetchAll($ENTRADA_USER->GetID());
     }
     if (!$logged_objectives) {
         $logged_objectives = array();
         foreach ($this->logbook_entries as $entry) {
             if (!array_key_exists($entry->getCourseID(), $logged_objectives)) {
                 $logged_objectives[$entry->getCourseID()] = array();
             }
             if (@count($entry->getObjectives())) {
                 foreach ($entry->getObjectives() as $objective) {
                     $logged_objectives[$entry->getCourseID()][$objective->getID()] = $objective;
                 }
             }
         }
     }
     $this->logged_objectives = $logged_objectives;
     if (!$required_objectives) {
         $required_objectives = array();
         $query = "SELECT * FROM `course_objectives`";
         $course_objectives = $db->GetAll($query);
         foreach ($course_objectives as $course_objective) {
             $objective = Models_Objective::fetchRow($course_objective["objective_id"]);
             if ($objective && $objective->getLoggable()) {
                 if (!array_key_exists($course_objective["course_id"], $required_objectives)) {
                     $required_objectives[$course_objective["course_id"]] = array();
                 }
                 if (!array_key_exists($course_objective["course_id"], $logged_objectives) || !array_key_exists($objective->getID(), $logged_objectives[$course_objective["course_id"]])) {
                     $required_objectives[$course_objective["course_id"]][$objective->getID()] = $objective;
                 }
             }
         }
     }
     $this->required_objectives = $required_objectives;
 }
コード例 #2
0
if (!defined("PARENT_INCLUDED") || !defined("IN_ENCOUNTER_TRACKING")) {
    exit;
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
    exit;
} elseif (!$ENTRADA_ACL->amIAllowed('encounter_tracking', 'read')) {
    exit;
    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 {
    ob_clear_open_buffers();
    if (isset($_GET["proxy_id"]) && (int) $_GET["proxy_id"]) {
        $proxy_id = (int) $_GET["proxy_id"];
    } else {
        $proxy_id = $ENTRADA_USER->getID();
    }
    $output = array("aaData" => array());
    $entries = Models_Logbook_Entry::fetchAll($proxy_id);
    $count = 0;
    if ($entries) {
        /*
         * Ordering
         */
        if (isset($_GET["iSortCol_0"]) && in_array($_GET["iSortCol_0"], array(1, 2, 3, 4))) {
            $aColumns = array("lentry_id", "course", "encounter_date", "institution", "location");
            $sort_array = array();
            foreach ($entries as $entry) {
                switch ($_GET["iSortCol_0"]) {
                    default:
                    case 1:
                        $course = $entry->getCourseName();
                        break;
                    case 2:
コード例 #3
0
 *
*/
if (!defined("PARENT_INCLUDED") || !defined("IN_ENCOUNTER_TRACKING")) {
    exit;
} elseif (!isset($_SESSION["isAuthorized"]) || !$_SESSION["isAuthorized"]) {
    header("Location: " . ENTRADA_URL);
    exit;
} elseif (!$ENTRADA_ACL->amIAllowed('encounter_tracking', 'read')) {
    $ONLOAD[] = "setTimeout('window.location=\\'" . ENTRADA_URL . "/admin/" . $MODULE . "\\'', 15000)";
    $ERROR++;
    $ERRORSTR[] = "Your account does not have the permissions required to use this feature of 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 {
    echo "<h1>Encounter Tracking Entries</h1>";
    $entries = Models_Logbook_Entry::fetchAll($ENTRADA_USER->GetID());
    $HEAD[] = "<script type=\"text/javascript\" src=\"" . ENTRADA_URL . "/javascript/jquery/jquery.dataTables.min.js\"></script>";
    $HEAD[] = "<script type=\"text/javascript\">\n\n        jQuery(function(\$) {\n            jQuery('#entries').dataTable(\n                {\n                    'sPaginationType': 'full_numbers',\n                    'bInfo': false,\n                    'bAutoWidth': false,\n                    'sAjaxSource': '?section=api-list',\n                    'bServerSide': true,\n                    'bProcessing': true,\n                    'aoColumns': [\n                        { 'mDataProp': 'checkbox', 'bSortable': false },\n                        { 'mDataProp': 'course' },\n                        { 'mDataProp': 'date' },\n                        { 'mDataProp': 'institution' },\n                        { 'mDataProp': 'location' }\n                    ],\n                    'oLanguage': {\n                        'sEmptyTable': 'There are currently no entries in the system. Use the Log Entry button to create a new encounter tracking entry.',\n                        'sZeroRecords': 'No encounter tracking entries found to display.'\n                    }\n                }\n            );\n        });\n    </script>";
    add_statistic("encounter_tracking", "view", "lentry_id", NULL, $ENTRADA_USER->getID());
    ?>
	<?php 
    if ($ENTRADA_ACL->amIAllowed('encounter_tracking', 'read')) {
        ?>
	<div class="row-fluid">
		<a href="<?php 
        echo html_encode(ENTRADA_URL);
        ?>
/logbook?section=add" class="btn btn-primary pull-right">Log Entry</a>
	</div>
	<br />
	<?php