public function process()
 {
     $success = false;
     if ($this->psu_status == 'eod') {
         PSU::db('banner')->StartTrans();
         $person = PSUPerson::get($this->ordernumber);
         if ($person->pidm) {
             if ($this->status_flag == 'success') {
                 $appl_no = PSU::db('banner')->GetOne("SELECT appl_no FROM psu.v_ug_app WHERE pidm = " . $person->pidm);
                 if ($appl_no) {
                     $sql = "UPDATE sarchkl SET sarchkl_receive_date = sysdate WHERE sarchkl_pidm = " . $person->pidm . " AND sarchkl_appl_no = " . $appl_no . " AND sarchkl_admr_code = 'APFE'";
                     PSU::db('banner')->Execute($sql);
                 }
                 //end if
             }
             //end if
             $this->psu_status = 'loaded';
             $this->save();
             return PSU::db('banner')->CompleteTrans() ? $this->totalamount / 100 : false;
         }
         //end if
     }
     //end if
     PSU::db('banner')->CompleteTrans(false);
     return false;
 }
예제 #2
0
 /**
  * deletes a \Rave\User and inactivates the phone
  */
 public function delete()
 {
     $person = \PSUPerson::get($this->user->sisId);
     /**
      * Going through the delete process for the user will be determined
      * by whether or not we can successfully unconfirm the phone
      */
     if ($person->emergency_phone && !$person->emergency_phone->unconfirm()) {
         throw new Exception('Unable to unconfirm the user\'s Rave phone');
     }
     //end if
     return $this->user->delete();
 }
 /**
  * @brief initializes the default URL
  *
  * @param string $processor ECommerce Processor code
  * @param mixed $params Array or string list of parameters
  * @param string $server Nelnet server (test or prod)
  * @param string $type Type of link (commerce_manager or legacy)
  */
 public function url($processor, $params = false, $server = 'test', $type = 'commerce_manager')
 {
     if (!is_array($params)) {
         parse_str($params, $params);
     }
     //end if
     $person = PSUPerson::get($params['id']);
     $this->setURLParam('orderType', $processor);
     $this->setURLParam('amountDue', $params['amount']);
     $this->setURLParam('orderNumber', $params['id']);
     $this->setURLParam('orderName', $person->formatName('l, f m'));
     $this->setURLParam('orderDescription', $processor);
     return $this->_url($server, $type);
 }
 /**
  * construct gateway URL
  */
 public function url($processor, $params = false, $server = 'test', $type = 'commerce_manager')
 {
     $params = PSU::params($params);
     $person = PSUPerson::get($params['id']);
     $this->setURLParam('orderType', $processor);
     $this->setURLParam('amountDue', $params['amount']);
     $this->setURLParam('currentAmountDue', $params['current_amount']);
     $this->setURLParam('orderNumber', $params['id']);
     $this->setURLParam('orderName', $person->formatName('l, f m'));
     $this->setURLParam('orderDescription', $processor);
     $this->setURLParam('userChoice2', $params['term']);
     $server = 'prod';
     return $this->_url($server, $type);
 }
