当前位置: 首页>>代码示例>>PHP>>正文


PHP Report::getOptions方法代码示例

本文整理汇总了PHP中Report::getOptions方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::getOptions方法的具体用法?PHP Report::getOptions怎么用?PHP Report::getOptions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Report的用法示例。


在下文中一共展示了Report::getOptions方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = array_merge(parent::getOptions('default_output_format'), array('-1100-pdf_form' => TTi18n::gettext('Employee (One Employee/Page)'), '-1110-pdf_form_government' => TTi18n::gettext('Government (Multiple Employees/Page)'), '-1120-efile_xml' => TTi18n::gettext('eFile')));
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             //$retval = TTDate::getReportDateOptions( NULL, TTi18n::getText('Date'), 13, TRUE );
             $retval = array();
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'T4SummaryReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'T4SummaryReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'T4SummaryReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'T4SummaryReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1035-sin' => TTi18n::gettext('SIN/SSN'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1400-permission_control' => TTi18n::gettext('Permission Group'), '-1410-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1420-policy_group' => TTi18n::gettext('Policy Group'));
             $retval = array_merge($retval, $this->getOptions('date_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2100-income' => TTi18n::gettext('Income (14)'), '-2110-tax' => TTi18n::gettext('Income Tax (22)'), '-2120-employee_cpp' => TTi18n::gettext('Employee CPP (16)'), '-2125-ei_earnings' => TTi18n::gettext('EI Insurable Earnings (24)'), '-2126-cpp_earnings' => TTi18n::gettext('CPP Pensionable Earnings (26)'), '-2130-employee_ei' => TTi18n::gettext('Employee EI (18)'), '-2140-union_dues' => TTi18n::gettext('Union Dues (44)'), '-2150-employer_cpp' => TTi18n::gettext('Employer CPP'), '-2160-employer_ei' => TTi18n::gettext('Employer EI'), '-2170-rpp' => TTi18n::gettext('RPP Contributions (20)'), '-2180-charity' => TTi18n::gettext('Charity Donations (46)'), '-2190-pension_adjustment' => TTi18n::gettext('Pension Adjustment (52)'), '-2200-other_box_0' => TTi18n::gettext('Other Box 1'), '-2210-other_box_1' => TTi18n::gettext('Other Box 2'), '-2220-other_box_2' => TTi18n::gettext('Other Box 3'), '-2220-other_box_3' => TTi18n::gettext('Other Box 4'), '-2220-other_box_4' => TTi18n::gettext('Other Box 5'), '-2220-other_box_5' => TTi18n::gettext('Other Box 6'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     $retval[$column] = 'currency';
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         default:
                             $retval[$column] = 'sum';
                     }
                 }
             }
             break;
         case 'type':
             $retval = array('-1010-O' => TTi18n::getText('Original'), '-1020-A' => TTi18n::getText('Amended'), '-1030-C' => TTi18n::getText('Cancel'));
             break;
         case 'templates':
             $retval = array('-1020-by_employee' => TTi18n::gettext('by Employee'), '-1030-by_branch' => TTi18n::gettext('by Branch'), '-1040-by_department' => TTi18n::gettext('by Department'), '-1050-by_branch_by_department' => TTi18n::gettext('by Branch/Department'));
             break;
         case 'template_config':
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:T4SummaryReport.class.php

