function getJSCalendarPayPeriodArray($include_all_pay_period_schedules = FALSE) { global $current_company, $current_user; if (!is_object($current_company)) { return FALSE; } if ($include_all_pay_period_schedules == TRUE) { $cache_id = 'JSCalendarPayPeriodArray_' . $current_company->getId() . '_0'; } else { $cache_id = 'JSCalendarPayPeriodArray_' . $current_company->getId() . '_' . $current_user->getId(); } if (!is_object($current_company)) { return FALSE; } if (!is_object($current_user)) { return FALSE; } $retarr = $this->getCache($cache_id); if ($retarr === FALSE) { $pplf = new PayPeriodListFactory(); if ($include_all_pay_period_schedules == TRUE) { $pplf->getByCompanyId($current_company->getId(), 13); $cache_id = 'JSCalendarPayPeriodArray_' . $current_company->getId() . '_0'; } else { $pplf->getByUserId($current_user->getId(), 13); $cache_id = 'JSCalendarPayPeriodArray_' . $current_company->getId() . '_' . $current_user->getId(); } $retarr = FALSE; if ($pplf->getRecordCount() > 0) { foreach ($pplf as $pp_obj) { //$retarr['start_date'][] = TTDate::getDate('Ymd', $pp_obj->getStartDate() ); $retarr['end_date'][] = TTDate::getDate('Ymd', $pp_obj->getEndDate()); $retarr['transaction_date'][] = TTDate::getDate('Ymd', $pp_obj->getTransactionDate()); } } $this->saveCache($retarr, $cache_id); } return $retarr; }