예제 #5
0
 /**
  * reteive instructor data for the given type 
  */
 public function instructors($type = 'pidm')
 {
     $person_objects;
     if ($type == 'pidm') {
         return $this->instructors;
     } elseif ($type == 'PSUPerson') {
         if ($person_objects) {
             return $person_objects;
         }
         $person_objects = array();
         foreach ($this->instructors as $key => $value) {
             $person_objects[$key] = \PSUPerson::get($value);
         }
         return $person_objects;
     }
     return null;
 }
 public function url($user)
 {
     $person = PSUPerson::get($user);
     if (!$person->pidm) {
         return false;
     }
     $processor = 'Res Life FlexCash';
     $server = $_SERVER['URANUS'] ? 'test' : 'prod';
     $sql = "SELECT 1 \n\t\t          FROM spbcard \n\t\t         WHERE spbcard_pidm=" . preg_replace('/[^0-9]/', '', $person->pidm) . " \n\t\t           AND (spbcard_student_status = 'AS' \n\t\t                OR \n\t\t                spbcard_employee_status = 'A'\n\t\t                OR \n\t\t                spbcard_employee_status IS NULL\n\t\t               )";
     if ($can_flex_cash = $GLOBALS['BANNER']->GetOne($sql)) {
         $this->setURLParam('orderType', $processor);
         $this->setURLParam('orderNumber', $person->username);
         $this->setURLParam('orderName', $person->formatName('l, f m'));
         $this->setURLParam('orderDescription', $processor);
         return $this->_url($server);
     } else {
         return false;
     }
     //end else
 }
 public function url($user)
 {
     $person = PSUPerson::get($user);
     if (!$person->pidm) {
         return false;
     }
     $processor = 'IT Pay2Print';
     $server = $_SERVER['URANUS'] ? 'test' : 'prod';
     $params = array('id' => $person->id);
     if (!is_array($params)) {
         parse_str($params, $params);
     }
     //end if
     $person = PSUPerson::get($params['id']);
     $this->setURLParam('orderType', $processor);
     $this->setURLParam('amountDue', $params['amount']);
     $this->setURLParam('orderNumber', $params['id']);
     $this->setURLParam('orderName', $person->formatName('l, f m'));
     $this->setURLParam('orderDescription', $processor);
     $this->setURLParam('redirectUrl', $this->base_url . '/receipt.html');
     $this->setURLParam('retriesAllowed', 5);
     $this->setURLParam('redirectUrlParameters', implode(',', $this->_redirect_params));
     return $this->_url($server, $type);
 }
 /**
  * lazy load the person object
  */
 public function _load_person()
 {
     $this->person = PSUPerson::get($this->wpid);
 }
 /**
  * authorization of access
  */
 public function authZ(&$person = null)
 {
     if (!$person instanceof PSUPerson) {
         $person = PSUPerson::get($person ? $person : $_SESSION['wp_id']);
     }
     //end if
     return true;
 }
 /**
  * constructor that accepts in either a pidm or a username, or a PSUPerson object
  *
  * @since    version 1.0.0
  * @param    string $id PSUPerson, username, or pidm
  */
 public function __construct($id)
 {
     if (is_object($id) && get_class($id) === 'PSUPerson') {
         $this->person = $id;
     } else {
         $this->person = PSUPerson::get($id);
     }
     if (!$this->person || !$this->person->hasSystemAccount()) {
         return;
     }
     $this->username = $this->person->username;
     $this->db = PSUDatabase::connect('mssql/printers2');
     $this->load();
 }
