$sort_array = array(Misc::trimSortPrefix($sort_column) => $sort_order);
 }
 URLBuilder::setURL($_SERVER['SCRIPT_NAME'], array('sort_column' => Misc::trimSortPrefix($sort_column), 'sort_order' => $sort_order, 'saved_search_id' => $saved_search_id, 'page' => $page));
 $rsclf = new RecurringScheduleControlListFactory();
 $ulf = new UserListFactory();
 if ($permission->Check('recurring_schedule', 'view') == FALSE) {
     if ($permission->Check('recurring_schedule', 'view_child')) {
         $filter_data['permission_children_ids'] = $permission_children_ids;
     }
     if ($permission->Check('recurring_schedule', 'view_own')) {
         $filter_data['permission_children_ids'][] = $current_user->getId();
     }
 }
 $rsclf->getSearchByCompanyIdAndArrayCriteria($current_company->getId(), $filter_data, $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
 $pager = new Pager($rsclf);
 $utlf = new UserTitleListFactory();
 $utlf->getByCompanyId($current_company->getId());
 $title_options = $utlf->getArrayByListFactory($utlf, FALSE, TRUE);
 $blf = new BranchListFactory();
 $blf->getByCompanyId($current_company->getId());
 $branch_options = $blf->getArrayByListFactory($blf, FALSE, TRUE);
 $dlf = new DepartmentListFactory();
 $dlf->getByCompanyId($current_company->getId());
 $department_options = $dlf->getArrayByListFactory($dlf, FALSE, TRUE);
 $uglf = new UserGroupListFactory();
 $group_options = $uglf->getArrayByNodes(FastTree::FormatArray($uglf->getByCompanyIdArray($current_company->getId()), 'TEXT', TRUE));
 $rstclf = new RecurringScheduleTemplateControlListFactory();
 $template_options = $rstclf->getByCompanyIdArray($current_company->getId(), FALSE, TRUE);
 foreach ($rsclf as $rsc_obj) {
     $user_id = $rsc_obj->getColumn('user_id');
     $ulf = new UserListFactory();
示例#2
0
 $filter_data['src_group_options'] = Misc::arrayDiffByKey((array) $filter_data['group_ids'], $group_options);
 $filter_data['selected_group_options'] = Misc::arrayIntersectByKey((array) $filter_data['group_ids'], $group_options);
 //Get branches
 $blf = new BranchListFactory();
 $blf->getByCompanyId($current_company->getId());
 $branch_options = Misc::prependArray($all_array_option, $blf->getArrayByListFactory($blf, FALSE, TRUE));
 $filter_data['src_branch_options'] = Misc::arrayDiffByKey((array) $filter_data['branch_ids'], $branch_options);
 $filter_data['selected_branch_options'] = Misc::arrayIntersectByKey((array) $filter_data['branch_ids'], $branch_options);
 //Get departments
 $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);
 //Deduction PSEA accounts
 $psealf = new PayStubEntryAccountListFactory();
 $filter_data['deduction_pay_stub_entry_account_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(20, 30, 40), TRUE);
 $filter_data['earning_pay_stub_entry_account_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 40), TRUE);
 $filter_data['income_pay_stub_entry_account_options'] = $psealf->getByCompanyIdAndStatusIdAndTypeIdArray($current_company->getId(), 10, array(10, 30, 40), TRUE);
 //Get employee list
 //$filter_data['user_options'] = UserListFactory::getByCompanyIdArray( $current_company->getId(), FALSE );
 //Quarters
 $filter_data['year_options'] = $year_options;
 $setup_data['state_options'] = $state_options;
 $saved_report_options = $ugdlf->getByUserIdAndScriptArray($current_user->getId(), $_SERVER['SCRIPT_NAME']);
示例#3
0
        } else {
            $delete = FALSE;
        }
        $utlf = new UserTitleListFactory();
        foreach ($ids as $id) {
            $utlf->GetByIdAndCompanyId($id, $current_company->getId());
            foreach ($utlf as $title_obj) {
                $title_obj->setDeleted($delete);
                $title_obj->Save();
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'UserTitleList.php'));
        break;
    default:
        $sort_array = NULL;
        if ($sort_column != '') {
            $sort_array = array(Misc::trimSortPrefix($sort_column) => $sort_order);
        }
        $utlf = new UserTitleListFactory();
        $utlf->getByCompanyId($current_company->getId(), $current_user_prefs->getItemsPerPage(), $page, NULL, $sort_array);
        $pager = new Pager($utlf);
        foreach ($utlf as $title_obj) {
            $titles[] = array('id' => $title_obj->GetId(), 'name' => $title_obj->getName(), 'deleted' => $title_obj->getDeleted());
        }
        $smarty->assign_by_ref('titles', $titles);
        $smarty->assign_by_ref('sort_column', $sort_column);
        $smarty->assign_by_ref('sort_order', $sort_order);
        $smarty->assign_by_ref('paging_data', $pager->getPageVariables());
        break;
}
$smarty->display('users/UserTitleList.tpl');
 function setTitle($id)
 {
     $id = trim($id);
     Debug::Text('Title ID: ' . $id, __FILE__, __LINE__, __METHOD__, 10);
     $utlf = new UserTitleListFactory();
     if ($id == 0 or $this->Validator->isResultSetWithRows('title', $utlf->getByID($id), TTi18n::gettext('Title is invalid'))) {
         $this->data['title_id'] = $id;
         return TRUE;
     }
     return FALSE;
 }
示例#5
0
     $dlf->getByCompanyId($mapped_row['company_id']);
     if ($dlf->getRecordCount() > 0) {
         foreach ($dlf as $d_obj) {
             $department_options[$d_obj->getId()] = $d_obj->getName();
             $department_manual_id_options[$d_obj->getId()] = $d_obj->getManualId();
         }
     }
     //$department_options = (array)$dlf->getArrayByListFactory( $dlf, FALSE, TRUE );
     unset($dlf, $d_obj);
     //Get groups
     $uglf = new UserGroupListFactory();
     $uglf->getByCompanyId($mapped_row['company_id']);
     $group_options = (array) $uglf->getArrayByListFactory($uglf, FALSE, TRUE);
     unset($uglf);
     //Get job titles
     $utlf = new UserTitleListFactory();
     $utlf->getByCompanyId($mapped_row['company_id']);
     $title_options = (array) $utlf->getArrayByListFactory($utlf, FALSE, TRUE);
     unset($utlf);
     $uf->setCompany(Misc::importCallInputParseFunction('company_id', $mapped_row['company_id'], $filtered_import_map['company_id']['default_value'], $filtered_import_map['company_id']['parse_hint']));
 }
 if (isset($mapped_row['status_id']) and $mapped_row['status_id'] != '') {
     $uf->setStatus(Misc::importCallInputParseFunction('status_id', $mapped_row['status_id'], $filtered_import_map['status_id']['default_value'], $filtered_import_map['status_id']['parse_hint']));
 }
 if (isset($mapped_row['currency_id']) and $mapped_row['currency_id'] != '') {
     $uf->setCurrency(Misc::importCallInputParseFunction('currency_id', $mapped_row['currency_id'], $filtered_import_map['currency_id']['default_value'], $filtered_import_map['currency_id']['parse_hint']));
 }
 if (isset($mapped_row['employee_number']) and $mapped_row['employee_number'] != '') {
     $uf->setEmployeeNumber(Misc::importCallInputParseFunction('employee_number', $mapped_row['employee_number'], $filtered_import_map['employee_number']['default_value'], $filtered_import_map['employee_number']['parse_hint']));
 } else {
     $ulf = new UserListFactory();
 function getByCompanyIdArray($company_id)
 {
     $utlf = new UserTitleListFactory();
     $utlf->getByCompanyId($company_id);
     $title_list[0] = '--';
     foreach ($utlf as $title_obj) {
         $title_list[$title_obj->getID()] = $title_obj->getName();
     }
     return $title_list;
 }
示例#7
0
 */
extract(FormVariables::GetVariables(array('action', 'page', 'sort_column', 'sort_order', 'ids')));
URLBuilder::setURL($_SERVER['SCRIPT_NAME'], array('sort_column' => $sort_column, 'sort_order' => $sort_order, 'page' => $page));
Debug::Arr($ids, 'Selected Objects', __FILE__, __LINE__, __METHOD__, 10);
$action = Misc::findSubmitButton();
switch ($action) {
    case 'add':
        Redirect::Page(URLBuilder::getURL(NULL, 'EditWageGroup.php'));
        break;
    case 'delete' or 'undelete':
        if (strtolower($action) == 'delete') {
            $delete = TRUE;
        } else {
            $delete = FALSE;
        }
        $utlf = new UserTitleListFactory();
        foreach ($ids as $id) {
            $utlf->GetByIdAndCompanyId($id, $current_company->getId());
            foreach ($utlf as $title_obj) {
                $title_obj->setDeleted($delete);
                $title_obj->Save();
            }
        }
        Redirect::Page(URLBuilder::getURL(NULL, 'WageGroupList.php'));
        break;
    default:
        $sort_array = NULL;
        if ($sort_column != '') {
            $sort_array = array(Misc::trimSortPrefix($sort_column) => $sort_order);
        }
        $wglf = new WageGroupListFactory();
示例#8
0
 $currency_options = $culf->getArrayByListFactory($culf, FALSE, TRUE);
 $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));
 //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;
 $user_data['company'] = $current_company->getName();
 $user_data['language_options'] = TTi18n::getLanguageArray();