$dlf = new DepartmentListFactory(); $dlf->getByCompanyId($current_company->getId()); $department_options = Misc::prependArray($all_array_option, $dlf->getArrayByListFactory($dlf, FALSE, TRUE)); $filter_data['src_department_options'] = Misc::arrayDiffByKey((array) $filter_data['department_ids'], $department_options); $filter_data['selected_department_options'] = Misc::arrayIntersectByKey((array) $filter_data['department_ids'], $department_options); //Get employee titles $utlf = new UserTitleListFactory(); $utlf->getByCompanyId($current_company->getId()); $user_title_options = Misc::prependArray($all_array_option, $utlf->getArrayByListFactory($utlf, FALSE, TRUE)); $filter_data['src_user_title_options'] = Misc::arrayDiffByKey((array) $filter_data['user_title_ids'], $user_title_options); $filter_data['selected_user_title_options'] = Misc::arrayIntersectByKey((array) $filter_data['user_title_ids'], $user_title_options); //Get Company Tax Deductions $cdlf = new CompanyDeductionListFactory(); $cdlf->getByCompanyIdAndTypeId($current_company->getId(), 10); //$company_deduction_options = Misc::prependArray( $all_array_option, $cdlf->getArrayByListFactory( $cdlf, FALSE, TRUE ) ); $company_deduction_options = $cdlf->getArrayByListFactory($cdlf, FALSE, TRUE); $filter_data['src_company_deduction_options'] = Misc::arrayDiffByKey((array) $filter_data['company_deduction_ids'], $company_deduction_options); $filter_data['selected_company_deduction_options'] = Misc::arrayIntersectByKey((array) $filter_data['company_deduction_ids'], $company_deduction_options); //Get column list $filter_data['src_column_options'] = Misc::arrayDiffByKey((array) $filter_data['column_ids'], $columns); $filter_data['selected_column_options'] = Misc::arrayIntersectByKey((array) $filter_data['column_ids'], $columns); //Get transaction date format options $filter_data['transaction_date_format_options'] = array(10 => TTi18n::gettext('Complete Date'), 20 => TTi18n::gettext('Month'), 30 => TTi18n::gettext('Quarter'), 40 => TTi18n::gettext('Year')); //Get primary/secondary order list $filter_data['sort_options'] = $columns; $filter_data['sort_direction_options'] = Misc::getSortDirectionArray(); $filter_data['group_by_options'] = Misc::prependArray(array('0' => TTi18n::gettext('No Grouping')), $static_columns); $saved_report_options = $ugdlf->getByUserIdAndScriptArray($current_user->getId(), $_SERVER['SCRIPT_NAME']); $generic_data['saved_report_options'] = $saved_report_options; $smarty->assign_by_ref('generic_data', $generic_data); $smarty->assign_by_ref('filter_data', $filter_data);