function setDistrict($district)
 {
     $district = trim($district);
     Debug::Text('Country: ' . $this->getCountry() . ' District: ' . $district, __FILE__, __LINE__, __METHOD__, 10);
     $cf = new CompanyFactory();
     $options_arr = $cf->getOptions('district');
     if (isset($options_arr[$this->getCountry()][$this->getProvince()])) {
         $options = $options_arr[$this->getCountry()][$this->getProvince()];
     } else {
         $options = array();
     }
     if ($district == '' or $district == '00' or $this->Validator->inArrayKey('district', $district, TTi18n::gettext('Invalid District'), $options)) {
         $this->data['district'] = $district;
         return TRUE;
     }
     return FALSE;
 }
示例#2
0
        $cf->FailTransaction();
    default:
        if (isset($id)) {
            BreadCrumb::setCrumb($title);
            $clf = new CompanyListFactory();
            if ($permission->Check('company', 'edit')) {
                $clf->GetByID($id);
            } else {
                $id = $current_company->getId();
                $clf->GetByID($id);
            }
            foreach ($clf as $company) {
                //Debug::Arr($company,'Company', __FILE__, __LINE__, __METHOD__,10);
                $company_data = array('id' => $company->getId(), 'parent' => $company->getParent(), 'status' => $company->getStatus(), 'product_edition' => $company->getProductEdition(), 'name' => $company->getName(), 'short_name' => $company->getShortName(), 'business_number' => $company->getBusinessNumber(), 'originator_id' => $company->getOriginatorID(), 'data_center_id' => $company->getDataCenterID(), 'address1' => $company->getAddress1(), 'address2' => $company->getAddress2(), 'city' => $company->getCity(), 'province' => $company->getProvince(), 'country' => $company->getCountry(), 'postal_code' => $company->getPostalCode(), 'work_phone' => $company->getWorkPhone(), 'fax_phone' => $company->getFaxPhone(), 'admin_contact' => $company->getAdminContact(), 'billing_contact' => $company->getBillingContact(), 'support_contact' => $company->getSupportContact(), 'logo_file_name' => $company->getLogoFileName(NULL, FALSE), 'enable_second_last_name' => $company->getEnableSecondLastName(), 'created_date' => $company->getCreatedDate(), 'created_by' => $company->getCreatedBy(), 'updated_date' => $company->getUpdatedDate(), 'updated_by' => $company->getUpdatedBy(), 'deleted_date' => $company->getDeletedDate(), 'deleted_by' => $company->getDeletedBy());
            }
        }
        //Select box options;
        $company_data['status_options'] = $cf->getOptions('status');
        $company_data['country_options'] = $cf->getOptions('country');
        //Company list.
        $company_data['company_list_options'] = CompanyListFactory::getAllArray();
        $company_data['product_edition_options'] = $cf->getOptions('product_edition');
        if (!isset($id) and isset($company_data['id'])) {
            $id = $company_data['id'];
        }
        $company_data['user_list_options'] = UserListFactory::getByCompanyIdArray($id);
        $smarty->assign_by_ref('company_data', $company_data);
        break;
}
$smarty->assign_by_ref('cf', $cf);
$smarty->display('company/EditCompany.tpl');
/*
 * $Revision: 2095 $
 * $Id: fix_hierarchy.php 2095 2008-09-01 07:04:25Z ipso $
 * $Date: 2008-09-01 00:04:25 -0700 (Mon, 01 Sep 2008) $
 */
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'global.inc.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'includes' . DIRECTORY_SEPARATOR . 'CLI.inc.php';
require_once dirname(__FILE__) . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . 'classes/payroll_deduction/PayrollDeduction.class.php';
if ($argc < 2 or in_array($argv[1], array('--help', '-help', '-h', '-?'))) {
    $help_output = "Usage: generate_payroll_deduction_test_csv.php [country_code] [date]\n";
    echo $help_output;
} else {
    $country = strtoupper($argv[1]);
    $effective_date = strtotime($argv[2]);
    $cf = new CompanyFactory();
    $province_arr = $cf->getOptions('province');
    if (!isset($province_arr[$country])) {
        echo "Country does not have any province/states.\n";
    }
    ksort($province_arr[$country]);
    $pay_periods = 26;
    $static_test_data = array('CA' => array('income' => array(192, 384, 961, 1923, 3846, 9615), 'federal_claim' => array(0, 100), 'provincial_claim' => array(0, 100)), 'US' => array('income' => array(192, 384, 961, 1923, 3846, 9615), 'filing_status' => array(10, 20, 30), 'allowance' => array(0, 1, 2, 3, 5)));
    $test_data = array();
    if ($country != '' and isset($province_arr[$country]) and $effective_date != '') {
        foreach ($province_arr[$country] as $province_code => $province) {
            //echo "Province: $province_code\n";
            //Get all tax rates for each province.
            switch ($country) {
                case 'US':
                    $table = 'income_tax_rate_us';
                    $province_name = 'state';
示例#4
0
    //Redirect
}
$smarty->assign('title', TTi18n::gettext($title = 'Form 940-EZ Report'));
// See index.php
/*
 * Get FORM variables
 */
extract(FormVariables::GetVariables(array('action', 'setup_data', 'generic_data', 'filter_data')));
URLBuilder::setURL($_SERVER['SCRIPT_NAME'], array('filter_data' => $filter_data));
$pseallf = new PayStubEntryAccountLinkListFactory();
$pseallf->getByCompanyId($current_company->getId());
if ($pseallf->getRecordCount() > 0) {
    $pseal_obj = $pseallf->getCurrent();
}
$cf = new CompanyFactory();
$state_options = $cf->getOptions('province', 'US');
$column_ps_entry_name_map = array('p1_1' => @$setup_data['p1_1_psea_ids'], 'p1_2' => @$setup_data['p1_2_psea_ids']);
$pplf = new PayPeriodListFactory();
$year_options = $pplf->getYearsArrayByCompanyId($current_company->getId());
$quarter_dates = array(1 => array('start' => mktime(0, 0, 0, 1, 1, $filter_data['year']), 'end' => mktime(0, 0, -1, 4, 1, $filter_data['year'])), 2 => array('start' => mktime(0, 0, 0, 4, 1, $filter_data['year']), 'end' => mktime(0, 0, -1, 7, 1, $filter_data['year'])), 3 => array('start' => mktime(0, 0, 0, 7, 1, $filter_data['year']), 'end' => mktime(0, 0, -1, 10, 1, $filter_data['year'])), 4 => array('start' => mktime(0, 0, 0, 10, 1, $filter_data['year']), 'end' => mktime(0, 0, -1, 13, 1, $filter_data['year'])));
$filter_data = Misc::preSetArrayValues($filter_data, array('include_user_ids', 'exclude_user_ids', 'user_status_ids', 'group_ids', 'branch_ids', 'department_ids', 'user_title_ids', 'pay_period_ids', 'column_ids'), array());
$ugdlf = new UserGenericDataListFactory();
$ugdf = new UserGenericDataFactory();
$action = Misc::findSubmitButton();
Debug::Text('Action: ' . $action, __FILE__, __LINE__, __METHOD__, 10);
switch ($action) {
    case 'print_form':
    case 'display_form':
    case 'display_report':
        //Debug::setVerbosity(11);
        if ($action == 'print_form') {
                 break;
             }
         }
     }
     $udf->FailTransaction();
 default:
     $cf = new CompanyFactory();
     if (isset($company_deduction_id) and $company_deduction_id != '') {
         Debug::Text('Mass User Deduction Edit!', __FILE__, __LINE__, __METHOD__, 10);
         //Get all employees assigned to this company deduction.
         $cdlf = new CompanyDeductionListFactory();
         $cdlf->getByCompanyIdAndId($current_company->getId(), $company_deduction_id);
         Debug::Text('Company Deduction Records: ' . $cdlf->getRecordCount(), __FILE__, __LINE__, __METHOD__, 10);
         if ($cdlf->getRecordCount() > 0) {
             foreach ($cdlf as $cd_obj) {
                 $province_options = $cf->getOptions('province', $cd_obj->getCountry());
                 $tmp_district_options = $cf->getOptions('district', $cd_obj->getCountry());
                 $district_options = array();
                 if (isset($tmp_district_options[$cd_obj->getProvince()])) {
                     $district_options = $tmp_district_options[$cd_obj->getProvince()];
                 }
                 unset($tmp_district_options);
                 if (!isset($data['users'])) {
                     $data['users'] = NULL;
                 }
                 $data = array('id' => $cd_obj->getId(), 'company_id' => $cd_obj->getCompany(), 'status_id' => $cd_obj->getStatus(), 'status' => Option::getByKey($cd_obj->getStatus(), $cd_obj->getOptions('status')), 'type_id' => $cd_obj->getType(), 'type' => Option::getByKey($cd_obj->getType(), $cd_obj->getOptions('type')), 'name' => $cd_obj->getName(), 'combined_calculation_id' => $cd_obj->getCombinedCalculationId(), 'calculation_id' => $cd_obj->getCalculation(), 'calculation' => Option::getByKey($cd_obj->getCalculation(), $cd_obj->getOptions('calculation')), 'country_id' => $cd_obj->getCountry(), 'country' => Option::getByKey($cd_obj->getCountry(), $cd_obj->getOptions('country')), 'province_id' => $cd_obj->getProvince(), 'province' => Option::getByKey($cd_obj->getProvince(), $province_options), 'district_id' => $cd_obj->getDistrict(), 'district' => Option::getByKey($cd_obj->getDistrict(), $district_options), 'company_value1' => $cd_obj->getCompanyValue1(), 'company_value2' => $cd_obj->getCompanyValue2(), 'default_user_value1' => $cd_obj->getUserValue1(), 'default_user_value2' => $cd_obj->getUserValue2(), 'default_user_value3' => $cd_obj->getUserValue3(), 'default_user_value4' => $cd_obj->getUserValue4(), 'default_user_value5' => $cd_obj->getUserValue5(), 'default_user_value6' => $cd_obj->getUserValue6(), 'default_user_value7' => $cd_obj->getUserValue7(), 'default_user_value8' => $cd_obj->getUserValue8(), 'default_user_value9' => $cd_obj->getUserValue9(), 'default_user_value10' => $cd_obj->getUserValue10(), 'users' => $data['users']);
                 if ($action != 'submit') {
                     $user_ids = $cd_obj->getUser();
                     Debug::Text('Assigned Users: ' . count($user_ids), __FILE__, __LINE__, __METHOD__, 10);
                     if (is_array($user_ids) and count($user_ids) > 0) {
                         //Get User deduction data for each user.
 function setCountry($country)
 {
     $country = trim($country);
     $cf = new CompanyFactory();
     if ($this->Validator->inArrayKey('country', $country, TTi18n::gettext('Invalid Country'), $cf->getOptions('country'))) {
         $this->data['country'] = $country;
         return TRUE;
     }
     return FALSE;
 }
示例#7
0
        $cf->setProvince($company_data['province']);
        $cf->setPostalCode($company_data['postal_code']);
        $cf->setWorkPhone($company_data['work_phone']);
        $cf->setEnableAddCurrency(TRUE);
        $cf->setEnableAddPermissionGroupPreset(TRUE);
        $cf->setEnableAddStation(TRUE);
        $cf->setEnableAddPayStubEntryAccountPreset(TRUE);
        $cf->setEnableAddCompanyDeductionPreset(TRUE);
        $cf->setEnableAddRecurringHolidayPreset(TRUE);
        if ($cf->isValid()) {
            $company_id = $cf->Save();
            $install_obj->writeConfigFile(array('primary_company_id' => $company_id));
            Redirect::Page(URLBuilder::getURL(array('company_id' => $company_id, 'external_installer' => $external_installer), 'User.php'));
            break;
        }
    default:
        //Select box options;
        $company_data['status_options'] = $cf->getOptions('status');
        $company_data['country_options'] = $cf->getOptions('country');
        if (!isset($id) and isset($company_data['id'])) {
            $id = $company_data['id'];
        }
        $company_data['user_list_options'] = UserListFactory::getByCompanyIdArray($id);
        $smarty->assign_by_ref('company_data', $company_data);
        break;
}
$handle = @fopen('http://www.timetrex.com/' . URLBuilder::getURL(array('v' => $install_obj->getFullApplicationVersion(), 'page' => 'company'), 'pre_install.php'), "r");
@fclose($handle);
$smarty->assign_by_ref('cf', $cf);
$smarty->assign_by_ref('external_installer', $external_installer);
$smarty->display('install/Company.tpl');
         	$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');
 $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');
     }
 }
 //Select box options;
 $blf = new BranchListFactory();
 $branch_options = $blf->getByCompanyIdArray($current_company->getId());
 $dlf = new DepartmentListFactory();
 $department_options = $dlf->getByCompanyIdArray($current_company->getId());
 $culf = new CurrencyListFactory();
 $culf->getByCompanyId($current_company->getId());
 $currency_options = $culf->getArrayByListFactory($culf, FALSE, TRUE);
 //Select box options;
 $user_data['branch_options'] = $branch_options;
 $user_data['department_options'] = $department_options;
 $user_data['currency_options'] = $currency_options;
 $cf = new CompanyFactory();
 $user_data['country_options'] = $cf->getOptions('country');
 $user_data['province_options'] = $cf->getOptions('province', $user_data['country']);
 $utlf = new UserTitleListFactory();
 $user_titles = $utlf->getByCompanyIdArray($current_company->getId());
 $user_data['title_options'] = $user_titles;
 //Get Permission Groups
 $pclf = new PermissionControlListFactory();
 $pclf->getByCompanyId($current_company->getId());
 $user_data['permission_control_options'] = $pclf->getArrayByListFactory($pclf, FALSE);
 //Get pay period schedules
 $ppslf = new PayPeriodScheduleListFactory();
 $pay_period_schedules = $ppslf->getByCompanyIDArray($current_company->getId());
 $user_data['pay_period_schedule_options'] = $pay_period_schedules;
 $pglf = new PolicyGroupListFactory();
 $policy_groups = $pglf->getByCompanyIDArray($current_company->getId());
 $user_data['policy_group_options'] = $policy_groups;
示例#10
0
        }
        if ($branch_data['fax_phone'] != '') {
            $bf->setFaxPhone($branch_data['fax_phone']);
        }
        if ($bf->isValid()) {
            $bf->Save();
            Redirect::Page(URLBuilder::getURL(NULL, 'BranchList.php'));
            break;
        }
    default:
        if (isset($id)) {
            BreadCrumb::setCrumb($title);
            $blf = new BranchListFactory();
            $blf->GetByIdAndCompanyId($id, $current_company->getId());
            foreach ($blf as $branch) {
                $branch_data = array('id' => $branch->getId(), 'status' => $branch->getStatus(), 'manual_id' => $branch->getManualID(), 'name' => $branch->getName(), 'address1' => $branch->getAddress1(), 'address2' => $branch->getAddress2(), 'city' => $branch->getCity(), 'province' => $branch->getProvince(), 'country' => $branch->getCountry(), 'postal_code' => $branch->getPostalCode(), 'work_phone' => $branch->getWorkPhone(), 'fax_phone' => $branch->getFaxPhone(), 'created_date' => $branch->getCreatedDate(), 'created_by' => $branch->getCreatedBy(), 'updated_date' => $branch->getUpdatedDate(), 'updated_by' => $branch->getUpdatedBy(), 'deleted_date' => $branch->getDeletedDate(), 'deleted_by' => $branch->getDeletedBy());
            }
        } elseif ($action != 'submit') {
            $next_available_manual_id = BranchListFactory::getNextAvailableManualId($current_company->getId());
            $branch_data = array('country' => $current_company->getCountry(), 'province' => $current_company->getProvince(), 'next_available_manual_id' => $next_available_manual_id);
        }
        //Select box options;
        $branch_data['status_options'] = $bf->getOptions('status');
        $cf = new CompanyFactory();
        $branch_data['country_options'] = $cf->getOptions('country');
        $branch_data['province_options'] = $cf->getOptions('province', $branch_data['country']);
        $smarty->assign_by_ref('branch_data', $branch_data);
        break;
}
$smarty->assign_by_ref('bf', $bf);
$smarty->display('branch/EditBranch.tpl');
 function getProvinceDistrictOptions($country, $province)
 {
     if ($country == '') {
         return FALSE;
     }
     if ($province == '') {
         return FALSE;
     }
     Debug::text('Country: ' . $country . ' Province: ' . $province, __FILE__, __LINE__, __METHOD__, 10);
     $cf = new CompanyFactory();
     $district_arr = $cf->getOptions('district');
     if (isset($district_arr[strtoupper($country)][strtoupper($province)])) {
         Debug::Arr($district_arr[strtoupper($country)][strtoupper($province)], 'District Array', __FILE__, __LINE__, __METHOD__, 10);
         return $district_arr[strtoupper($country)][strtoupper($province)];
     }
     return array();
 }
 function setProvince($province)
 {
     $province = trim($province);
     Debug::Text('Country: ' . $this->getCountry() . ' Province: ' . $province, __FILE__, __LINE__, __METHOD__, 10);
     $cf = new CompanyFactory();
     $options_arr = $cf->getOptions('province');
     if (isset($options_arr[$this->getCountry()])) {
         $options = $options_arr[$this->getCountry()];
     } else {
         $options = array();
     }
     //If country isn't set yet, accept the value and re-validate on save.
     if ($this->getCountry() == FALSE or $this->Validator->inArrayKey('province', $province, TTi18n::gettext('Invalid Province/State'), $options)) {
         $this->data['province'] = $province;
         return TRUE;
     }
     return FALSE;
 }
示例#13
0
     $users[] = array('id' => $u_obj->getId(), 'company_id' => $u_obj->getCompany(), 'employee_number' => $u_obj->getEmployeeNumber(), 'status_id' => $u_obj->getStatus(), 'status' => Option::getByKey($u_obj->getStatus(), $u_obj->getOptions('status')), 'user_name' => $u_obj->getUserName(), 'phone_id' => $u_obj->getPhoneID(), 'ibutton_id' => $u_obj->getIButtonID(), 'full_name' => $u_obj->getFullName(TRUE), 'first_name' => $u_obj->getFirstName(), 'middle_name' => $u_obj->getMiddleName(), 'last_name' => $u_obj->getLastName(), 'title' => Option::getByKey($u_obj->getTitle(), $title_options), 'user_group' => Option::getByKey($u_obj->getGroup(), $group_options), 'default_branch' => Option::getByKey($u_obj->getDefaultBranch(), $branch_options), 'default_department' => Option::getByKey($u_obj->getDefaultDepartment(), $department_options), 'sex_id' => $u_obj->getSex(), 'sex' => Option::getByKey($u_obj->getSex(), $u_obj->getOptions('sex')), 'address1' => $u_obj->getAddress1(), 'address2' => $u_obj->getAddress2(), 'city' => $u_obj->getCity(), 'province' => $u_obj->getProvince(), 'country' => $u_obj->getCountry(), 'postal_code' => $u_obj->getPostalCode(), 'work_phone' => $u_obj->getWorkPhone(), 'home_phone' => $u_obj->getHomePhone(), 'mobile_phone' => $u_obj->getMobilePhone(), 'fax_phone' => $u_obj->getFaxPhone(), 'home_email' => $u_obj->getHomeEmail(), 'work_email' => $u_obj->getWorkEmail(), 'birth_date' => TTDate::getDate('DATE', $u_obj->getBirthDate()), 'sin' => $u_obj->getSIN(), 'hire_date' => TTDate::getDate('DATE', $u_obj->getHireDate()), 'termination_date' => TTDate::getDate('DATE', $u_obj->getTerminationDate()), 'is_owner' => $permission->isOwner($u_obj->getCreatedBy(), $u_obj->getId()), 'is_child' => $permission->isChild($u_obj->getId(), $permission_children_ids), 'deleted' => $u_obj->getDeleted());
 }
 //var_dump($users);
 $all_array_option = array('-1' => TTi18n::gettext('-- Any --'));
 //Select box options;
 if ($permission->Check('company', 'view')) {
     $filter_data['company_options'] = Misc::prependArray($all_array_option, $company_options);
 }
 $filter_data['branch_options'] = Misc::prependArray($all_array_option, $branch_options);
 $filter_data['department_options'] = Misc::prependArray($all_array_option, $department_options);
 $filter_data['title_options'] = Misc::prependArray($all_array_option, $title_options);
 $filter_data['group_options'] = Misc::prependArray($all_array_option, $group_options);
 $filter_data['sex_options'] = Misc::prependArray($all_array_option, $ulf->getOptions('sex'));
 $filter_data['status_options'] = Misc::prependArray($all_array_option, $ulf->getOptions('status'));
 $cf = new CompanyFactory();
 $filter_data['country_options'] = Misc::prependArray($all_array_option, $cf->getOptions('country'));
 if (isset($filter_data['country'])) {
     $filter_data['province_options'] = Misc::prependArray($all_array_option, $cf->getOptions('province', $filter_data['country']));
 } else {
     $filter_data['province_options'] = $all_array_option;
 }
 $ppslf = new PayPeriodScheduleListFactory();
 $filter_data['pay_period_schedule_options'] = Misc::prependArray($all_array_option, $ppslf->getByCompanyIDArray($current_company->getId()));
 $pglf = new PolicyGroupListFactory();
 $filter_data['policy_group_options'] = Misc::prependArray($all_array_option, $pglf->getByCompanyIDArray($current_company->getId()));
 $filter_data['saved_search_options'] = $ugdlf->getArrayByListFactory($ugdlf->getByUserIdAndScript($current_user->getId(), $_SERVER['SCRIPT_NAME']), FALSE);
 //Get column list
 $filter_data['src_column_options'] = Misc::arrayDiffByKey((array) $filter_data['columns'], $columns);
 $filter_data['selected_column_options'] = Misc::arrayIntersectByKey((array) $filter_data['columns'], $columns);
 $filter_data['sort_options'] = Misc::trimSortPrefix($columns);
 $filter_data['sort_direction_options'] = Misc::getSortDirectionArray(TRUE);