$clf->getAll(); if ($clf->getRecordCount() > 0) { foreach ($clf as $c_obj) { if ($c_obj->getStatus() != 30) { $ppslf = new PayPeriodScheduleListFactory(); $ulf = new UserListFactory(); $ulf->getByCompanyId($c_obj->getId()); if ($ulf->getRecordCount() > 0) { $i = 0; foreach ($ulf as $u_obj) { if ($u_obj->getStatus() != 10) { continue; } Debug::text($i . '. User: '******'22-Jan-08'); UserDateFactory::findOrInsertUserDate($u_obj->getId(), TTDate::getBeginDayEpoch($epoch)); } $i++; } } } else { Debug::text('Company is not ACTIVE: ' . $c_obj->getId(), __FILE__, __LINE__, __METHOD__, 10); } }
$blf = new BranchListFactory(); $branch_options = $blf->getByCompanyIdArray($current_company->getId()); $dlf = new DepartmentListFactory(); $department_options = $dlf->getByCompanyIdArray($current_company->getId()); $pclf = new PermissionControlListFactory(); $pclf->getByCompanyId($current_company->getId()); $permission_control_options = $pclf->getArrayByListFactory($pclf, TRUE); $ppslf = new PayPeriodScheduleListFactory(); $pay_period_schedule_options = $ppslf->getByCompanyIDArray($current_company->getId()); $pglf = new PolicyGroupListFactory(); $policy_group_options = $pglf->getByCompanyIDArray($current_company->getId()); $pclf = new PermissionControlListFactory(); $pclf->getByCompanyIdAndUserId($current_company->getId(), $filter_data['user_ids']); $permission_control_user_map = $pclf->getUserToPermissionControlMapArrayByListFactory($pclf); $ppslf = new PayPeriodScheduleListFactory(); $ppslf->getByCompanyIdAndUserId($current_company->getId(), $filter_data['user_ids']); $pay_period_schedule_user_map = $ppslf->getUserToPayPeriodScheduleMapArrayByListFactory($ppslf); $pglf = new PolicyGroupListFactory(); $pglf->getByCompanyIdAndUserId($current_company->getId(), $filter_data['user_ids']); $policy_group_user_map = $pglf->getUserToPolicyGroupMapArrayByListFactory($pglf); $crlf = new CurrencyListFactory(); $crlf->getByCompanyId($current_company->getId()); $currency_options = $crlf->getArrayByListFactory($crlf, FALSE, TRUE); $upf = new UserPreferenceFactory(); $language_options = TTi18n::getLanguageArray(); $date_format_options = $upf->getOptions('date_format'); $time_format_options = $upf->getOptions('time_format'); $time_unit_format_options = $upf->getOptions('time_unit_format'); $timesheet_view_options = $upf->getOptions('timesheet_view'); $start_week_day_options = $upf->getOptions('start_week_day'); $time_zone_options = $upf->getOptions('time_zone');
Debug::text('Pay Period Object Found!', __FILE__, __LINE__, __METHOD__, 10); $is_assigned_pay_period_schedule = TRUE; //Don't use assign_by_ref for these as that seems to trigger a fatal error in PHP v5.0.4 $smarty->assign('pay_period_id', $pay_period_obj->getId()); $smarty->assign('pay_period_start_date', $pay_period_obj->getStartDate()); $smarty->assign('pay_period_end_date', $pay_period_obj->getEndDate()); $smarty->assign('pay_period_verify_window_start_date', $pay_period_obj->getTimeSheetVerifyWindowStartDate()); $smarty->assign('pay_period_verify_window_end_date', $pay_period_obj->getTimeSheetVerifyWindowEndDate()); $smarty->assign('pay_period_transaction_date', $pay_period_obj->getTransactionDate()); $smarty->assign('pay_period_is_locked', $pay_period_obj->getIsLocked()); $smarty->assign('pay_period_status_id', $pay_period_obj->getStatus()); } else { Debug::text('Pay Period Object NOT Found!', __FILE__, __LINE__, __METHOD__, 10); //Check to see if employee is even assigned to pay period schedule. $ppslf = new PayPeriodScheduleListFactory(); $ppslf->getByCompanyIdAndUserId($current_company->getId(), $user_id); if ($ppslf->getRecordCount() > 0) { Debug::text('Pay Period Schedule Found!', __FILE__, __LINE__, __METHOD__, 10); $is_assigned_pay_period_schedule = TRUE; } } $smarty->assign_by_ref('is_assigned_pay_period_schedule', $is_assigned_pay_period_schedule); $action_options = array('0' => TTi18n::gettext('-- Select Action --'), 'recalculate employee' => TTi18n::gettext('Recalculate Employee'), 'recalculate company' => TTi18n::gettext('Recalculate Company')); if ($permission->Check('pay_period_schedule', 'enabled') and ($permission->Check('pay_period_schedule', 'edit') or $permission->Check('pay_period_schedule', 'edit_own'))) { $action_options['recalculate pay stub'] = TTi18n::gettext('Recalculate Pay Stub'); } if (isset($pay_period_obj) and is_object($pay_period_obj) and $pay_period_obj->getStatus() == 30) { //Add a spacer so its less likely for someone to accidently hit "Recalc Pay Stub" //instead of calculate adjustment. $action_options['-1'] = '---'; $action_options['calculate adjustment'] = 'Calculate PS Adjustment';