示例2: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2000-currency_id' => TTi18n::gettext('Currency'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'date_columns':
             $retval = array_merge(TTDate::getReportDateOptions('hire', TTi18n::getText('Hire Date'), 17, FALSE), TTDate::getReportDateOptions('termination', TTi18n::getText('Termination Date'), 18, FALSE), TTDate::getReportDateOptions('birth', TTi18n::getText('Birth Date'), 19, FALSE), TTDate::getReportDateOptions('created', TTi18n::getText('Created Date'), 20, FALSE), TTDate::getReportDateOptions('updated', TTi18n::getText('Updated Date'), 21, FALSE));
             break;
         case 'custom_columns':
             //Get custom fields for report data.
             $oflf = TTnew('OtherFieldListFactory');
             //User and Punch fields conflict as they are merged together in a secondary process.
             $other_field_names = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), array(10), array(10 => ''));
             if (is_array($other_field_names)) {
                 $retval = Misc::addSortPrefix($other_field_names, 9000);
             }
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'UserSummaryReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'UserSummaryReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'UserSummaryReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'UserSummaryReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1010-user_name' => TTi18n::gettext('User Name'), '-1020-phone_id' => TTi18n::gettext('Quick Punch ID'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1032-employee_number_barcode' => TTi18n::gettext('Barcode'), '-1034-employee_number_qrcode' => TTi18n::gettext('QRcode'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1080-user_group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Branch'), '-1100-default_department' => TTi18n::gettext('Department'), '-1120-default_job' => TTi18n::gettext('Job'), '-1150-default_job_item' => TTi18n::gettext('Task'), '-1190-ethnic_group' => TTi18n::gettext('Ethnicity'), '-1200-permission_control' => TTi18n::gettext('Permission Group'), '-1210-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1220-policy_group' => TTi18n::gettext('Policy Group'), '-1310-sex' => TTi18n::gettext('Gender'), '-1320-address1' => TTi18n::gettext('Address 1'), '-1330-address2' => TTi18n::gettext('Address 2'), '-1340-city' => TTi18n::gettext('City'), '-1350-province' => TTi18n::gettext('Province/State'), '-1360-country' => TTi18n::gettext('Country'), '-1370-postal_code' => TTi18n::gettext('Postal Code'), '-1380-work_phone' => TTi18n::gettext('Work Phone'), '-1391-work_phone_ext' => TTi18n::gettext('Work Phone Ext'), '-1400-home_phone' => TTi18n::gettext('Home Phone'), '-1410-mobile_phone' => TTi18n::gettext('Mobile Phone'), '-1420-fax_phone' => TTi18n::gettext('Fax Phone'), '-1430-home_email' => TTi18n::gettext('Home Email'), '-1440-work_email' => TTi18n::gettext('Work Email'), '-1480-sin' => TTi18n::gettext('SIN/SSN'), '-1490-note' => TTi18n::gettext('Note'), '-1495-tag' => TTi18n::gettext('Tags'), '-1499-hierarchy_control_display' => TTi18n::gettext('Hierarchy'), '-1499-hierarchy_level_display' => TTi18n::gettext('Hierarchy Superiors'), '-1500-institution' => TTi18n::gettext('Bank Institution'), '-1510-transit' => TTi18n::gettext('Bank Transit/Routing'), '-1520-account' => TTi18n::gettext('Bank Account'), '-1619-currency' => TTi18n::gettext('Currency'), '-1620-current_currency' => TTi18n::gettext('Current Currency'), '-1625-type' => TTi18n::gettext('Wage Type'), '-1640-effective_date' => TTi18n::gettext('Wage Effective Date'), '-1650-language_display' => TTi18n::gettext('Language'), '-1660-date_format_display' => TTi18n::gettext('Date Format'), '-1665-time_format_display' => TTi18n::gettext('Time Format'), '-1670-time_unit_format_display' => TTi18n::gettext('Time Units'), '-1680-time_zone_display' => TTi18n::gettext('Time Zone'), '-1690-items_per_page' => TTi18n::gettext('Rows Per page'), '-1695-password_updated_date' => TTi18n::gettext('Password Updated Date'), '-1699-hire_date_age' => TTi18n::gettext('Length of Service'), '-1899-birth_date_age' => TTi18n::gettext('Age'), '-2205-created_by' => TTi18n::gettext('Created By'), '-2215-updated_by' => TTi18n::gettext('Updated By'));
             $retval = array_merge($retval, (array) $this->getOptions('date_columns'), (array) $this->getOptions('custom_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-1630-wage' => TTi18n::gettext('Wage'), '-1635-hourly_rate' => TTi18n::gettext('Hourly Rate'), '-1636-labor_burden_hourly_rate' => TTi18n::gettext('Hourly Rate w/Burden'), '-1637-labor_burden_percent' => TTi18n::gettext('Labor Burden Percent'), '-2000-total_user' => TTi18n::gettext('Total Employees'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, 'wage') !== FALSE or strpos($column, 'hourly_rate') !== FALSE) {
                         $retval[$column] = 'currency';
                     } elseif (strpos($column, 'labor_burden_percent') !== FALSE) {
                         $retval[$column] = 'percent';
                     }
                 }
             }
             $retval['password_updated_date'] = 'time_stamp';
             $retval['effective_date'] = 'date_stamp';
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         default:
                             if (strpos($column, 'hourly_rate') !== FALSE or strpos($column, 'wage') !== FALSE or strpos($column, 'labor_burden_percent') !== FALSE) {
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:UserSummaryReport.class.php

示例3: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2080-schedule_branch_id' => TTi18n::gettext('Schedule Branch'), '-2090-schedule_department_id' => TTi18n::gettext('Schedule Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-3000-status_id' => TTi18n::gettext('Schedule Status'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = TTDate::getReportDateOptions(NULL, TTi18n::getText('Date'), 15, TRUE);
             break;
         case 'custom_columns':
             //Get custom fields for report data.
             $oflf = TTnew('OtherFieldListFactory');
             //User and Punch fields conflict as they are merged together in a secondary process.
             $other_field_names = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), array(10), array(10 => ''));
             if (is_array($other_field_names)) {
                 $retval = Misc::addSortPrefix($other_field_names, 9000);
             }
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'ScheduleSummaryReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'ScheduleSummaryReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'ScheduleSummaryReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'ScheduleSummaryReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1055-city' => TTi18n::gettext('City'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-user_group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1200-permission_control' => TTi18n::gettext('Permission Group'), '-1210-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1220-policy_group' => TTi18n::gettext('Policy Group'), '-1290-note' => TTi18n::gettext('Employee Note'), '-1295-tag' => TTi18n::gettext('Tags'), '-1600-branch' => TTi18n::gettext('Branch'), '-1610-department' => TTi18n::gettext('Department'), '-1620-schedule_policy' => TTi18n::gettext('Schedule Policy'), '-1640-schedule_status' => TTi18n::gettext('Schedule Status'), '-1650-absence_policy' => TTi18n::gettext('Absence Policy'), '-1670-start_time' => TTi18n::gettext('Start Time'), '-1680-end_time' => TTi18n::gettext('End Time'), '-5000-schedule_note' => TTi18n::gettext('Note'));
             $retval = array_merge($retval, (array) $this->getOptions('date_columns'), (array) $this->getOptions('custom_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2010-hourly_rate' => TTi18n::gettext('Hourly Rate'), '-2100-total_time' => TTi18n::gettext('Total Time'), '-2110-total_time_wage' => TTi18n::gettext('Total Time Wage'), '-2112-total_time_wage_burden' => TTi18n::gettext('Total Time Wage Burden'), '-2114-total_time_wage_with_burden' => TTi18n::gettext('Total Time Wage w/Burden'), '-4000-total_shift' => TTi18n::gettext('Total Shifts'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = $this->getOptions('columns');
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, 'absence_policy')) {
                         //Ignore
                     } elseif (strpos($column, 'start_time') !== FALSE or strpos($column, 'end_time') !== FALSE) {
                         $retval[$column] = 'time';
                     } elseif (strpos($column, '_wage') !== FALSE or strpos($column, '_hourly_rate') !== FALSE or strpos($column, 'hourly_rate') !== FALSE) {
                         $retval[$column] = 'currency';
                     } elseif (strpos($column, '_time') or strpos($column, '_policy')) {
                         $retval[$column] = 'time_unit';
                     }
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:ScheduleSummaryReport.class.php

示例4: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-3000-exception_policy_type_id' => TTi18n::gettext('Exception'), '-3050-exception_policy_severity_id' => TTi18n::gettext('Severity'), '-4000-pay_period_id' => TTi18n::gettext('Pay Period'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = array_merge(TTDate::getReportDateOptions(NULL, TTi18n::gettext('Date'), 16, TRUE));
             break;
         case 'custom_columns':
             //Get custom fields for report data.
             $oflf = TTnew('OtherFieldListFactory');
             //User and Punch fields conflict as they are merged together in a secondary process.
             $other_field_names = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), array(10), array(10 => ''));
             if (is_array($other_field_names)) {
                 $retval = Misc::addSortPrefix($other_field_names, 9000);
             }
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'ExceptionReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'ExceptionReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'ExceptionReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'ExceptionReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1010-user_name' => TTi18n::gettext('User Name'), '-1020-phone_id' => TTi18n::gettext('PIN/Phone ID'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1040-user_status' => TTi18n::gettext('Employee Status'), '-1050-title' => TTi18n::gettext('Employee Title'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-user_group' => TTi18n::gettext('Employee Group'), '-1090-default_branch' => TTi18n::gettext('Branch'), '-1100-default_department' => TTi18n::gettext('Department'), '-1130-permission_group' => TTi18n::gettext('Permission Group'), '-1150-severity' => TTi18n::gettext('Severity'), '-1160-exception_policy_type' => TTi18n::gettext('Exception'), '-1180-policy_group' => TTi18n::gettext('Policy Group'), '-1190-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1170-exception_policy_type_id' => TTi18n::gettext('Code'));
             $retval = array_merge($retval, (array) $this->getOptions('date_columns'), (array) $this->getOptions('custom_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2050-total_exception' => TTi18n::gettext('Total Exceptions'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, 'wage') !== FALSE or strpos($column, 'hourly_rate') !== FALSE) {
                         $retval[$column] = 'currency';
                     }
                     if (strpos($column, 'amount') !== FALSE) {
                         $retval[$column] = 'time_unit';
                     }
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:ExceptionReport.class.php

示例5: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-3600-log_action_id' => TTi18n::gettext('Action'), '-3700-log_table_name_id' => TTi18n::gettext('Object'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             /*$retval = array_merge(
             			TTDate::getReportDateOptions( 'start', TTi18n::getText('Start Date'), 16, FALSE ),
             			TTDate::getReportDateOptions( 'end', TTi18n::getText('End Date'), 17, FALSE )
             		);*/
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'AuditTrailReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'AuditTrailReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'AuditTrailReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'AuditTrailReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1010-user_name' => TTi18n::gettext('User Name'), '-1020-phone_id' => TTi18n::gettext('Quick Punch ID'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1040-user_status' => TTi18n::gettext('Employee Status'), '-1050-title' => TTi18n::gettext('Employee Title'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-user_group' => TTi18n::gettext('Employee Group'), '-1090-default_branch' => TTi18n::gettext('Branch'), '-1100-default_department' => TTi18n::gettext('Department'), '-2000-date' => TTi18n::gettext('Date'), '-2100-object' => TTi18n::gettext('Object'), '-2150-action' => TTi18n::gettext('Action'), '-2200-description' => TTi18n::gettext('Description'));
             //$retval = array_merge( $retval, $this->getOptions('date_columns') );
             $retval = array_merge($retval, (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2500-total_log' => TTi18n::gettext('Total'));
             break;
         case 'columns':
             //$retval = array_merge( $this->getOptions('static_columns'), $this->getOptions('dynamic_columns') );
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, 'wage') !== FALSE or strpos($column, 'hourly_rate') !== FALSE) {
                         $retval[$column] = 'currency';
                     }
                     if (strpos($column, 'amount') !== FALSE) {
                         $retval[$column] = 'time_unit';
                     }
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         default:
                             $retval[$column] = 'sum';
                     }
                 }
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:AuditTrailReport.class.php

