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


PHP Misc::addSortPrefix方法代码示例

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


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

示例1: _getFactoryOptions

 function _getFactoryOptions($name, $parent = NULL)
 {
     $retval = NULL;
     switch ($name) {
         case 'columns':
             $retval = array('-1100-type' => TTi18n::gettext('Type'), '-1110-status' => TTi18n::gettext('Status'), '-1210-time_stamp' => TTi18n::gettext('Date/Time'), '-1220-date' => TTi18n::gettext('Date'), '-1230-time' => TTi18n::gettext('Time'), '-1239-in_type' => TTi18n::gettext('In Type'), '-1240-in_time_stamp' => TTi18n::gettext('In Date/Time'), '-1250-in_punch_date' => TTi18n::gettext('In Date'), '-1260-in_punch_time' => TTi18n::gettext('In Time'), '-1269-out_type' => TTi18n::gettext('Out Type'), '-1270-out_time_stamp' => TTi18n::gettext('Out Date/Time'), '-1280-out_punch_date' => TTi18n::gettext('Out Date'), '-1290-out_punch_time' => TTi18n::gettext('Out Time'), '-1310-branch' => TTi18n::gettext('Branch'), '-1320-department' => TTi18n::gettext('Department'), '-1410-station_id' => TTi18n::gettext('Station ID'), '-1420-longitude' => TTi18n::gettext('Longitude'), '-1430-latitude' => TTi18n::gettext('Latitude'), '-1500-note' => TTi18n::gettext('Note'));
             //Since getOptions() can be called without first setting a company, we don't always know the product edition for the currently
             //logged in employee.
             if (is_object($this->getCompanyObject()) and $this->getCompanyObject()->getProductEdition() >= TT_PRODUCT_CORPORATE or !is_object($this->getCompanyObject()) and getTTProductEdition() >= TT_PRODUCT_CORPORATE) {
                 $retval += array('-1330-job' => TTi18n::gettext('Job'), '-1340-job_item' => TTi18n::gettext('Task'), '-1350-quantity' => TTi18n::gettext('Quantity'), '-1360-bad_quantity' => TTi18n::gettext('Bad Quantity'));
             }
             $retval = Misc::addSortPrefix(Misc::prependArray($this->getUserIdentificationColumns(), Misc::trimSortPrefix($retval)));
             ksort($retval);
             break;
         case 'column_aliases':
             //Used for converting column names after they have been parsed.
             $retval = array('type' => 'type_id', 'status' => 'status_id', 'branch' => 'branch_id', 'department' => 'department_id', 'job' => 'job_id', 'job_item' => 'job_item_id');
             break;
         case 'import_options':
             $retval = array('-1010-fuzzy_match' => TTi18n::getText('Enable smart matching.'), '-1020-disable_rounding' => TTi18n::getText('Disable rounding.'));
             break;
         case 'parse_hint':
             $upf = TTnew('UserPreferenceFactory');
             $retval = array('branch' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'department' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'job' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'job_item' => array('-1010-name' => TTi18n::gettext('Name'), '-1010-manual_id' => TTi18n::gettext('Code')), 'time_stamp' => $upf->getOptions('date_time_format'), 'in_time_stamp' => $upf->getOptions('date_time_format'), 'out_time_stamp' => $upf->getOptions('date_time_format'), 'date' => $upf->getOptions('date_format'), 'in_punch_date' => $upf->getOptions('date_format'), 'out_punch_date' => $upf->getOptions('date_format'), 'time' => $upf->getOptions('time_format'), 'in_punch_time' => $upf->getOptions('time_format'), 'out_punch_time' => $upf->getOptions('time_format'));
             break;
     }
     return $retval;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:28,代码来源:ImportPunch.class.php

示例2: _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

示例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', '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

示例4: _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

示例5: _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

示例6: _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

示例7: _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

示例8: _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

示例9: _getOptions


//.........这里部分代码省略.........
             if (isset($params['export_type']) and isset($hour_column_name_map[$params['export_type']])) {
                 $retval = $hour_column_name_map[$params['export_type']];
             } else {
                 $retval = $hour_column_name_map['csv'];
             }
             break;
         case 'adp_hour_column_options':
             $retval['adp_hour_column_options'][0] = TTi18n::gettext('-- DO NOT EXPORT --');
             $retval['adp_hour_column_options']['-0010-regular_time'] = TTi18n::gettext('Regular Time');
             $retval['adp_hour_column_options']['-0020-overtime'] = TTi18n::gettext('Overtime');
             for ($i = 3; $i <= 4; $i++) {
                 $retval['adp_hour_column_options']['-003' . $i . '-' . $i] = TTi18n::gettext('Hours') . ' ' . $i;
             }
             break;
         case 'adp_company_code_options':
         case 'adp_batch_options':
         case 'adp_temp_dept_options':
             $retval = array(0 => TTi18n::gettext('-- Custom --'), '-0010-default_branch_manual_id' => TTi18n::gettext('Default Branch: Code'), '-0020-default_department_manual_id' => TTi18n::gettext('Default Department: Code'), '-0030-branch_manual_id' => TTi18n::gettext('Branch: Code'), '-0040-department_manual_id' => TTi18n::gettext('Department: Code'));
             $oflf = TTnew('OtherFieldListFactory');
             //Put a colon or underscore in the name, thats how we know it needs to be replaced.
             //Get Branch other fields.
             $default_branch_options = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), 4, '-1000-default_branch_', TTi18n::getText('Default Branch') . ': ');
             if (!is_array($default_branch_options)) {
                 $default_branch_options = array();
             }
             $default_department_options = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), 5, '-2000-default_department_', TTi18n::getText('Default Department') . ': ');
             if (!is_array($default_department_options)) {
                 $default_department_options = array();
             }
             $branch_options = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), 4, '-3000-branch_', TTi18n::getText('Branch') . ': ');
             if (!is_array($branch_options)) {
                 $branch_options = array();
             }
             $department_options = $oflf->getByCompanyIdAndTypeIdArray($this->getUserObject()->getCompany(), 5, '-4000-department_', TTi18n::getText('Department') . ': ');
             if (!is_array($department_options)) {
                 $department_options = array();
             }
             $retval = array_merge($retval, (array) $default_branch_options, (array) $default_department_options, $branch_options, $department_options);
             break;
         case 'quickbooks_proj_options':
         case 'quickbooks_job_options':
         case 'quickbooks_item_options':
             $retval = array(0 => TTi18n::gettext('-- NONE --'), 'default_branch' => TTi18n::gettext('Default Branch'), 'default_department' => TTi18n::gettext('Default Department'), 'group' => TTi18n::gettext('Group'), 'title' => TTi18n::gettext('Title'), 'branch_name' => TTi18n::gettext('Punch Branch'), 'department_name' => TTi18n::gettext('Punch Department'));
             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, 'PayrollExportReport', 'custom_column');
                 if (is_array($custom_column_labels)) {
                     $retval = Misc::prependArray(Misc::addSortPrefix($custom_column_labels, 9500), parent::_getOptions($name, $params));
                 } else {
                     $retval = parent::_getOptions($name, $params);
                 }
             }
             break;
         case 'report_custom_filters':
             if (getTTProductEdition() >= TT_PRODUCT_PROFESSIONAL) {
                 $rcclf = TTnew('ReportCustomColumnListFactory');
                 $retval = Misc::prependArray($rcclf->getByCompanyIdAndTypeIdAndFormatIdAndScriptArray($this->getUserObject()->getCompany(), $rcclf->getOptions('filter_column_type_ids'), NULL, 'PayrollExportReport', 'custom_column'), parent::_getOptions($name, $params));
             }
             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'), 'PayrollExportReport', 'custom_column');
                 if (is_array($report_dynamic_custom_column_labels)) {
                     $retval = Misc::prependArray(Misc::addSortPrefix($report_dynamic_custom_column_labels, 9700), parent::_getOptions($name, $params));
                 } else {
                     $retval = parent::_getOptions($name, $params);
                 }
             }
             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'), 'PayrollExportReport', 'custom_column');
                 if (is_array($report_static_custom_column_labels)) {
                     $retval = Misc::prependArray(Misc::addSortPrefix($report_static_custom_column_labels, 9700), parent::_getOptions($name, $params));
                 } else {
                     $retval = parent::_getOptions($name, $params);
                 }
             }
             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':
             return Misc::prependArray(array_merge(array('-1480-sin' => TTi18n::gettext('SIN/SSN')), (array) $this->getOptions('report_static_custom_column')), parent::_getOptions($name, $params));
             break;
         default:
             return parent::_getOptions($name, $params);
             break;
     }
     return $retval;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:PayrollExportReport.class.php