예제 #11
0
function sendOpenCallMail($call_info, $action)
{
    global $db;
    $person_cache = array();
    $call = $db->GetRow("SELECT * FROM call_log WHERE call_id = ?", array($call_info['call_id']));
    $call_info['call_date'] = $call['call_date'] . ' ' . $call['call_time'];
    $headers = array();
    $headers['content-type'] = 'text/html';
    $caller = PSU::nvl($call_info['caller_wp_id'], $call_info['caller_pidm'], $call_info['call_log_username']);
    $caller_data = $GLOBALS['user']->getCallerData($caller);
    $logger = $person_cache[$call_info['call_log_username']] = PSUPerson::get($call_info['call_log_username']);
    $groupInfo = getGroupInfo($call_info['its_group_assigned_to']);
    $call_log_employee = checkEmployee($call_info['call_log_username']);
    $assigned_employee = checkEmployee($call_info['tlc_assigned_to']);
    $to = array();
    // always send to the submitter if the submitter is an employee
    if ($call_log_employee) {
        if ($logger->system_account_exists) {
            $to[] = $logger->wp_email;
        }
        //end
    } else {
        $end_user_to = $logger->wp_email;
    }
    //end else
    if ($action == "its_staff") {
        $call_info['call_id'] = $call_info['new_call_id'] . $call_info['call_id'];
        $call_info['comments'] = $call_info['problem_details'] . $call_info['comments'];
        if ($call_info['tlc_assigned_to'] != "unassigned") {
            if ($assigned_employee) {
                $to[] = PSUPerson::get($call_info['tlc_assigned_to'])->wp_email;
            } elseif ($call_info['tlc_assigned_to'] == 'caller' && $call_info['call_id']) {
                $sql = "SELECT caller_username \n\t\t\t\t\t\t\t\t\tFROM call_log \n\t\t\t\t\t\t\t\t WHERE call_log.call_id = ?";
                $end_user_to = $db->GetOne($sql, array($call_info['call_id']));
                if ($end_user_to) {
                    $end_user = PSUPerson::get($end_user_to);
                    if ($end_user) {
                        $end_user_to = $end_user->wp_email;
                    }
                }
                //end if
            } else {
                $end_user = PSUPerson::get($call_info['tlc_assigned_to']);
                $end_user_to = $end_user->wp_email;
            }
            //end if
        }
        //end if
        if ($call_info['its_assigned_group'] != 0) {
            $sql = "SELECT email_to \n\t\t\t\t\t\t\t\tFROM   itsgroups\n\t\t\t\t\t\t\t\t     , call_log \n\t\t\t\t\t\t\t\t\t\t , call_history \n\t\t\t\t\t\t\t WHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id \n\t\t\t\t\t\t\t\t AND itsgroups.itsgroupid = ?\n\t\t\t           AND call_log.call_id = ?";
            $email_to = $db->GetOne($sql, array($call_info['its_assigned_group'], $call_info['call_id']));
            if ($email_to == 'all') {
                $sql = "SELECT user_name\n\t\t\t\t\t\t\t\t\tFROM   itsgroups\n\t\t\t\t\t\t\t\t\t     , its_employee_groups\n\t\t\t\t\t\t\t\t\t     , call_log_employee\n\t\t\t\t\t\t\t\t\tWHERE itsgroups.deleted = 0 \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.call_log_user_id = its_employee_groups.employee_id \n\t\t\t\t\t\t\t\t\t\tAND its_employee_groups.group_id = ?\n\t\t\t\t\t\t\t\t\t\tAND itsgroups.itsgroupid = its_employee_groups.group_id \n\t\t\t\t\t\t\t\t\t\tAND call_log_employee.status = 'active' \n\t\t\t\t            AND its_employee_groups.option_id = '2'";
                $email_list = $db->GetCol($sql, array($call_info['its_assigned_group']));
            } else {
                $email_list = explode(',', $email_to);
            }
            //end else
            foreach ((array) $email_list as $identifier) {
                $user = PSUPerson::get($identifier);
                $to[] = $user->wp_email;
            }
            //end foreach
        }
        //end if
        if ($call_info['its_group_assigned_to'] != 0) {
            $subject = '[Call Log] [' . $groupInfo[1] . '] ' . $caller_data['name_full'];
        } else {
            $subject = '[Call Log] ' . $caller_data['name_full'];
        }
        $subject .= ' (#' . $call_info['call_id'] . ')';
        if ($call_info['call_status'] == 'closed') {
            $subject .= ' [CLOSED]';
            // always send close to the owner, if they are allowed to see the
            // full history
            $caller_identifier = $db->GetOne("SELECT calllog_username FROM call_log WHERE call_log.call_id = '{$call_info['call_id']}'");
            $caller_user = PSUPerson::get($caller_identifier);
            if ($GLOBALS['end_user_email']) {
                $closing_user = PSUPerson::get($_SESSION['wp_id']);
                if ($caller_user->wp_email == $closing_user->wp_email) {
                    $end_user_to = $closing_user->wp_email;
                }
                //end if
            } elseif (checkEmployee($caller_to)) {
                $to[] = $caller_user->wp_email;
            }
            //end else
        }
        $sql = "SELECT * \n\t\t\t\t\t\t\tFROM   call_log\n\t\t\t\t\t\t\t     , call_history \n\t\t\t\t\t\t WHERE call_log.call_id = ?\n\t\t\t\t\t\t\t AND call_log.call_id = call_history.call_id\n\t\t\t\t\t\t ORDER BY date_assigned DESC\n\t\t               , time_assigned DESC";
        $call_info_query = $db->Execute($sql, array($call_info['call_id']));
        foreach ($call_info_query as $call_info2) {
            $group_name = getGroupInfo($call_info2['its_assigned_group']);
            if ($group_name[0] == '') {
                $group_name = 'Unassigned';
            } else {
                $group_name = $group_name[0];
            }
            $call_info2['group_name'] = $group_name;
            $call_info2['update_date'] = $call_info2['date_assigned'] . ' ' . $call_info2['time_assigned'];
            if ($call_info2['tlc_assigned_to'] && $call_info2['tlc_assigned_to'] != 'unassigned') {
                if (!$person_cache[$call_info2['tlc_assigned_to']]) {
                    $person_cache[$call_info2['tlc_assigned_to']] = PSUPerson::get($call_info2['tlc_assigned_to']);
                }
                //end else
                $call_info2['assigned_to'] = $call_info2['tlc_assigned_to'];
            }
            //end if
            if ($call_info2['updated_by']) {
                if (!$person_cache[$call_info2['updated_by']]) {
                    $person_cache[$call_info2['updated_by']] = PSUPerson::get($call_info2['updated_by']);
                }
                //end else
                $call_info2['logger'] = $call_info2['updated_by'];
            }
            //end if
            $history[] = $call_info2;
        }
        $caller_id = $caller_data['identifier'];
        if (!$person_cache[$caller_id]) {
            $person_cache[$caller_id] = PSUPerson::get($caller_id);
        }
        //end else
        $current = array_slice($history, 0, 1);
        $current = $current[0];
        // email ITS
        $tpl = new PSUTemplate();
        $tpl->assign('caller', $caller_data);
        $tpl->assign('caller_id', $caller_id);
        $tpl->assign('pcache', $person_cache);
        $tpl->assign('call', $call_info);
        $tpl->assign('current', $current);
        $tpl->assign('history', array_slice($history, 1));
        $text_message = $tpl->fetch('email.ticket.text.tpl');
        $html_message = $tpl->fetch('email.ticket.html.tpl');
        $to = implode(',', array_unique($to));
        if ($to) {
            $headers['from'] = $logger->formatName('f l') . ' <' . $logger->wp_email . '>';
            PSU::mail($to, $subject, array($text_message, $html_message), $headers);
        }
        //end if
        // email user
        if ($end_user_to) {
            $headers['from'] = 'Support Tickets <*****@*****.**>';
            $tpl->assign('is_caller', true);
            $tpl->assign('history', array());
            $text_message = $tpl->fetch('email.ticket.text.tpl');
            $html_message = $tpl->fetch('email.ticket.html.tpl');
            PSU::mail($end_user_to, $subject, array($text_message, $html_message), $headers);
        }
        //end if
    }
}
예제 #12
0
     // yes
     $tooltip = array();
     foreach ($checklist_checked as &$checked) {
         $item_id = $checked['item_id'];
         $tooltip[$item_id]['item_id'] = $item_id;
         $tooltip[$item_id]['updated_by'] = PSUPerson::get($checked['updated_by'])->formatname('f l');
         $tooltip[$item_id]['updated_time'] = $checked["activity_date"];
         $checked = $checked['item_id'];
     }
     $last_modified_info = TrainingTracker::last_modified($checklist_id);
     $last_modified = $last_modified_info['time'];
     $modified_by = $last_modified_info['modified_by'];
 }
 //the title is the title name in the box.
 if (strlen($modified_by) > 2) {
     $title = $current_user->person()->formatName('f l') . ' - Last modified by ' . PSUPerson::get($modified_by)->formatname('f l') . ' on ' . $last_modified . '.';
 } else {
     $title = $current_user->person()->formatName('f l');
 }
 //getting comments
 $comments = TrainingTracker::get_comments($checklist_id);
 $staff_collection = new TrainingTracker\StaffCollection();
 //get the people that work at the helpdesk
 $staff_collection->load();
 $mentor = $staff_collection->mentors();
 //select all the mentors
 $mentee = $staff_collection->mentees();
 //select all the mentees
 //populating some variables to generate the checklist.
 $checklist_builder = TrainingTracker::checklist_builder($current_user_level, $current_user->wpid);
 $checklist_items = $checklist_builder['items'];