示例6: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = array_merge(parent::getOptions('default_output_format'), array('-1100-pdf_form' => TTi18n::gettext('Form'), '-1120-efile_xml' => TTi18n::gettext('eFile')));
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2080-code_id' => TTi18n::gettext('Reason'), '-2090-pay_period_type_id' => TTi18n::gettext('Pay Period Type'), '-3000-custom_filter' => TTi18n::gettext('Custom Filter'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = array_merge(TTDate::getReportDateOptions('first', TTi18n::gettext('First Day Worked(Or first day since last ROE)'), 16, FALSE), TTDate::getReportDateOptions('last', TTi18n::gettext('Last Day For Which Paid'), 16, FALSE), TTDate::getReportDateOptions('pay_period_end', TTi18n::gettext('Final Pay Period Ending Date'), 17, FALSE), TTDate::getReportDateOptions('recall', TTi18n::gettext('Expected Date of Recall'), 17, FALSE));
             $retval = array();
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'ROEReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'ROEReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'ROEReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'ROEReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1035-sin' => TTi18n::gettext('SIN/SSN'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1120-code' => TTi18n::gettext('Reason'), '-1130-pay_period_type' => TTi18n::gettext('Pay Period Type'), '-1180-serial' => TTi18n::gettext('Serial No'), '-1190-comments' => TTi18n::gettext('Comments'), '-1400-permission_control' => TTi18n::gettext('Permission Group'), '-1410-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1420-policy_group' => TTi18n::gettext('Policy Group'));
             $retval = array_merge($retval, $this->getOptions('date_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2100-insurable_earnings' => TTi18n::gettext('Insurable Earnings (Box 15B)'), '-2110-vacation_pay' => TTi18n::gettext('Vacation Pay (Box 17A)'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     $retval[$column] = 'numeric';
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         default:
                             $retval[$column] = 'sum';
                     }
                 }
             }
             break;
         case 'type':
             $retval = array('-1010-O' => TTi18n::getText('Original'), '-1020-A' => TTi18n::getText('Amended'), '-1030-C' => TTi18n::getText('Cancel'));
             break;
         case 'templates':
             $retval = array('-1020-by_employee' => TTi18n::gettext('by Employee'), '-1030-by_branch' => TTi18n::gettext('by Branch'), '-1040-by_department' => TTi18n::gettext('by Department'), '-1050-by_branch_by_department' => TTi18n::gettext('by Branch/Department'));
             break;
         case 'template_config':
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:ROEReport.class.php

