switch ($action) { case 'export': case 'display_report': Debug::Text('Submit!', __FILE__, __LINE__, __METHOD__, 10); //Debug::Arr($filter_data, 'Filter Data', __FILE__, __LINE__, __METHOD__,10); //Get all employees that match the criteria: $ulf = new UserListFactory(); $ulf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data); if ($ulf->getRecordCount() > 0) { foreach ($ulf as $u_obj) { $filter_data['user_ids'][] = $u_obj->getId(); } $ulf->getReportByCompanyIdAndUserIDList($current_company->getId(), $filter_data['user_ids']); //Get title list, $utlf = new UserTitleListFactory(); $user_titles = $utlf->getByCompanyIdArray($current_company->getId()); $uglf = new UserGroupListFactory(); $group_options = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'no_tree_text', TRUE)); //Get default branch list $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();
foreach ($blf as $b_obj) { $branch_code_map[$b_obj->getId()] = $b_obj->getManualID(); } } $dlf = new DepartmentListFactory(); $department_options = $dlf->getByCompanyIdArray($current_company->getId()); //Get Department ID to Branch Code mapping $department_code_map = array(0 => 0); $dlf->getByCompanyId($current_company->getId()); if ($dlf->getRecordCount() > 0) { foreach ($dlf as $d_obj) { $department_code_map[$d_obj->getId()] = $d_obj->getManualID(); } } $utlf = new UserTitleListFactory(); $title_options = $utlf->getByCompanyIdArray($current_company->getId()); $crlf = new CurrencyListFactory(); $crlf->getByCompanyId($current_company->getId()); $currency_options = $crlf->getArrayByListFactory($crlf, FALSE, TRUE); //Get Base Currency $crlf->getByCompanyIdAndBase($current_company->getId(), TRUE); if ($crlf->getRecordCount() > 0) { $base_currency_obj = $crlf->getCurrent(); } $currency_convert_to_base = FALSE; if (in_array('-1', $filter_data['currency_ids']) or count($filter_data['currency_ids']) > 1) { Debug::Text('More then one currency selected, converting to base!', __FILE__, __LINE__, __METHOD__, 10); $currency_convert_to_base = TRUE; } foreach ($pslf as $ps_obj) { $user_obj = $ulf->getById($ps_obj->getUser())->getCurrent();
$hotf = new HierarchyObjectTypeFactory(); $hierarchy_object_type_options = $hotf->getOptions('object_type'); $hclf = new HierarchyControlListFactory(); $hclf->getObjectTypeAppendedListByCompanyID($company_id); $hierarchy_control_options = $hclf->getArrayByListFactory($hclf, TRUE, TRUE); //Select box options; $user_data['branch_options'] = $branch_options; $user_data['department_options'] = $department_options; $user_data['currency_options'] = $currency_options; $user_data['sex_options'] = $uf->getOptions('sex'); $user_data['status_options'] = $uf->getOptions('status'); $clf = new CompanyListFactory(); $user_data['country_options'] = $clf->getOptions('country'); $user_data['province_options'] = $clf->getOptions('province', $user_data['country']); $utlf = new UserTitleListFactory(); $user_titles = $utlf->getByCompanyIdArray($company_id); $user_data['title_options'] = $user_titles; //Get Permission Groups $pclf = new PermissionControlListFactory(); $pclf->getByCompanyId($company_id); $user_data['permission_control_options'] = $pclf->getArrayByListFactory($pclf, FALSE); //Get pay period schedules $ppslf = new PayPeriodScheduleListFactory(); $pay_period_schedules = $ppslf->getByCompanyIDArray($company_id); $user_data['pay_period_schedule_options'] = $pay_period_schedules; $pglf = new PolicyGroupListFactory(); $policy_groups = $pglf->getByCompanyIDArray($company_id); $user_data['policy_group_options'] = $policy_groups; $uglf = new UserGroupListFactory(); $user_data['group_options'] = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($company_id), 'TEXT', TRUE)); //Get other field names