/** * Adds an event after checking to see if there should be a flag * to remind the receptionist to re-administer a DASS * @param array $data The POST data */ public function addEvent(array $data) { //Check to see if its a "personal counselling" appointment if (isset($data['student']) && !empty($data['student']) && ((int) $data['appointment_type_id'] === self::PERSONAL_COUNSELLING_APPOINTMENT_TYPE || (int) $data['appointment_type_id'] === self::COACHING_APPOINTMENT_TYPE)) { $last = $this->getLastDassAlertAppointment($data['student']); $pCounsellingCount = $last ? $this->getAppointmentCountSinceLastDassAlert($data['student'], PERSONAL_COUNSELLING_APPOINTMENT_TYPE, $last) : $this->getAppointmentCountSinceLastDassAlert($data['student'], self::PERSONAL_COUNSELLING_APPOINTMENT_TYPE); if ($pCounsellingCount > 0) { $coachingCount = $this->getAppointmentCountSinceLastDassAlert($data['student'], self::COACHING_APPOINTMENT_TYPE); $total = $pCounsellingCount + $coachingCount; if ($total % COUNSELLING_DASS_REMINDER_COUNT === 0) { $data['dass_alert'] = 1; } } } parent::insertEvent($data, SERVICE_ID_COUNSELLING); }
/** * Adds an event * @param array $data The POST data */ public function addEvent(array $data) { parent::insertEvent($data, SERVICE_ID_ACCESS); }