示例7: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             if ($this->getUserObject()->getCompanyObject()->getProductEdition() >= TT_PRODUCT_CORPORATE) {
                 $professional_edition_setup_fields = array('-2510-job_status_id' => TTi18n::gettext('Job Status'), '-2520-job_group_id' => TTi18n::gettext('Job Group'), '-2530-include_job_id' => TTi18n::gettext('Include Job'), '-2540-exclude_job_id' => TTi18n::gettext('Exclude Job'), '-2610-job_item_group_id' => TTi18n::gettext('Task Group'), '-2620-include_job_item_id' => TTi18n::gettext('Include Task'), '-2630-exclude_job_item_id' => TTi18n::gettext('Exclude Task'));
                 $retval = array_merge($retval, $professional_edition_setup_fields);
             }
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             /*
             $retval = array_merge(
             					TTDate::getReportDateOptions( 'time_stamp', TTi18n::getText('Punch Time'), 19, FALSE ),
             					array()
             				);
             */
             break;
         case 'custom_columns':
             //Get custom fields for report data.
             $oflf = TTnew('OtherFieldListFactory');
             //User and Punch fields conflict as they are merged together in a secondary process.
             $other_field_names = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), array(10), array(10 => ''));
             if (is_array($other_field_names)) {
                 $retval = Misc::addSortPrefix($other_field_names, 9000);
             }
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'ActiveShiftReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'ActiveShiftReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'ActiveShiftReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'ActiveShiftReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1010-user_name' => TTi18n::gettext('User Name'), '-1020-phone_id' => TTi18n::gettext('Quick Punch ID'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1050-title' => TTi18n::gettext('Title'), '-1080-user_group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Branch'), '-1100-default_department' => TTi18n::gettext('Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1200-permission_control' => TTi18n::gettext('Permission Group'), '-1210-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1220-policy_group' => TTi18n::gettext('Policy Group'), '-1310-sex' => TTi18n::gettext('Gender'), '-1320-address1' => TTi18n::gettext('Address 1'), '-1330-address2' => TTi18n::gettext('Address 2'), '-1340-city' => TTi18n::gettext('City'), '-1350-province' => TTi18n::gettext('Province/State'), '-1360-country' => TTi18n::gettext('Country'), '-1370-postal_code' => TTi18n::gettext('Postal Code'), '-1380-work_phone' => TTi18n::gettext('Work Phone'), '-1391-work_phone_ext' => TTi18n::gettext('Work Phone Ext'), '-1400-home_phone' => TTi18n::gettext('Home Phone'), '-1410-mobile_phone' => TTi18n::gettext('Mobile Phone'), '-1420-fax_phone' => TTi18n::gettext('Fax Phone'), '-1430-home_email' => TTi18n::gettext('Home Email'), '-1440-work_email' => TTi18n::gettext('Work Email'), '-1495-tag' => TTi18n::gettext('Tags'), '-1740-time_zone_display' => TTi18n::gettext('Time Zone'), '-1801-type' => TTi18n::gettext('Type'), '-1802-status' => TTi18n::gettext('Status'), '-1810-branch' => TTi18n::gettext('Branch'), '-1820-department' => TTi18n::gettext('Department'), '-1830-station_type' => TTi18n::gettext('Station Type'), '-1840-station_station_id' => TTi18n::gettext('Station ID'), '-1850-station_source' => TTi18n::gettext('Station Source'), '-1860-station_description' => TTi18n::gettext('Station Description'), '-1900-time_stamp' => TTi18n::gettext('Punch Time'), '-1910-actual_time_stamp' => TTi18n::gettext('Actual Punch Time'), '-2010-note' => TTi18n::gettext('Note'));
             if ($this->getUserObject()->getCompanyObject()->getProductEdition() >= TT_PRODUCT_CORPORATE) {
                 $professional_edition_static_columns = array('-1825-job' => TTi18n::gettext('Job'), '-1826-job_item' => TTi18n::gettext('Task'));
                 $retval = array_merge($retval, $professional_edition_static_columns, (array) $this->getOptions('report_static_custom_column'));
             }
             break;
         case 'dynamic_columns':
             $retval = array('-2000-total_user' => TTi18n::gettext('Total Employees'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('custom_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, 'wage') !== FALSE or strpos($column, 'hourly_rate') !== FALSE) {
                         $retval[$column] = 'currency';
                     }
                 }
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:ActiveShiftReport.class.php

示例8: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = array_merge(parent::getOptions('default_output_format'), array('-1100-pdf_form' => TTi18n::gettext('Employee (One Employee/Page)'), '-1110-pdf_form_government' => TTi18n::gettext('Government (Multiple Employees/Page)'), '-1120-efile' => TTi18n::gettext('eFile')));
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-4020-exclude_ytd_adjustment' => TTi18n::gettext('Exclude YTD Adjustments'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             //$retval = TTDate::getReportDateOptions( NULL, TTi18n::getText('Date'), 13, TRUE );
             $retval = array();
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'FormW2Report', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'FormW2Report', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'FormW2Report', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'FormW2Report', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1035-sin' => TTi18n::gettext('SIN/SSN'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1080-group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1400-permission_control' => TTi18n::gettext('Permission Group'), '-1410-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1420-policy_group' => TTi18n::gettext('Policy Group'), '-1510-address1' => TTi18n::gettext('Address 1'), '-1512-address2' => TTi18n::gettext('Address 2'), '-1520-city' => TTi18n::gettext('City'), '-1522-province' => TTi18n::gettext('Province/State'), '-1524-country' => TTi18n::gettext('Country'), '-1526-postal_code' => TTi18n::gettext('Postal Code'), '-1530-work_phone' => TTi18n::gettext('Work Phone'), '-1540-work_phone_ext' => TTi18n::gettext('Work Phone Ext'), '-1550-home_phone' => TTi18n::gettext('Home Phone'), '-1560-home_email' => TTi18n::gettext('Home Email'), '-1590-note' => TTi18n::gettext('Note'), '-1595-tag' => TTi18n::gettext('Tags'));
             $retval = array_merge($retval, $this->getOptions('date_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2010-l1' => TTi18n::gettext('Wages (1)'), '-2020-l2' => TTi18n::gettext('Federal Income Tax (2)'), '-2030-l3' => TTi18n::gettext('Social Security Wages (3)'), '-2040-l4' => TTi18n::gettext('Social Security Tax (4)'), '-2040-l7' => TTi18n::gettext('Social Security Tips (7)'), '-2050-l5' => TTi18n::gettext('Medicare Wages (5)'), '-2060-l6' => TTi18n::gettext('Medicare Tax (6)'), '-2070-l8' => TTi18n::gettext('Allocated Tips (8)'), '-2080-l10' => TTi18n::gettext('Dependent Care Benefits (10)'), '-2090-l11' => TTi18n::gettext('Nonqualified Plans (11)'), '-2100-l12a' => TTi18n::gettext('Box 12a'), '-2110-l12b' => TTi18n::gettext('Box 12b'), '-2120-l12c' => TTi18n::gettext('Box 12c'), '-2130-l12d' => TTi18n::gettext('Box 12d'), '-2200-l14a' => TTi18n::gettext('Box 14a'), '-2210-l14b' => TTi18n::gettext('Box 14b'), '-2220-l14c' => TTi18n::gettext('Box 14c'), '-2230-l14d' => TTi18n::gettext('Box 14d'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     $retval[$column] = 'currency';
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         default:
                             $retval[$column] = 'sum';
                     }
                 }
             }
             break;
         case 'templates':
             $retval = array('-1020-by_employee' => TTi18n::gettext('by Employee'), '-1030-by_branch' => TTi18n::gettext('by Branch'), '-1040-by_department' => TTi18n::gettext('by Department'), '-1050-by_branch_by_department' => TTi18n::gettext('by Branch/Department'));
             break;
         case 'template_config':
             $template = strtolower(Misc::trimSortPrefix($params['template']));
             if (isset($template) and $template != '') {
                 switch ($template) {
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:FormW2Report.class.php

示例9: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = array_merge(parent::getOptions('default_output_format'), array('-1100-pdf_form' => TTi18n::gettext('Form')));
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-4020-exclude_ytd_adjustment' => TTi18n::gettext('Exclude YTD Adjustments'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = TTDate::getReportDateOptions(NULL, TTi18n::getText('Date'), 13, TRUE);
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'Form940Report', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'Form940Report', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'Form940Report', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'Form940Report', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1035-sin' => TTi18n::gettext('SIN/SSN'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1400-permission_control' => TTi18n::gettext('Permission Group'), '-1410-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1420-policy_group' => TTi18n::gettext('Policy Group'));
             $retval = array_merge($retval, $this->getOptions('date_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2010-total_payments' => TTi18n::gettext('Total Payments'), '-2020-exempt_payments' => TTi18n::gettext('Exempt Payments'), '-2030-excess_payments' => TTi18n::gettext('Excess Payments'), '-2040-taxable_wages' => TTi18n::gettext('Taxable Wages'), '-2050-before_adjustment_tax' => TTi18n::gettext('Tax Before Adjustments'), '-2052-adjustment_tax' => TTi18n::gettext('Tax Adjustments'), '-2054-after_adjustment_tax' => TTi18n::gettext('Tax After Adjustments'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     $retval[$column] = 'currency';
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         default:
                             $retval[$column] = 'sum';
                     }
                 }
             }
             break;
         case 'state':
             $retval = Misc::prependArray(array(0 => TTi18n::getText('- Multi-state Employer -')), $this->getUserObject()->getCompanyObject()->getOptions('province', 'US'));
             break;
         case 'return_type':
             $retval = array(10 => TTi18n::getText('Amended'), 20 => TTi18n::getText('Successor Employer'), 30 => TTi18n::getText('No Payments to Employees'), 40 => TTi18n::getText('Final: Business closed or stopped paying wages'));
             break;
         case 'exempt_payment':
             $retval = array(10 => TTi18n::getText('4a. Fringe benefits'), 20 => TTi18n::getText('4b. Group term life insurance'), 30 => TTi18n::getText('4c. Retirement/Pension'), 40 => TTi18n::getText('4d. Dependant care'), 50 => TTi18n::getText('4e. Other'));
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:Form940Report.class.php

示例10: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $psf = TTnew('PayStubFactory');
             $retval = array_merge(parent::getOptions('default_output_format'), array('-1100-pdf_employee_pay_stub' => TTi18n::gettext('Employee Pay Stub'), '-1110-pdf_employer_pay_stub' => TTi18n::gettext('Employer Pay Stub')), Misc::addSortPrefix(Misc::trimSortPrefix($psf->getOptions('export_type')), 1200));
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2080-currency_id' => TTi18n::gettext('Currency'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-4020-exclude_ytd_adjustment' => TTi18n::gettext('Exclude YTD Adjustments'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = TTDate::getReportDateOptions('transaction', TTi18n::getText('Transaction Date'), 13, TRUE);
             break;
         case 'custom_columns':
             //Get custom fields for report data.
             $oflf = TTnew('OtherFieldListFactory');
             //User and Punch fields conflict as they are merged together in a secondary process.
             $other_field_names = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), array(10), array(10 => ''));
             if (is_array($other_field_names)) {
                 $retval = Misc::addSortPrefix($other_field_names, 9000);
             }
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'PayStubSummaryReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'PayStubSummaryReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'PayStubSummaryReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'PayStubSummaryReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1055-city' => TTi18n::gettext('City'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-user_group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1131-current_currency' => TTi18n::gettext('Current Currency'), '-1200-permission_control' => TTi18n::gettext('Permission Group'), '-1210-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1220-policy_group' => TTi18n::gettext('Policy Group'), '-1280-sin' => TTi18n::gettext('SIN/SSN'), '-1290-note' => TTi18n::gettext('Note'), '-1295-tag' => TTi18n::gettext('Tags'));
             $retval = array_merge($retval, (array) $this->getOptions('date_columns'), (array) $this->getOptions('custom_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2900-total_pay_stub' => TTi18n::gettext('Total Pay Stubs'));
             $retval = array_merge($retval, $this->getOptions('pay_stub_account_amount_columns'));
             ksort($retval);
             break;
         case 'pay_stub_account_amount_columns':
             //Get all pay stub accounts
             $retval = array();
             $psealf = TTnew('PayStubEntryAccountListFactory');
             $psealf->getByCompanyIdAndStatusIdAndTypeId($this->getUserObject()->getCompany(), 10, array(10, 20, 30, 40, 50, 60, 65));
             if ($psealf->getRecordCount() > 0) {
                 $type_options = $psealf->getOptions('type');
                 foreach ($type_options as $key => $val) {
                     $type_options[$key] = str_replace(array('Employee', 'Employer', 'Deduction', 'Total'), array('EE', 'ER', 'Ded', ''), $val);
                 }
                 $i = 0;
                 foreach ($psealf as $psea_obj) {
                     //Need to make the PSEA_ID a string so we can array_merge it properly later.
                     if ($psea_obj->getType() == 40) {
                         //Total accounts.
                         $prefix = NULL;
                     } else {
                         $prefix = $type_options[$psea_obj->getType()] . ' - ';
                     }
                     $retval['-3' . str_pad($i, 3, 0, STR_PAD_LEFT) . '-PA' . $psea_obj->getID()] = $prefix . $psea_obj->getName();
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:PayStubSummaryReport.class.php

示例11: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2080-punch_branch_id' => TTi18n::gettext('Punch Branch'), '-2090-punch_department_id' => TTi18n::gettext('Punch Department'), '-2000-currency_id' => TTi18n::gettext('Currency'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-4010-pay_period_time_sheet_verify_status_id' => TTi18n::gettext('TimeSheet Verification'), '-4020-include_no_data_rows' => TTi18n::gettext('Include Blank Records'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = TTDate::getReportDateOptions(NULL, TTi18n::getText('Date'), 13, TRUE);
             break;
         case 'custom_columns':
             //Get custom fields for report data.
             $oflf = TTnew('OtherFieldListFactory');
             //User and Punch fields conflict as they are merged together in a secondary process.
             $other_field_names = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), array(10), array(10 => ''));
             if (is_array($other_field_names)) {
                 $retval = Misc::addSortPrefix($other_field_names, 9000);
             }
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'TimesheetSummaryReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'TimesheetSummaryReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'TimesheetSummaryReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'TimesheetSummaryReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1055-city' => TTi18n::gettext('City'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-user_group' => TTi18n::gettext('Employee Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1111-current_currency' => TTi18n::gettext('Current Currency'), '-1400-permission_control' => TTi18n::gettext('Permission Group'), '-1410-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1420-policy_group' => TTi18n::gettext('Policy Group'), '-1430-branch_name' => TTi18n::gettext('Branch'), '-1440-department_name' => TTi18n::gettext('Department'), '-1490-note' => TTi18n::gettext('Note'), '-1495-tag' => TTi18n::gettext('Tags'), '-1510-verified_time_sheet' => TTi18n::gettext('Verified TimeSheet'), '-1515-verified_time_sheet_date' => TTi18n::gettext('Verified TimeSheet Date'));
             $retval = array_merge($retval, (array) $this->getOptions('date_columns'), (array) $this->getOptions('custom_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2070-schedule_working' => TTi18n::gettext('Scheduled Time'), '-2072-schedule_working_diff' => TTi18n::gettext('Scheduled Time Diff.'), '-2080-schedule_absence' => TTi18n::gettext('Scheduled Absence'), '-2085-worked_days' => TTi18n::gettext('Worked Days'), '-2090-worked_time' => TTi18n::gettext('Worked Time'), '-2290-regular_time' => TTi18n::gettext('Regular Time'), '-2500-gross_wage' => TTi18n::gettext('Gross Wage'), '-2501-gross_wage_with_burden' => TTi18n::gettext('Gross Wage w/Burden'), '-2530-regular_time_wage' => TTi18n::gettext('Regular Time - Wage'), '-2531-regular_time_wage_with_burden' => TTi18n::gettext('Regular Time - Wage w/Burden'), '-2690-regular_time_hourly_rate' => TTi18n::gettext('Regular Time - Hourly Rate'), '-2690-regular_time_hourly_rate_with_burden' => TTi18n::gettext('Regular Time - Hourly Rate w/Burden'));
             $retval = array_merge($retval, $this->getOptions('overtime_columns'), $this->getOptions('premium_columns'), $this->getOptions('absence_columns'));
             ksort($retval);
             break;
         case 'overtime_columns':
             //Get all Overtime policies.
             $retval = array();
             $otplf = TTnew('OverTimePolicyListFactory');
             $otplf->getByCompanyId($this->getUserObject()->getCompany());
             if ($otplf->getRecordCount() > 0) {
                 foreach ($otplf as $otp_obj) {
                     $retval['-2291-over_time_policy-' . $otp_obj->getId()] = $otp_obj->getName();
                     $retval['-2591-over_time_policy-' . $otp_obj->getId() . '_wage'] = $otp_obj->getName() . ' ' . TTi18n::getText('- Wage');
                     $retval['-2591-over_time_policy-' . $otp_obj->getId() . '_wage_with_burden'] = $otp_obj->getName() . ' ' . TTi18n::getText('- Wage w/Burden');
                     $retval['-2691-over_time_policy-' . $otp_obj->getId() . '_hourly_rate'] = $otp_obj->getName() . ' ' . TTi18n::getText('- Hourly Rate');
                     $retval['-2691-over_time_policy-' . $otp_obj->getId() . '_hourly_rate_with_burden'] = $otp_obj->getName() . ' ' . TTi18n::getText('- Hourly Rate w/Burden');
                 }
             }
             break;
         case 'premium_columns':
             $retval = array();
             //Get all Premium policies.
             $pplf = TTnew('PremiumPolicyListFactory');
             $pplf->getByCompanyId($this->getUserObject()->getCompany());
             if ($pplf->getRecordCount() > 0) {
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:TimesheetSummaryReport.class.php

示例12: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-4020-exclude_ytd_adjustment' => TTi18n::gettext('Exclude YTD Adjustments'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = TTDate::getReportDateOptions('transaction', TTi18n::getText('Transaction Date'), 13, TRUE);
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'GeneralLedgerSummaryReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'GeneralLedgerSummaryReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'GeneralLedgerSummaryReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'GeneralLedgerSummaryReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-user_group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1200-permission_control' => TTi18n::gettext('Permission Group'), '-1210-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1220-policy_group' => TTi18n::gettext('Policy Group'), '-2010-account' => TTi18n::gettext('Account'));
             $retval = array_merge($retval, $this->getOptions('date_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2100-debit_amount' => TTi18n::gettext('Debit'), '-2110-credit_amount' => TTi18n::gettext('Credit'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, '_amount') !== FALSE) {
                         $retval[$column] = 'currency';
                     }
                 }
             }
             $retval['verified_time_sheet_date'] = 'time_stamp';
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         default:
                             if (strpos($column, '_hourly_rate') !== FALSE or substr($column, 0, 2) == 'PR') {
                                 $retval[$column] = 'avg';
                             } else {
                                 $retval[$column] = 'sum';
                             }
                     }
                 }
             }
             $retval['verified_time_sheet'] = 'first';
             $retval['verified_time_sheet_date'] = 'first';
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:GeneralLedgerSummaryReport.class.php