示例10: getOptions

 function getOptions($name, $parent = NULL)
 {
     if ($parent == NULL or $parent == '') {
         $retarr = $this->_getFactoryOptions($name);
     } else {
         $retarr = $this->_getFactoryOptions($name);
         if (isset($retarr[$parent])) {
             $retarr = $retarr[$parent];
         }
     }
     if ($name == 'columns') {
         //Remove columns that can never be imported.
         $retarr = Misc::trimSortPrefix($retarr);
         unset($retarr['created_by'], $retarr['created_date'], $retarr['updated_by'], $retarr['updated_date']);
         $retarr = Misc::addSortPrefix($retarr);
     }
     if (isset($retarr)) {
         return $retarr;
     }
     return FALSE;
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:21,代码来源:Import.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'), '-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

示例12: getHierarchyControlOptions

 /**
  * Get hierarchy control options sorted by object_type_id
  * @return array
  */
 function getHierarchyControlOptions()
 {
     $hclf = TTnew('HierarchyControlListFactory');
     $hclf->getObjectTypeAppendedListByCompanyID($this->getCurrentCompanyObject()->getId());
     $hierarchy_control_options = $hclf->getArrayByListFactory($hclf, TRUE, TRUE);
     if (is_array($hierarchy_control_options)) {
         foreach ($hierarchy_control_options as $hierarchy_control_object_type_id => $hierarchy_control_options) {
             $retarr[$hierarchy_control_object_type_id] = Misc::addSortPrefix($hierarchy_control_options);
         }
         //Debug::Arr($retarr, 'Hierarchy Control Options: ', __FILE__, __LINE__, __METHOD__, 10);
         return $this->returnHandler($retarr);
     }
     return $this->returnHandler($hierarchy_control_options);
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:18,代码来源:APIHierarchyControl.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'), '-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

示例15: getPreLoginData

 function getPreLoginData($api = NULL)
 {
     global $config_vars;
     return array('primary_company_id' => PRIMARY_COMPANY_ID, 'base_url' => Environment::getBaseURL(), 'api_url' => Environment::getAPIURL($api), 'api_base_url' => Environment::getAPIBaseURL($api), 'api_json_url' => Environment::getAPIURL('json'), 'images_url' => Environment::getImagesURL(), 'powered_by_logo_enabled' => $this->isPoweredByLogoEnabled(), 'product_edition' => $this->getTTProductEdition(FALSE), 'product_edition_name' => $this->getTTProductEdition(TRUE), 'deployment_on_demand' => $this->getDeploymentOnDemand(), 'web_session_expire' => (isset($config_vars['other']['web_session_expire']) and $config_vars['other']['web_session_expire'] != '') ? (bool) $config_vars['other']['web_session_expire'] : FALSE, 'analytics_enabled' => $this->isAnalyticsEnabled(), 'registration_key' => $this->getRegistrationKey(), 'http_host' => $this->getHTTPHost(), 'application_version' => $this->getApplicationVersion(), 'is_logged_in' => $this->isLoggedIn(), 'language_options' => Misc::addSortPrefix(TTi18n::getLanguageArray()), 'language' => TTi18n::getLanguageFromLocale(TTi18n::getLocaleCookie()));
 }
开发者ID:alachaum,项目名称:timetrex,代码行数:5,代码来源:APIAuthentication.class.php


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