function pdf_info() { //checklist subject $format = 'f m l'; $info['person_name'] = parent::get_name($this->user, $format); //checklist categories $info['categories'] = HRChecklist::categories($this->checklist_type); //category items foreach ($info['categories'] as &$category) { $category['items'] = HRChecklist::get_items($category); } //checklist info .... date created, id, user, type. the latter two should already be defined before this point. $info['checklist_info'] = HRChecklist::get($this->user, $this->type); $info['checklist_info']['title'] = self::format_type_slug($info['checklist_info']['type']) . ' Checklist'; //checklist status $info['is_complete'] = HRChecklist::is_complete($this->type, $info['checklist_info']['id']); //if a closed date exists if (HRChecklist::get_meta($info['checklist_info']['id'], 'closed', 'activity_date')) { $info['checklist_info']['closed_date'] = HRChecklist::get_meta($info['checklist_info']['id'], 'closed', 'activity_date'); $info['closed_date'] = new DateTime($info['checklist_info']['closed_date']['activity_date']); $info['closed_date'] = $info['closed_date']->format('l F j, Y'); } return $info; }
$pdf->SetFont('Arial', '', 10); //identifiers $pdf->SetFillColor(5, 66, 6); $pdf->SetTextColor(255, 255, 255); $fill = true; $pdf->SetFont('Arial', '', 13); $pdf->Cell(190, 7, 'Employee Clearance Checklist for ' . $person->formatName('f m l'), 0, 1, 'C', $fill); $pdf->SetFont('Arial', '', 10); $pdf->Cell(190, 6, 'Username: '******'C', $fill); $pdf->setTextColor(5, 66, 6); $pdf->ln(5); $checklist_items = array(); $categories = array(); $checklist = HRChecklist::get($person->pidm, $list); $categories = HRChecklist::categories($checklist['type']); $checklist_id = HRChecklist::get($person->pidm, $list, 'id'); $closed = HRChecklist::meta_exists($checklist_id, 'closed', 1); if (IDMObject::authZ('permission', 'ape_checklist_employee_exit_hr')) { if ($_POST['checklist_closed'] && !$closed) { HRChecklist::add_meta($checklist_id, 'closed', 1); HRChecklist::toggle_checklist($checklist_id, $_REQUEST['identifier'], true); HRChecklist::add_meta($checklist_id, 'closed_marked_by', $_SESSION['pidm']); } elseif (!$_POST['checklist_closed'] && $closed) { HRChecklist::add_meta($checklist_id, 'closed', 0); HRChecklist::toggle_checklist($checklist_id, $_REQUEST['identifier'], false); HRChecklist::add_meta($checklist_id, 'closed_marked_by', $_SESSION['pidm']); } //end elseif } //end if $closed_person = HRChecklist::get_meta($checklist['id'], 'closed_marked_by', 1);
require_once $GLOBALS['BASE_DIR'] . '/includes/HRChecklist.class.php'; $cron = new cron('checklist-trigger', 'page_threshold=20'); if ($cron->checkLock()) { $cron->log('Employee Exit Checklist Trigger is already running'); exit; } //end if $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