foreach ($udlf as $ud_obj) { if (in_array($ud_obj->getCompanyDeduction(), $deduction_ids)) { unset($data['deduction_options'][$ud_obj->getCompanyDeduction()]); } } } } //Get user full name $ulf = new UserListFactory(); $ulf->getByIdAndCompanyId($data['user_id'], $current_company->getId()); if ($ulf->getRecordCount() > 0) { $data['user_full_name'] = $ulf->getCurrent()->getFullName(); } } //Select box options; $data['us_eic_filing_status_options'] = $cdf->getOptions('us_eic_filing_status'); $data['federal_filing_status_options'] = $cdf->getOptions('federal_filing_status'); $data['state_filing_status_options'] = $cdf->getOptions('state_filing_status'); $data['state_ga_filing_status_options'] = $cdf->getOptions('state_ga_filing_status'); $data['state_nj_filing_status_options'] = $cdf->getOptions('state_nj_filing_status'); $data['state_nc_filing_status_options'] = $cdf->getOptions('state_nc_filing_status'); $data['state_ma_filing_status_options'] = $cdf->getOptions('state_ma_filing_status'); $data['state_al_filing_status_options'] = $cdf->getOptions('state_al_filing_status'); $data['state_ct_filing_status_options'] = $cdf->getOptions('state_ct_filing_status'); $data['state_wv_filing_status_options'] = $cdf->getOptions('state_wv_filing_status'); $data['state_me_filing_status_options'] = $cdf->getOptions('state_me_filing_status'); $data['state_de_filing_status_options'] = $cdf->getOptions('state_de_filing_status'); $data['state_dc_filing_status_options'] = $cdf->getOptions('state_dc_filing_status'); $data['js_arrays'] = $cdf->getJavaScriptArrays(); $smarty->assign_by_ref('data', $data); $smarty->assign_by_ref('saved_search_id', $saved_search_id);
function getObjectAsArray($include_columns = NULL) { $variable_function_map = $this->getVariableToFunctionMap(); if (is_array($variable_function_map)) { $cdf = new CompanyDeductionFactory(); foreach ($variable_function_map as $variable => $function_stub) { if ($include_columns == NULL or isset($include_columns[$variable]) and $include_columns[$variable] == TRUE) { $function = 'get' . $function_stub; switch ($variable) { //CompanyDeduction columns. case 'name': case 'status_id': case 'type_id': case 'calculation_id': //User columns. //User columns. case 'first_name': case 'last_name': $data[$variable] = $this->getColumn($variable); break; //CompanyDeduction columns. //CompanyDeduction columns. case 'type': case 'status': case 'calculation': $data[$variable] = Option::getByKey($this->getColumn($variable . '_id'), $cdf->getOptions($variable)); break; default: if (method_exists($this, $function)) { $data[$variable] = $this->{$function}(); } break; } } } $this->getCreatedAndUpdatedColumns($data, $include_columns); } return $data; }
foreach( $udlf as $ud_obj ) { $user_ids[] = $ud_obj->getUser(); } } else { $user_ids = array(); } unset($udlf, $ud_obj); */ $data = array('id' => $cd_obj->getId(), 'company_id' => $cd_obj->getCompany(), 'status_id' => $cd_obj->getStatus(), 'type_id' => $cd_obj->getType(), 'name' => $cd_obj->getName(), 'start_date' => $cd_obj->getStartDate(), 'end_date' => $cd_obj->getEndDate(), 'minimum_length_of_service' => $cd_obj->getMinimumLengthOfService(), 'minimum_length_of_service_unit_id' => $cd_obj->getMinimumLengthOfServiceUnit(), 'maximum_length_of_service' => $cd_obj->getMaximumLengthOfService(), 'maximum_length_of_service_unit_id' => $cd_obj->getMaximumLengthOfServiceUnit(), 'calculation_id' => $cd_obj->getCalculation(), 'calculation_order' => $cd_obj->getCalculationOrder(), 'country' => $cd_obj->getCountry(), 'province' => $cd_obj->getProvince(), 'district' => $cd_obj->getDistrict(), 'company_value1' => $cd_obj->getCompanyValue1(), 'company_value2' => $cd_obj->getCompanyValue2(), 'user_value1' => $cd_obj->getUserValue1(), 'user_value2' => $cd_obj->getUserValue2(), 'user_value3' => $cd_obj->getUserValue3(), 'user_value4' => $cd_obj->getUserValue4(), 'user_value5' => $cd_obj->getUserValue5(), 'user_value6' => $cd_obj->getUserValue6(), 'user_value7' => $cd_obj->getUserValue7(), 'user_value8' => $cd_obj->getUserValue8(), 'user_value9' => $cd_obj->getUserValue9(), 'user_value10' => $cd_obj->getUserValue10(), 'lock_user_value1' => $cd_obj->getLockUserValue1(), 'lock_user_value2' => $cd_obj->getLockUserValue2(), 'lock_user_value3' => $cd_obj->getLockUserValue3(), 'lock_user_value4' => $cd_obj->getLockUserValue4(), 'lock_user_value5' => $cd_obj->getLockUserValue5(), 'lock_user_value6' => $cd_obj->getLockUserValue6(), 'lock_user_value7' => $cd_obj->getLockUserValue7(), 'lock_user_value8' => $cd_obj->getLockUserValue8(), 'lock_user_value9' => $cd_obj->getLockUserValue9(), 'lock_user_value10' => $cd_obj->getLockUserValue10(), 'pay_stub_entry_account_id' => $cd_obj->getPayStubEntryAccount(), 'include_pay_stub_entry_account_ids' => $cd_obj->getIncludePayStubEntryAccount(), 'exclude_pay_stub_entry_account_ids' => $cd_obj->getExcludePayStubEntryAccount(), 'include_account_amount_type_id' => $cd_obj->getIncludeAccountAmountType(), 'exclude_account_amount_type_id' => $cd_obj->getExcludeAccountAmountType(), 'user_ids' => $cd_obj->getUser(), 'created_date' => $cd_obj->getCreatedDate(), 'created_by' => $cd_obj->getCreatedBy(), 'updated_date' => $cd_obj->getUpdatedDate(), 'updated_by' => $cd_obj->getUpdatedBy(), 'deleted_date' => $cd_obj->getDeletedDate(), 'deleted_by' => $cd_obj->getDeletedBy()); } } elseif ($action != 'submit') { $data = array('country' => 0, 'province' => 0, 'district' => 0, 'user_value1' => 0, 'user_value2' => 0, 'user_value3' => 0, 'user_value4' => 0, 'user_value5' => 0, 'user_value6' => 0, 'user_value7' => 0, 'user_value8' => 0, 'user_value9' => 0, 'user_value10' => 0, 'minimum_length_of_service' => 0, 'maximum_length_of_service' => 0, 'calculation_order' => 100); } //Select box options; $data['status_options'] = $cdf->getOptions('status'); $data['type_options'] = $cdf->getOptions('type'); $data['length_of_service_unit_options'] = $cdf->getOptions('length_of_service_unit'); $data['account_amount_type_options'] = $cdf->getOptions('account_amount_type'); $cf = new CompanyFactory(); $data['country_options'] = Misc::prependArray(array(0 => '--'), $cf->getOptions('country')); if (isset($data['country'])) { $data['province_options'] = $cf->getOptions('province', $data['country']); } if (isset($data['district'])) { $district_options = $cf->getOptions('district', $data['country']); if (isset($district_options[$data['province']])) { $data['district_options'] = $district_options[$data['province']]; } } $data['us_eic_filing_status_options'] = $cdf->getOptions('us_eic_filing_status');