예제 #13
0
 /**
  * renders a template that displays relationships that have granted a specific permission
  */
 function myrel_permission_grants($params, $type = 'select')
 {
     if (!$params['permission']) {
         return '<strong><code>Permission must be specified in order to use myrel_' . $type . '</code></strong>';
     }
     //end if
     // instantiate a new smarty object because we don't want to inherit
     // or override any variables
     $tpl = new self();
     if ($params['user'] instanceof \PSUPerson) {
         $myuser = $params['user'];
     } elseif ($params['user']) {
         $myuser = \PSUPerson::get($params['user']);
     } elseif ($_SESSION['wp_id']) {
         $myuser = \PSUPerson::get($_SESSION['wp_id']);
     } else {
         $myuser = \PSUPerson::get($_SESSION['pidm']);
     }
     //end else
     if ($params['selected'] instanceof \PSUPerson) {
         $selected_user = $params['selected'];
     } elseif ($params['selected']) {
         $selected_user = \PSUPerson::get($params['selected']);
     }
     //end else
     $myuser->pidm;
     if ($params['hide_self']) {
         if (!isset($myuser->pidm)) {
             $tpl->assign('family_member', true);
         } else {
             $tpl->assign('family_member', false);
         }
     }
     $tpl->assign('myuser', $myuser);
     $tpl->assign('selected', $selected_user);
     $tpl->assign('type', $type);
     $tpl->assign('permission', $params['permission']);
     $tpl->assign('identifier', $params['identifier'] ? $params['identifier'] : 'id');
     if ($params['url']) {
         if (strpos($params['url'], '?') === false) {
             $tpl->assign('no_url_params', true);
         }
         $tpl->assign('url', $params['url']);
     }
     //end if
     //check if we want a question mark added to our identifier
     if ($params['no_qm']) {
         $tpl->assign('no_qm', true);
     }
     //end question mark check
     return $tpl->fetch(PSU_BASE_DIR . '/app/core/templates/myrelationships.permission_grants.tpl');
 }