示例13: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2080-qualification_group_id' => TTi18n::gettext('Qualification Group'), '-2085-qualification_type_id' => TTi18n::gettext('Qualification Type'), '-2090-qualification_id' => TTi18n::gettext('Qualifications'), '-2100-proficiency_id' => TTi18n::gettext('Skill Proficiency'), '-2140-fluency_id' => TTi18n::gettext('Language Fluency'), '-2150-competency_id' => TTi18n::gettext('Language Competency'), '-2170-ownership_id' => TTi18n::gettext('Membership Ownership'), '-2200-membership_renewal_date' => TTi18n::gettext('Membership Renewal Date'), '-2250-skill_expiry_date' => TTi18n::gettext('Skill Expiry Date'), '-2300-license_expiry_date' => TTi18n::gettext('License Expiry Date'), '-3000-custom_filter' => TTi18n::gettext('Custom Filter'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
             //case 'time_period':
         //case 'time_period':
         case 'membership_renewal_date':
         case 'skill_expiry_date':
         case 'license_expiry_date':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = array_merge(TTDate::getReportDateOptions('user.hire', TTi18n::getText('Hire Date'), 15, FALSE), TTDate::getReportDateOptions('user.termination', TTi18n::getText('Termination Date'), 16, FALSE), TTDate::getReportDateOptions('user.birth', TTi18n::getText('Birth Date'), 17, FALSE));
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'UserQualificationReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'UserQualificationReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'UserQualificationReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'UserQualificationReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-user.first_name' => TTi18n::gettext('First Name'), '-1001-user.middle_name' => TTi18n::gettext('Middle Name'), '-1002-user.last_name' => TTi18n::gettext('Last Name'), '-1005-user.full_name' => TTi18n::gettext('Full Name'), '-1010-user.user_name' => TTi18n::gettext('User Name'), '-1020-user.phone_id' => TTi18n::gettext('PIN/Phone ID'), '-1030-user.employee_number' => TTi18n::gettext('Employee #'), '-1040-user.status' => TTi18n::gettext('Employee Status'), '-1050-user.title' => TTi18n::gettext('Title'), '-1060-user.province' => TTi18n::gettext('Province/State'), '-1070-user.country' => TTi18n::gettext('Country'), '-1080-user.user_group' => TTi18n::gettext('Employee Group'), '-1090-user.default_branch' => TTi18n::gettext('Branch'), '-1100-user.default_department' => TTi18n::gettext('Department'), '-1200-user.permission_control' => TTi18n::gettext('Permission Group'), '-1210-user.pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1220-user.policy_group' => TTi18n::gettext('Policy Group'), '-1310-user.sex' => TTi18n::gettext('Gender'), '-1320-user.address1' => TTi18n::gettext('Address 1'), '-1330-user.address2' => TTi18n::gettext('Address 2'), '-1340-user.city' => TTi18n::gettext('City'), '-1370-user.postal_code' => TTi18n::gettext('Postal Code'), '-1380-user.work_phone' => TTi18n::gettext('Work Phone'), '-1391-user.work_phone_ext' => TTi18n::gettext('Work Phone Ext'), '-1400-user.home_phone' => TTi18n::gettext('Home Phone'), '-1410-user.mobile_phone' => TTi18n::gettext('Mobile Phone'), '-1420-user.fax_phone' => TTi18n::gettext('Fax Phone'), '-1430-user.home_email' => TTi18n::gettext('Home Email'), '-1440-user.work_email' => TTi18n::gettext('Work Email'), '-1480-user.sin' => TTi18n::gettext('SIN/SSN'), '-1490-user.note' => TTi18n::gettext('Employee Note'), '-1499-user.hierarchy_control_display' => TTi18n::gettext('Hierarchy'), '-1820-user_wage.type' => TTi18n::gettext('Wage Type'), '-1840-user_wage.effective_date' => TTi18n::gettext('Wage Effective Date'), '-1850-user_wage.note' => TTi18n::gettext('Wage Note'), '-1900-user_preference.language_display' => TTi18n::gettext('Language'), '-1910-user_preference.date_format_display' => TTi18n::gettext('Date Format'), '-1920-user_preference.time_format_display' => TTi18n::gettext('Time Format'), '-1930-user_preference.time_unit_format_display' => TTi18n::gettext('Time Units'), '-1940-user_preference.time_zone_display' => TTi18n::gettext('Time Zone'), '-1950-user_preference.items_per_page' => TTi18n::gettext('Rows Per page'), '-2060-user.password_updated_date' => TTi18n::gettext('Password Updated Date'), '-2080-qualification.type' => TTi18n::gettext('Qualification Type'), '-2010-qualification' => TTi18n::gettext('Qualification'), '-2020-qualification.group' => TTi18n::gettext('Qualification Group'), '-2030-user_skill.proficiency' => TTi18n::gettext('Skill Proficiency'), '-2040-user_skill.experience' => TTi18n::gettext('Skill Experience'), '-2050-user_skill.first_used_date' => TTi18n::gettext('Skill First Used Date'), '-2060-user_skill.last_used_date' => TTi18n::gettext('Skill Last Used Date'), '-2070-user_skill.expiry_date' => TTi18n::gettext('Skill Expiry Date'), '-2090-user_education.institute' => TTi18n::gettext('Institute'), '-2100-user_education.major' => TTi18n::gettext('Major/Specialization'), '-2110-user_education.minor' => TTi18n::gettext('Minor'), '-2120-user_education.graduate_date' => TTi18n::gettext('Graduation Date'), '-2130-user_education.grade_score' => TTi18n::gettext('Grade/Score'), '-2140-user_education.start_date' => TTi18n::gettext('Education Start Date'), '-2150-user_education.end_date' => TTi18n::gettext('Education End Date'), '-2160-user_license.license_number' => TTi18n::gettext('License Number'), '-2170-user_license.license_issued_date' => TTi18n::gettext('License Issued Date'), '-2180-user_license.license_expiry_date' => TTi18n::gettext('License Expiry Date'), '-2190-user_language.fluency' => TTi18n::gettext('Language Fluency'), '-2200-user_language.competency' => TTi18n::gettext('Language Competency'), '-2210-user_membership.ownership' => TTi18n::gettext('Membership Ownership'), '-2240-user_membership.start_date' => TTi18n::gettext('Membership Start Date'), '-2250-user_membership.renewal_date' => TTi18n::gettext('Membership Renewal Date'));
             $retval = array_merge($retval, $this->getOptions('date_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-1830-user_wage.wage' => TTi18n::gettext('Wage'), '-1835-user_wage.hourly_rate' => TTi18n::gettext('Hourly Rate'), '-2220-user_membership.amount' => TTi18n::gettext('Membership Amount'), '-2900-total_user' => TTi18n::gettext('Total Employees'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, 'amount') !== FALSE or strpos($column, 'wage') !== FALSE or strpos($column, 'hourly_rate') !== FALSE) {
                         $retval[$column] = 'currency';
                     }
                 }
             }
             $retval['user.password_updated_date'] = 'time_stamp';
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         case 'user_membership.amount':
                             $retval[$column] = 'sum';
                             break;
                         default:
                             if (strpos($column, 'hourly_rate') !== FALSE or strpos($column, 'wage') !== FALSE) {
                                 $retval[$column] = 'avg';
                             } else {
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:UserQualificationReport.class.php

示例14: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-default_branch_id' => TTi18n::gettext('Default Branch'), '-2070-default_department_id' => TTi18n::gettext('Default Department'), '-2080-punch_branch_id' => TTi18n::gettext('Punch Branch'), '-2090-punch_department_id' => TTi18n::gettext('Punch Department'), '-2100-custom_filter' => TTi18n::gettext('Custom Filter'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             if ($this->getUserObject()->getCompanyObject()->getProductEdition() >= TT_PRODUCT_CORPORATE) {
                 $corporate_edition_setup_fields = array('-2510-job_status_id' => TTi18n::gettext('Job Status'), '-2520-job_group_id' => TTi18n::gettext('Job Group'), '-2530-include_job_id' => TTi18n::gettext('Include Job'), '-2540-exclude_job_id' => TTi18n::gettext('Exclude Job'), '-2610-job_item_group_id' => TTi18n::gettext('Task Group'), '-2620-include_job_item_id' => TTi18n::gettext('Include Task'), '-2630-exclude_job_item_id' => TTi18n::gettext('Exclude Task'));
                 $retval = array_merge($retval, $corporate_edition_setup_fields);
             }
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = TTDate::getReportDateOptions(NULL, TTi18n::getText('Date'), 15, TRUE);
             break;
         case 'custom_columns':
             //Get custom fields for report data.
             $oflf = TTnew('OtherFieldListFactory');
             //User and Punch fields conflict as they are merged together in a secondary process.
             $other_field_names = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), array(15, 20, 30), array(15 => '', 20 => 'job_', 30 => 'job_item_'));
             if (is_array($other_field_names)) {
                 $retval = Misc::addSortPrefix($other_field_names, 9000);
             }
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'PunchSummaryReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'PunchSummaryReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'PunchSummaryReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'PunchSummaryReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-first_name' => TTi18n::gettext('First Name'), '-1001-middle_name' => TTi18n::gettext('Middle Name'), '-1002-last_name' => TTi18n::gettext('Last Name'), '-1005-full_name' => TTi18n::gettext('Full Name'), '-1030-employee_number' => TTi18n::gettext('Employee #'), '-1040-status' => TTi18n::gettext('Status'), '-1050-title' => TTi18n::gettext('Title'), '-1055-city' => TTi18n::gettext('City'), '-1060-province' => TTi18n::gettext('Province/State'), '-1070-country' => TTi18n::gettext('Country'), '-1080-user_group' => TTi18n::gettext('Group'), '-1090-default_branch' => TTi18n::gettext('Default Branch'), '-1100-default_department' => TTi18n::gettext('Default Department'), '-1110-currency' => TTi18n::gettext('Currency'), '-1200-permission_control' => TTi18n::gettext('Permission Group'), '-1210-pay_period_schedule' => TTi18n::gettext('Pay Period Schedule'), '-1220-policy_group' => TTi18n::gettext('Policy Group'), '-1495-tag' => TTi18n::gettext('Tags'), '-1600-in_time_stamp' => TTi18n::gettext('In Punch'), '-1601-in_type' => TTi18n::gettext('In Type'), '-1610-out_time_stamp' => TTi18n::gettext('Out Punch'), '-1611-out_type' => TTi18n::gettext('Out Type'), '-1620-in_actual_time_stamp' => TTi18n::gettext('In (Actual)'), '-1630-out_actual_time_stamp' => TTi18n::gettext('Out (Actual)'), '-1660-branch' => TTi18n::gettext('Branch'), '-1670-department' => TTi18n::gettext('Department'), '-1671-in_station_type' => TTi18n::gettext('In Station Type'), '-1672-in_station_station_id' => TTi18n::gettext('In Station ID'), '-1673-in_station_source' => TTi18n::gettext('In Station Source'), '-1674-in_station_description' => TTi18n::gettext('In Station Description'), '-1675-out_station_type' => TTi18n::gettext('Out Station Type'), '-1676-out_station_station_id' => TTi18n::gettext('Out Station ID'), '-1677-out_station_source' => TTi18n::gettext('Out Station Source'), '-1678-out_station_description' => TTi18n::gettext('Out Station Description'), '-1720-note' => TTi18n::gettext('Note'), '-1900-in_created_date' => TTi18n::gettext('In Created Date'), '-1901-in_created_by' => TTi18n::gettext('In Created By'), '-1905-in_updated_date' => TTi18n::gettext('In Updated Date'), '-1906-in_updated_by' => TTi18n::gettext('In Updated By'), '-1910-out_created_date' => TTi18n::gettext('Out Created Date'), '-1911-out_created_by' => TTi18n::gettext('Out Created By'), '-1915-out_updated_date' => TTi18n::gettext('Out Updated Date'), '-1916-out_updated_by' => TTi18n::gettext('Out Updated By'), '-1920-verified_time_sheet' => TTi18n::gettext('Verified TimeSheet'), '-1925-verified_time_sheet_date' => TTi18n::gettext('Verified TimeSheet Date'), '-1930-verified_time_sheet_tainted' => TTi18n::gettext('TimeSheet Verification Tainted'), '-1950-tainted' => TTi18n::gettext('Tainted'), '-1951-tainted_status' => TTi18n::gettext('Tainted Status'));
             if ($this->getUserObject()->getCompanyObject()->getProductEdition() >= TT_PRODUCT_CORPORATE) {
                 $corporate_edition_static_columns = array('-1810-job' => TTi18n::gettext('Job'), '-1820-job_manual_id' => TTi18n::gettext('Job Code'), '-1830-job_description' => TTi18n::gettext('Job Description'), '-1840-job_status' => TTi18n::gettext('Job Status'), '-1850-job_branch' => TTi18n::gettext('Job Branch'), '-1860-job_department' => TTi18n::gettext('Job Department'), '-1870-job_group' => TTi18n::gettext('Job Group'), '-1910-job_item' => TTi18n::gettext('Task'), '-1920-job_item_manual_id' => TTi18n::gettext('Task Code'), '-1930-job_item_description' => TTi18n::gettext('Task Description'), '-1940-job_item_group' => TTi18n::gettext('Task Group'));
                 $retval = array_merge($retval, $corporate_edition_static_columns);
             }
             $retval = array_merge($retval, (array) $this->getOptions('date_columns'), (array) $this->getOptions('custom_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2010-hourly_rate' => TTi18n::gettext('Hourly Rate'), '-2100-total_time' => TTi18n::gettext('Total Time'), '-2110-total_time_wage' => TTi18n::gettext('Total Time Wage'), '-2112-total_time_wage_burden' => TTi18n::gettext('Total Time Wage Burden'), '-2114-total_time_wage_with_burden' => TTi18n::gettext('Total Time Wage w/Burden'), '-2120-actual_total_time' => TTi18n::gettext('Actual Time'), '-2120-actual_total_time_wage' => TTi18n::gettext('Actual Time Wage'), '-2125-actual_total_time_diff' => TTi18n::gettext('Actual Time Difference'), '-2127-actual_total_time_diff_wage' => TTi18n::gettext('Actual Time Difference Wage'), '-3000-total_punch' => TTi18n::gettext('Total Punches'), '-3001-total_tainted_punch' => TTi18n::gettext('Total Tainted Punches'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, '_wage') !== FALSE or strpos($column, '_hourly_rate') !== FALSE or strpos($column, 'hourly_rate') !== FALSE) {
                         $retval[$column] = 'currency';
                     } elseif (strpos($column, '_time') or strpos($column, '_policy')) {
                         $retval[$column] = 'time_unit';
                     }
                 }
             }
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:PunchSummaryReport.class.php

