Ejemplo n.º 1
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 {
    if (defined("IN_ENCOUNTER_TRACKING") && IN_ENCOUNTER_TRACKING && (defined("EDIT_ENTRY") && EDIT_ENTRY || defined("ADD_ENTRY") && ADD_ENTRY)) {
        $logbook = new Models_Logbook();
        if (isset($entry_id)) {
            $entry = Models_Logbook_Entry::fetchRow($entry_id);
        } else {
            $entry = new Models_Logbook_Entry();
        }
        switch ($STEP) {
            case 2:
                if (isset($entry_id)) {
                    $PROCESSED["lentry_id"] = $entry_id;
                }
                $encounter_date = validate_calendar("", "encounter", true);
                if (isset($encounter_date) && (int) $encounter_date) {
                    $PROCESSED["encounter_date"] = (int) $encounter_date;
                } else {
                    add_error("The <strong>Encounter Date</strong> field is required.");
Ejemplo n.º 2
0
 public function getCourseObjectivesMobile()
 {
     global $db;
     if ($this->getCourseID()) {
         $objectives = array("required" => array(), "logged" => array(), "disabled" => array());
         $required_objectives = Models_Logbook::getAllRequiredObjectivesMobile($this->getCourseID());
         foreach ($required_objectives as $required_objective) {
             $query = "SELECT a.`objective_id` FROM `logbook_entry_objectives` AS a\n                            JOIN `logbook_entries` AS b\n                            ON a.`lentry_id` = b.`lentry_id`\n                            WHERE b.`entry_active` = 1\n                            AND b.`course_id` = " . $db->qstr($this->getCourseID()) . "\n                            AND a.`objective_id` = " . $db->qstr($required_objective["objective_id"]) . "\n                            AND a.`objective_active` = 1\n                            LIMIT 0, 1";
             $objective_found = $db->getOne($query) ? true : false;
             $objectives[$this->attachedObjectiveIsDuplicate($required_objective["objective_id"]) ? "disabled" : ($objective_found ? "logged" : "required")][] = $required_objective;
         }
         return $objectives;
     } else {
         return false;
     }
 }
Ejemplo n.º 3
0
 public function assert(Zend_Acl $acl, Zend_Acl_Role_Interface $role = null, Zend_Acl_Resource_Interface $resource = null, $privilege = null)
 {
     $courses = Models_Logbook::getLoggingCourses();
     if ($courses && @count($courses)) {
         return true;
     } else {
         return false;
     }
     return false;
 }