예제 #14
0
    $app->breadcrumbs->push(new \PSU\Template\Breadcrumb($app->gate_system->name, $app->resolver($app->gate_system)));
});
respond('/[:gate_system]/?', function ($request, $response, $app) {
    $app->tpl->display('gate-system.tpl');
});
respond('/[:gate_system]/gate/[:gate]/?[*]?', function ($request, $response, $app) {
    $gate_id = $request->param('gate');
    $gate = TeacherCert\Gate::get($gate_id);
    $app->populate('gate', $gate);
    $app->breadcrumbs->push($app->gate->name);
    $app->tpl->display('gate.tpl');
});
respond('POST', '/[:gate_system](/gate/[:gate])?/add-student/?', function ($request, $response, $app) {
    $response->deny_to_readonly();
    $student_id = $request->param('student_id');
    $person = \PSUPerson::get($student_id);
    $redirect = $GLOBALS['BASE_URL'] . '/gate-system/' . $app->gate_system->slug;
    if ($gate) {
        $redirect .= '/gate/' . $gate->slug;
    }
    //end if
    if ($app->gate_system->level_code == 'ug' && !$person->student->ug) {
        $_SESSION['errors'][] = "{$person->formatName('l, f m')} is not an active UG student!";
        $response->redirect($redirect, 400);
    } elseif ($app->gate_system->level_code == 'gr' && !$person->student->gr) {
        $_SESSION['errors'][] = "{$person->formatName('l, f m')} is not an active GR student!";
        $response->redirect($redirect, 400);
    }
    //end if
    $student = new TeacherCert\Student($person->pidm);
    $in_system = false;
    $cron->lock();
}
//end if
$time = time();
$one_month_ago = strtotime('-1 month');
$sql = "SELECT * FROM v_emp_clearance_candidates";
if ($results = PSU::db('banner')->Execute($sql)) {
    foreach ($results as $row) {
        if ($checklist = HRChecklist::get($row['pidm'], 'employee-exit')) {
            if ($checklist['position_code'] == $row['position_code'] && strtotime($checklist['activity_date']) >= $one_month_ago) {
                continue;
            }
            //end if
        }
        //end if
        $person = PSUPerson::get($row['pidm']);
        $response = HRChecklist::start($person->pidm, strtotime($row['end_date']), 'employee-exit', $row['position_code'], 0);
        $checklist_id = $response->id;
        if ($checklist_id) {
            HRChecklist::email($person, strtotime($row['end_date']), 'ape_checklist_employee_exit', 2, 'employee-exit', $checklist_id, $response);
        }
        //end if
    }
    //end foreach
}
//end if
if ($command_line) {
    $cron->stopTimer();
    $cron->log('Employee Exit Checklist Trigger completed (Run Time: ' . $cron->getRunTime() . ')');
    $cron->unlock();
}
/**
 * reset the expiration date on person_phone so that they are prompted to sign up with and re-confirm mobile number when logging into myPlymouth
 */
try {
    // can the user perform this action?
    if (!IDMObject::authZ('permission', 'mis') && !APEAuthZ::infodesk()) {
        throw new Exception('You are not authorized to reset emergency phone information.');
    }
    // end if
    // did we get all the needed data?
    if (!isset($_GET['wp_id'])) {
        throw new Exception('wp_id was missing in request.');
    }
    // end if
    $person = PSUPerson::get($_GET['wp_id']);
    if ($ok = $person->emergency_phone->unconfirm()) {
        $GLOBALS['LOG']->write('Emergency phone reset', $_GET['wp_id']);
        $response['message'] = 'Emergency number reset.  They will be prompted to confirm on next login (assuming they are a student/employee)';
        $response['status'] = 'success';
    } else {
        throw new Exception('Error resetting: ' . $ok);
    }
    // end else
} catch (Exception $e) {
    $response['message'] = $e->getMessage();
}
// end catch
//
// ajax requests end here
//
예제 #17
0
 /**
  * get roles for a user
  *
  * @deprecated Portal roles are deprecated, use IDMObject::getAllBannerRoles()
  *
  * @param string $search
  * @param string $type
  * @return array
  */
 function getRoles($search, $type = 'pdsLoginId')
 {
     trigger_error('portal::getRoles() is deprecated, use IDMObject', E_USER_DEPRECATED);
     $person = PSUPerson::get($search);
     // if possible, return current user's banner roles
     if (isset($_SESSION['wp_id']) && $person->wp_id == $_SESSION['wp_id'] && isset($_SESSION['AUTHZ']) && isset($_SESSION['AUTHZ']['banner'])) {
         return array_values($_SESSION['AUTHZ']['banner']);
     }
     return PSU::get('idmobject')->getAllBannerRoles($search);
 }
예제 #18
0
 public function stats($parameter = null)
 {
     $wpid = $this->wpid;
     $person = \PSUPerson::get($wpid);
     $pidm = $person->pidm;
     $username = $person->username;
     $checklist_id = \PSU::db('hr')->GetOne("SELECT id FROM person_checklists WHERE pidm=?", array($pidm));
     $checkboxes = \PSU::db('hr')->GetAll("SELECT * FROM person_checklist_items WHERE checklist_id=? AND response=?", array($checklist_id, "complete"));
     $current_level = \PSU::db('calllog')->GetOne("SELECT user_privileges FROM call_log_employee WHERE user_name=?", array($username));
     $completed = sizeof($checkboxes);
     if ($current_level == 'trainee') {
         $search = array("13", "14", "15", "16", "31");
     } else {
         if ($current_level == 'sta') {
             $search = array("17", "18", "19", "20", "21", "22", "23", "24");
         } else {
             $search = array("25", "26", "27", "28", "29", "30");
         }
     }
     $stats = array();
     foreach ($search as $item) {
         $stat = \PSU::db('hr')->GetAll("SELECT items.item_id\tFROM person_checklist_items items \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  JOIN person_checklists checklist \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t    ON items.checklist_id = checklist.id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  JOIN checklist_item_categories categories \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t    ON categories.type = checklist.type\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t  JOIN checklist_items checklist_items\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t    ON checklist_items.id = items.item_id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE items.checklist_id = checklist.id \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   AND checklist.type = categories.type\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t     AND categories.id=?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   AND items.response=?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   AND checklist_items.category_id = categories.id\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t   AND checklist.pidm=?", array($item, "complete", $pidm));
         $stat = sizeof($stat);
         if ($item == 13) {
             $stat = $stat / 5;
         } else {
             if ($item == 14) {
                 $stat = $stat / 9;
             } else {
                 if ($item == 31) {
                     $stat = $stat / 5;
                 } else {
                     if ($item == 15) {
                         $stat = $stat / 8;
                     } else {
                         if ($item == 16) {
                             $stat = $stat / 5;
                         } else {
                             if ($item == 17) {
                                 $stat = $stat / 6;
                             } else {
                                 if ($item == 18) {
                                     $stat = $stat / 4;
                                 } else {
                                     if ($item == 19) {
                                         $stat = $stat / 8;
                                     } else {
                                         if ($item == 20) {
                                             $stat = $stat / 3;
                                         } else {
                                             if ($item == 21) {
                                                 if ($stat > 2) {
                                                     $stat = 2;
                                                 }
                                                 $stat = $stat / 2;
                                             } else {
                                                 if ($item == 22) {
                                                     $stat = $stat / 4;
                                                 } else {
                                                     if ($item == 23) {
                                                         if ($stat > 1) {
                                                             $stat = 1;
                                                         }
                                                     } else {
                                                         if ($item == 24) {
                                                             $stat = $stat / 4;
                                                         } else {
                                                             if ($item == 25) {
                                                                 $stat = $stat / 5;
                                                             } else {
                                                                 if ($item == 26) {
                                                                     $stat = $stat / 3;
                                                                 } else {
                                                                     if ($item == 27) {
                                                                         $stat = $stat / 2;
                                                                     } else {
                                                                         if ($item == 28) {
                                                                             $stat = $stat / 2;
                                                                         } else {
                                                                             if ($item == 29) {
                                                                                 $stat = $stat / 4;
                                                                             } else {
                                                                                 if ($item == 30) {
                                                                                     $stat = $stat / 4;
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
         $stats["{$item}"] = round($stat * 100, 2);
     }
     $total = 0;
     $ct = 0;
     foreach ($stats as $statistic) {
         $ct++;
         $total += $statistic;
     }
     $progress = round($total / $ct, 2);
     $stats['progress'] = $progress;
     return isset($parameter) ? $stats[$parameter] : $stats;
 }
예제 #19
0
 public function __construct($identifier, $term_code = null)
 {
     parent::__construct();
     if ($identifier instanceof \PSUPerson) {
         $this->person = $identifier;
     } else {
         $this->person = \PSUPerson::get($identifier);
     }
     //end else
     if ($this->person->include_non_bill_entries) {
         $this->include_non_bill_entries = true;
     }
     //end if
     $this->pidm = $this->person->pidm;
     $this->data_loaders = array('all_term_current_amount' => 'prepareTermBill', 'earliest_unsatisfied_term_remaining' => 'earliest_unsatisfied_term', 'other_term_current_amount' => 'prepareTermBill', 'other_term_net_amount' => 'prepareTermBill', 'other_term_aid_total' => 'other_term_aid', 'term_current_amount' => 'prepareTermBill', 'term_future_amount' => 'prepareTermBill', 'total_negative_balances' => 'all_term_balances', 'total_positive_balances' => 'all_term_balances', 'aid_total' => 'aid', 'memo_total' => 'memos', 'deposit_total' => 'deposits', 'misc_memos' => 'memos', 'receivable_total' => 'receivable', 'receivables' => 'receivable');
     if ($term_code) {
         $this->term_code = $term_code;
     }
     //end if
 }
 public function demerit_get($wpid)
 {
     $pidm = \PSUPerson::get($wpid)->pidm;
     $sql = "SELECT i.* FROM person_checklist_items i JOIN person_checklists c ON (i.checklist_id = c.id) WHERE c.pidm = ? AND i.response = ?";
     $demerits = PSU::db('hr')->GetAll($sql, array($pidm, 'demerit'));
     return $demerits;
 }
예제 #21
0
 /**
  * lazy loads an array of active advisor records
  */
 protected function _load_advisors()
 {
     $this->advisors = array();
     $query = "SELECT *\n\t\t\t\t\t\t\t FROM sgradvr a,spriden\n\t\t\t\t\t\t\tWHERE a.sgradvr_pidm = :pidm\n\t\t\t\t\t\t\t\tAND a.sgradvr_advr_pidm = spriden_pidm\n\t\t\t\t\t\t\t\tAND spriden_change_ind is null\n\t\t\t\t\t\t\t\tAND a.sgradvr_term_code_eff =\n\t\t\t\t\t\t\t\t\t\t\t(SELECT MAX (b.sgradvr_term_code_eff)\n\t\t\t\t\t\t\t\t\t\t\t\tFROM sgradvr b\n\t\t\t\t\t\t\t\t\t\t\t WHERE b.sgradvr_pidm = a.sgradvr_pidm\n\t\t\t\t\t\t\t\t\t\t\t\t AND b.sgradvr_term_code_eff <= :term_code)\n\t\t\t\t\t\t\t\tAND a.sgradvr_advr_pidm in\n\t\t\t\t\t\t\t\t\t\t\t(SELECT c.sgradvr_advr_pidm\n\t\t\t\t\t\t\t\t\t\t\t\t FROM sgradvr c\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE c.sgradvr_term_code_eff=a.sgradvr_term_code_eff\n\t\t\t\t\t\t\t\t\t\t\t\t\tAND c.sgradvr_pidm=a.sgradvr_pidm)\n\t\t\t\t\t\t\t AND EXISTS (SELECT 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t FROM sgbstdn,sobcurr\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE sgbstdn_pidm = :pidm\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_stst_code = 'AS'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_styp_code <> 'X'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_levl_code=sobcurr_levl_code\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_degc_code_1=sobcurr_degc_code\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_program_1=sobcurr_program\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sobcurr_secd_roll_ind='Y'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sobcurr_term_code_init<=:term_code\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND sgbstdn_term_code_eff =\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (SELECT MAX (sg.sgbstdn_term_code_eff)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM sgbstdn sg\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE sg.sgbstdn_pidm = :pidm))\n\t\t\t\t\tORDER BY a.sgradvr_prim_ind DESC,\n\t\t\t\t\t\t\tspriden_last_name,\n\t\t\t\t\t\t\tspriden_first_name";
     $args = array('pidm' => $this->pidm, 'term_code' => $this->term_code);
     if ($results = \PSU::db('banner')->Execute($query, $args)) {
         foreach ($results as $row) {
             $person = \PSUPerson::get($row['sgradvr_advr_pidm']);
             $person->advisor_term_code_eff = $row['sgradvr_term_code_eff'];
             $person->advisor_primary_ind = $row['sgradvr_prim_ind'];
             $this->data['advisors'][] = $person;
         }
         //end while
     }
     //end if
 }
예제 #22
0
<?php

use PSU\TeacherCert;
respond('/', function ($request, $response, $app) {
    if (!$app->permissions->pidm) {
        die('Could not find your user identifier.');
    }
    $student = PSUPerson::get($app->permissions->pidm);
    $response->redirect($GLOBALS['BASE_URL'] . '/student/' . $student->id);
});
respond('/[:psu_id]/?[*]?', function ($request, $response, $app) {
    if (!$app->permissions->pidm) {
        die('Could not find your user identifier.');
    }
    $person = PSUPerson::get($request->param('psu_id'));
    if ($app->permissions->pidm != $person->pidm && !$app->permissions->can_search()) {
        $response->denied();
    }
    $app->populate(new TeacherCert\Student($person->pidm));
});
respond('/[:psu_id]', function ($request, $response, $app) {
    $app->tpl->display('student-gate-systems.tpl');
});
respond('/[:psu_id]/[i:sgs_id]', function ($request, $response, $app) {
    $sgs_id = $request->param('sgs_id');
    $student_gate_system = new TeacherCert\Student\GateSystem($sgs_id);
    // does current user match the requested gate system?
    if ($student_gate_system->pidm != $app->student->pidm) {
        $response->denied();
    }
    $app->populate($student_gate_system);
 public function url($user)
 {
     $person = PSUPerson::get($user);
     if (!$person->pidm) {
         throw new ECommerceException(ECommerceException::INVALID_PIDM);
     }
     $processor = 'UG Tuition/Housing Deposit';
     $server = $_SERVER['URANUS'] ? 'test' : 'prod';
     $term_code_entry = PSU::db('banner')->GetOne("SELECT term_code_entry FROM v_ug_app WHERE pidm = :pidm", array('pidm' => $person->pidm));
     if ($person->isActiveStudent() || $term_code_entry) {
         $this->setURLParam('userChoice2', PSU::nvl($person->student->ug->term_code_admit, $term_code_entry, \PSU\Student::getCurrentTerm('UG')));
         $this->setURLParam('orderType', $processor);
         $this->setURLParam('orderNumber', $person->id);
         $this->setURLParam('orderName', $person->formatName('l, f m'));
         $this->setURLParam('orderDescription', $processor);
         return $this->_url($server);
     } else {
         throw new ECommerceException(ECommerceException::INVALID_STUDENT);
     }
     //end else
 }
예제 #24
0
 /**
  * returns the person associated with this record
  */
 public function person()
 {
     return \PSUPerson::get($this->psu_id);
 }
예제 #25
0
 /**
  * inits the person object
  *
  * @params $ident \b Person identifier OR PSUPerson object
  */
 private function _init_person($ident)
 {
     if (is_object($ident)) {
         $this->person = $ident;
     } else {
         $this->person = \PSUPerson::get($ident);
     }
     //end if
     // throw an error if this person doesn't have a pidm
     if (!$this->person->pidm) {
         throw new \Exception('The Person with an identifier of ' . $ident . ' does not have a pidm');
     }
     //end if
 }
예제 #26
0
$GLOBALS['TEMPLATES'] = $GLOBALS['BASE_DIR'] . '/templates';
$GLOBALS['EMERGENCY_GROUP'] = 8306124;
require_once 'klein/klein.php';
if (file_exists($GLOBALS['BASE_DIR'] . '/debug.php')) {
    include $GLOBALS['BASE_DIR'] . '/debug.php';
}
IDMObject::authN();
/**
 * Routing provided by klein.php (https://github.com/chriso/klein.php)
 * Make some objects available elsewhere.
 */
respond(function ($request, $response, $app) {
    // initialize the template
    $app->tpl = new PSUTemplate();
    // get the logged in user
    $app->user = PSUPerson::get($_SESSION['wp_id']);
    $app->groups = array();
    // assign user to template
    $app->tpl->assign('user', $app->user);
    $app->config = new PSU\Config();
    $app->config->load();
    if ('Registered and confirmed' == $app->user->rave_state) {
        $rave_user = \PSU\Rave\User::get($app->user->wpid);
        $app->rave_user = $rave_user;
        // get the rave users groups for the app
        $app->user_groups = array();
        foreach ($app->rave_user->groups() as $group) {
            $app->user_groups[] = $group->attributes()->__toString();
        }
        //end foreach
        // assign all of the groups to the template
 /**
  * Return the age, in days, of a user's password.
  * @param $ident an identifier to pass to PSUPerson::get()
  * @return int the password age
  */
 function passwordAge($ident)
 {
     $person = PSUPerson::get($ident);
     $ad_info = PSU::get('ad')->user_info($person->login_name, array('pwdlastset'));
     // 116444736000000000 = 10000000 * 60 * 60 * 24 * 365 * 369 + 89 leap days huh.
     $ad_stamp = round(($ad_info[0]['pwdlastset'][0] - 116444736000000000) / 10000000);
     $change_date = date('F j, Y', $ad_stamp);
     $seconds = time() - $ad_stamp;
     $days = round($seconds / 60 / 60 / 24);
     return $days;
 }