示例15: _getOptions

 protected function _getOptions($name, $params = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'output_format':
             $retval = parent::getOptions('default_output_format');
             break;
         case 'default_setup_fields':
             $retval = array('template', 'time_period', 'columns');
             break;
         case 'setup_fields':
             $retval = array('-1000-template' => TTi18n::gettext('Template'), '-1010-time_period' => TTi18n::gettext('Time Period'), '-2010-user_status_id' => TTi18n::gettext('Employee Status'), '-2020-user_group_id' => TTi18n::gettext('Employee Group'), '-2030-user_title_id' => TTi18n::gettext('Employee Title'), '-2035-user_tag' => TTi18n::gettext('Employee Tags'), '-2040-include_user_id' => TTi18n::gettext('Employee Include'), '-2050-exclude_user_id' => TTi18n::gettext('Employee Exclude'), '-2060-include_reviewer_user_id' => TTi18n::gettext('Reviewer Include'), '-2070-exclude_reviewer_user_id' => TTi18n::gettext('Reviewer Exclude'), '-2080-default_branch_id' => TTi18n::gettext('Default Branch'), '-2090-default_department_id' => TTi18n::gettext('Default Department'), '-2100-kpi_id' => TTi18n::gettext('Key Performance Indicators'), '-2120-kpi_group_id' => TTi18n::gettext('KPI Group'), '-2130-kpi_status_id' => TTi18n::gettext('KPI Status'), '-2140-kpi_type_id' => TTi18n::gettext('KPI Type'), '-2150-user_review_control_status_id' => TTi18n::gettext('Review Status'), '-2160-user_review_control_type_id' => TTi18n::gettext('Review Type'), '-2170-term_id' => TTi18n::gettext('Review Terms'), '-2180-severity_id' => TTi18n::gettext('Review Severity/Importance'), '-2188-review_tag' => TTi18n::gettext('Review Tags'), '-3000-custom_filter' => TTi18n::gettext('Custom Filter'), '-5000-columns' => TTi18n::gettext('Display Columns'), '-5010-group' => TTi18n::gettext('Group By'), '-5020-sub_total' => TTi18n::gettext('SubTotal By'), '-5030-sort' => TTi18n::gettext('Sort By'));
             break;
         case 'time_period':
             $retval = TTDate::getTimePeriodOptions();
             break;
         case 'date_columns':
             $retval = array_merge(TTDate::getReportDateOptions('user_review_control.start', TTi18n::getText('Start Date'), 16, FALSE), TTDate::getReportDateOptions('user_review_control.end', TTi18n::getText('End Date'), 17, FALSE), TTDate::getReportDateOptions('user_review_control.due', TTi18n::getText('Due Date'), 18, FALSE));
             break;
         case 'report_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 // Because the Filter type is just only a filter criteria and not need to be as an option of Display Columns, Group By, Sub Total, Sort By dropdowns.
                 // So just get custom columns with Selection and Formula.
                 $custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), NULL, 'KPIReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::addSortPrefix($custom_column_labels, 9500);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'KPIReport', 'custom_column');
             }
             break;
         case 'report_dynamic_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_dynamic_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('dynamic_format_ids'), 'KPIReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700);
                 }
             }
             break;
         case 'report_static_custom_column':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $report_static_custom_column_labels = $rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('display_column_type_ids'), $rcclf->getOptions('static_format_ids'), 'KPIReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::addSortPrefix($report_static_custom_column_labels, 9700);
                 }
             }
             break;
         case 'formula_columns':
             $retval = TTMath::formatFormulaColumns(array_merge(array_diff($this->getOptions('static_columns'), (array) $this->getOptions('report_static_custom_column')), $this->getOptions('dynamic_columns')));
             break;
         case 'filter_columns':
             $retval = TTMath::formatFormulaColumns(array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column')));
             break;
         case 'static_columns':
             $retval = array('-1000-kpi.name' => TTi18n::gettext('Key Performance Indicators'), '-1005-kpi.type' => TTi18n::getText('KPI Type'), '-1000-kpi.status' => TTi18n::gettext('KPI Status'), '-1010-kpi.description' => TTi18n::gettext('Description'), '-1020-user.first_name' => TTi18n::gettext('First Name'), '-1030-user.middle_name' => TTi18n::gettext('Middle Name'), '-1040-user.last_name' => TTi18n::gettext('Last Name'), '-1050-user.full_name' => TTi18n::gettext('Full Name'), '-1060-user.status' => TTi18n::gettext('Employee Status'), '-1070-user.sex' => TTi18n::gettext('Gender'), '-1080-user.user_group' => TTi18n::gettext('Employee Group'), '-1090-user.title' => TTi18n::gettext('Employee Title'), '-1100-user.default_branch' => TTi18n::gettext('Branch'), '-1110-user.default_department' => TTi18n::gettext('Department'), '-1120-user.city' => TTi18n::gettext('City'), '-1130-user.province' => TTi18n::gettext('Province/State'), '-1140-user.country' => TTi18n::gettext('Country'), '-1150-user.postal_code' => TTi18n::gettext('Postal Code'), '-1160-user.work_phone' => TTi18n::gettext('Work Phone'), '-1170-user.work_phone_ext' => TTi18n::gettext('Work Phone Ext'), '-1180-user.home_phone' => TTi18n::gettext('Home Phone'), '-1190-user.mobile_phone' => TTi18n::gettext('Mobile Phone'), '-1200-user.fax_phone' => TTi18n::gettext('Fax Phone'), '-1210-user.home_email' => TTi18n::gettext('Home Email'), '-1220-user.work_email' => TTi18n::gettext('Work Email'), '-1230-user.address1' => TTi18n::gettext('Address 1'), '-1240-user.address2' => TTi18n::gettext('Address 2'), '-1244-user.tag' => TTi18n::getText('Employee Tags'), '-1250-user_review_control.reviewer_user' => TTi18n::gettext('Reviewer Name'), '-1260-user_review_control.status' => TTi18n::gettext('Review Status'), '-1270-user_review_control.type' => TTi18n::gettext('Review Type'), '-1280-user_review_control.term' => TTi18n::gettext('Review Terms'), '-1290-user_review_control.severity' => TTi18n::gettext('Review Severity/Importance'), '-1292-user_review_control.tag' => TTi18n::gettext('Review Tags'), '-1300-user_review.note' => TTi18n::gettext('KPI Notes'), '-1350-user.note' => TTi18n::gettext('Employee Notes'), '-1400-user_review_control.note' => TTi18n::gettext('Review Notes'));
             $retval = array_merge($retval, $this->getOptions('date_columns'), (array) $this->getOptions('report_static_custom_column'));
             ksort($retval);
             break;
         case 'dynamic_columns':
             $retval = array('-2000-kpi.minimum_rate' => TTi18n::gettext('Minimum Rating'), '-2010-kpi.maximum_rate' => TTi18n::gettext('Maximum Rating'), '-2020-user_review.rating' => TTi18n::gettext('Rating'), '-2000-total_review' => TTi18n::gettext('Total Reviews'));
             break;
         case 'columns':
             $retval = array_merge($this->getOptions('static_columns'), $this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'));
             break;
         case 'column_format':
             //Define formatting function for each column.
             $columns = array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_custom_column'));
             if (is_array($columns)) {
                 foreach ($columns as $column => $name) {
                     if (strpos($column, 'rate') !== FALSE) {
                         $retval[$column] = 'numeric';
                     }
                 }
             }
             break;
         case 'aggregates':
             $retval = array();
             $dynamic_columns = array_keys(Misc::trimSortPrefix(array_merge($this->getOptions('dynamic_columns'), (array) $this->getOptions('report_dynamic_custom_column'))));
             if (is_array($dynamic_columns)) {
                 foreach ($dynamic_columns as $column) {
                     switch ($column) {
                         case 'kpi.minimum_rate':
                             $retval[$column] = 'min';
                             break;
                         case 'kpi.maximum_rate':
                             $retval[$column] = 'max';
                             break;
                         case 'user_review.rating':
                         case 'total_review':
                             $retval[$column] = 'sum';
                             break;
                     }
                 }
//.........这里部分代码省略.........
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:KPIReport.class.php


注:本文中的Report::getOptions方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。