} //end if $closed_person = HRChecklist::get_meta($checklist['id'], 'closed_marked_by', 1); $closed_person = $closed_person['meta_value']; if ($closed_person) { $pdf->SetFont('Arial', 'B', 13); $pdf->setTextColor(120, 7, 41); $closed_person = new PSUPerson($closed_person); $pdf->Cell(190, 5, 'This Employee Clearance Form has been closed by ' . $closed_person->formatName('f m l') . '.', 0, 1, 'L'); $pdf->setTextColor(0, 0, 0); $pdf->SetFont('Arial', '', 10); $pdf->ln(5); } //end if foreach ($categories as $category) { $checklist_items[$category['name']] = HRChecklist::checklist_items($category['id']); } //end foreach if (!$checklist_items) { if (APEAuthZ::employee_clearance()) { $pdf->setTextColor(120, 7, 41); $pdf->Cell(190, 5, 'The employee clearance process has not been started for this individual', 0, 1, 'L'); $pdf->setTextColor(0, 0, 0); } if (APEAuthZ::employee_clearance()) { if ($complete && !$closed) { $pdf->setTextColor(120, 7, 41); $pdf->Cell(190, 5, 'It appears as if all of the items have been reviewed and completed.', 0, 1, 'L'); $pdf->setTextColor(0, 0, 0); } }
/** * determines if checklist is complete */ public static function is_complete($list, $checklist_id) { $categories = HRChecklist::categories($list, 'id'); $items = HRChecklist::checklist_items($categories); foreach ($items as $item) { $response = self::item_response($item['id'], $checklist_id); if ($response != 'complete' && $response != 'n/a') { return false; } //end if } //end foreach return true; }